Skip to content

Commit 6b1348a

Browse files
committed
refactor
1 parent abe18ac commit 6b1348a

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

vendors/Rakefile

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,35 +23,35 @@ MAC_OR_LINUX = /linux|mac|darwin/ =~ RbConfig::CONFIG['host_os']
2323
CLOBBER << "jruby-complete-#{JRUBYC_VERSION}.jar"
2424
CLOBBER << "jruby-complete-#{JRUBYC_VERSION}.jar.sha256"
2525

26-
file "jruby-complete-#{JRUBYC_VERSION}.jar.sha256" do
27-
system "#{WGET} https://repo1.maven.org/maven2/org/jruby/jruby-complete/#{JRUBYC_VERSION}/jruby-complete-#{JRUBYC_VERSION}.jar.sha256"
26+
desc 'dependency check'
27+
task :wget_check do
28+
WGET ||= `which wget`
29+
warn WARNING unless WGET
2830
end
2931

30-
desc 'check dependency'
31-
task :check_dependency do
32-
WGET ||= system 'which wget'
33-
warn(WARNING) unless WGET
32+
file "jruby-complete-#{JRUBYC_VERSION}.jar.sha256" do
33+
system "wget https://repo1.maven.org/maven2/org/jruby/jruby-complete/#{JRUBYC_VERSION}/jruby-complete-#{JRUBYC_VERSION}.jar.sha256"
3434
end
3535

36-
desc 'get sha256'
37-
task get_sha256: ["jruby-complete-#{JRUBYC_VERSION}.jar.sha256"]
38-
39-
desc 'download, and copy to jruby_art'
40-
task default: %i[check_dependency get_sha256 download copy_ruby install_samples]
41-
42-
desc 'download JRuby upstream sources'
43-
task download: ["jruby-complete-#{JRUBYC_VERSION}.jar"]
44-
4536
file "jruby-complete-#{JRUBYC_VERSION}.jar" do
4637
begin
47-
system "#{WGET} https://repo1.maven.org/maven2/org/jruby/jruby-complete/#{JRUBYC_VERSION}/jruby-complete-#{JRUBYC_VERSION}.jar"
38+
system "wget https://repo1.maven.org/maven2/org/jruby/jruby-complete/#{JRUBYC_VERSION}/jruby-complete-#{JRUBYC_VERSION}.jar"
4839
rescue NameError
4940
warn(WARNING)
5041
end
5142
value = File.read("jruby-complete-#{JRUBYC_VERSION}.jar.sha256")
5243
check_sha256("jruby-complete-#{JRUBYC_VERSION}.jar", value)
5344
end
5445

46+
desc 'get sha256'
47+
task get_sha256: ['wget_check', "jruby-complete-#{JRUBYC_VERSION}.jar.sha256"]
48+
49+
desc 'download, and copy to jruby_art'
50+
task default: %i[wget_check download copy_ruby install_samples]
51+
52+
desc 'download JRuby upstream sources'
53+
task download: ['get_sha256', "jruby-complete-#{JRUBYC_VERSION}.jar"]
54+
5555
directory '../lib/ruby'
5656

5757
desc 'copy jruby-complete'
@@ -82,22 +82,22 @@ task :init_dir do
8282
end
8383

8484
desc 'download and copy sound library to ~/.jruby_art'
85-
task download_and_copy_sound: %i[check_dependency init_dir download_sound copy_sound clobber]
85+
task download_and_copy_sound: %i[wget_check init_dir download_sound copy_sound clobber]
8686

8787
desc 'download and copy video library to ~/.jruby_art'
88-
task download_and_copy_video: %i[check_dependency init_dir download_video copy_video clobber]
88+
task download_and_copy_video: %i[wget_check init_dir download_video copy_video clobber]
8989

9090
desc 'download sound library'
9191
task :download_sound do
92-
wget_base = "#{WGET} https://github.com/processing/processing-sound"
92+
wget_base = 'wget https://github.com/processing/processing-sound'
9393
wget_string = [wget_base, 'releases/download/latest', SOUND].join('/')
9494
puts wget_string
9595
system wget_string
9696
end
9797

9898
desc 'download video library'
9999
task :download_video do
100-
wget_base = "#{WGET} https://github.com/processing/processing-video"
100+
wget_base = 'wget https://github.com/processing/processing-video'
101101
wget_string = [wget_base, 'releases/download', VIDEO_VERSION, VIDEO].join('/')
102102
system wget_string
103103
end
@@ -126,9 +126,9 @@ task :download_examples
126126
file_name = MAC_OR_LINUX.nil? ? "#{EXAMPLES}.zip" : "#{EXAMPLES}.tar.gz"
127127
file file_name do
128128
if MAC_OR_LINUX.nil?
129-
system "#{WGET} https://github.com/ruby-processing/JRubyArt-examples/archive/#{EXAMPLES}.zip"
129+
system "wget https://github.com/ruby-processing/JRubyArt-examples/archive/#{EXAMPLES}.zip"
130130
else
131-
system "#{WGET} https://github.com/ruby-processing/JRubyArt-examples/archive/#{EXAMPLES}.tar.gz"
131+
system "wget https://github.com/ruby-processing/JRubyArt-examples/archive/#{EXAMPLES}.tar.gz"
132132
end
133133
end
134134

0 commit comments

Comments
 (0)