33require 'fileutils'
44require 'rake/clean'
55
6- WARNING = <<- WARN
7- WARNING: you may not have wget installed, you could just download
8- the correct version of jruby-complete to the vendors folder, and
9- re-run k9 setup install instead of installing wget. Some systems
10- may also require 'sudo' access to install, NB: this is untested....
6+ WARNING = <<~ WARN
7+ WARNING: you may not have wget installed, you could just download
8+ the correct version of jruby-complete to the vendors folder, and
9+ re-run k9 setup install instead of installing wget. Some systems
10+ may also require 'sudo' access to install, NB: this is untested....
1111
1212WARN
1313# https://github.com/processing/processing-video/releases/download/r6-v2.0-beta4/video-2.0-beta4.zip
@@ -109,24 +109,20 @@ desc 'download video library'
109109task :download_video do
110110 wget_base = "#{ WGET } https://github.com/processing/processing-video"
111111 wget_string = [ wget_base , 'releases/download' , VIDEO_VERSION , VIDEO ] . join ( '/' )
112- begin
113- sh wget_string
114- rescue NameError
115- warn ( WARNING )
116- end
112+ system wget_string
117113end
118114
119115desc 'copy sound library'
120116task copy_sound : SOUND do
121- sh "unzip #{ SOUND } "
117+ system "unzip #{ SOUND } "
122118 FileUtils . rm_r "#{ HOME_DIR } /.picrate/libraries/sound" if File . exist? "#{ HOME_DIR } /.jruby_art/libraries/sound"
123119 FileUtils . cp_r 'sound' , "#{ HOME_DIR } /.jruby_art/libraries"
124120 FileUtils . rm_r 'sound'
125121end
126122
127123desc 'copy video library'
128124task copy_video : VIDEO do
129- sh "unzip #{ VIDEO } "
125+ system "unzip #{ VIDEO } "
130126 FileUtils . rm_r "#{ HOME_DIR } /.picrate/libraries/video" if File . exist? "#{ HOME_DIR } /.jruby_art/libraries/video"
131127 FileUtils . cp_r 'video' , "#{ HOME_DIR } /.jruby_art/libraries/video"
132128 FileUtils . rm_r 'video'
@@ -139,23 +135,19 @@ desc 'download and copy examples to user home'
139135task :download_examples
140136file_name = MAC_OR_LINUX . nil? ? "#{ EXAMPLES } .zip" : "#{ EXAMPLES } .tar.gz"
141137file file_name do
142- begin
143- if MAC_OR_LINUX . nil?
144- system "#{ WGET } https://github.com/ruby-processing/JRubyArt-examples/archive/#{ EXAMPLES } .zip"
145- else
146- system "#{ WGET } https://github.com/ruby-processing/JRubyArt-examples/archive/#{ EXAMPLES } .tar.gz"
147- end
148- rescue NameError
149- warn ( WARNING )
138+ if MAC_OR_LINUX . nil?
139+ system "#{ WGET } https://github.com/ruby-processing/JRubyArt-examples/archive/#{ EXAMPLES } .zip"
140+ else
141+ system "#{ WGET } https://github.com/ruby-processing/JRubyArt-examples/archive/#{ EXAMPLES } .tar.gz"
150142 end
151143end
152144
153145desc 'copy examples'
154146task copy_examples : file_name do
155147 if MAC_OR_LINUX . nil?
156- sh "unzip #{ EXAMPLES } .zip"
148+ system "unzip #{ EXAMPLES } .zip"
157149 else
158- sh "tar xzvf #{ EXAMPLES } .tar.gz"
150+ system "tar xzvf #{ EXAMPLES } .tar.gz"
159151 end
160152 FileUtils . rm_r ( "#{ HOME_DIR } /k9_samples" ) if File . exist? "#{ HOME_DIR } /k9_samples"
161153 FileUtils . cp_r ( "JRubyArt-examples-#{ EXAMPLES } " , "#{ HOME_DIR } /k9_samples" )
0 commit comments