I am trying to zip with the zip
task in Albacore, but I get an error. Is it a problem with IronRuby?
task :publish => :build do
Rake::Task[:service].invoke
Rake::Task[:site].invoke
Rake::Task[:zip_svc].invoke
end
zip :zip_svc do |zip|
zip.directories_to_zip 'publish'
zip.output_file = 'Svc.zip'
zip.output_path = File.dirname(__FILE__)
end
Error>
** Invoke zip_svc (first_time)
** Execute zip_svc
rake aborted!
wrong number of arguments (1 for 2)
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1113:in `<<'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1062:in `<<'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/ioextras.rb:125:in `write'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/ioextras.rb:9:in `copy_stream'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:832:in `write_to_zip_output_stream'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:772:in `get_input_stream'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:832:in `write_to_zip_output_stream'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1515:in `commit'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1153:in `each'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1153:in `each'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1515:in `commit'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:963:in `open'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1512:in `commit'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1601:in `on_success_replace'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1510:in `commit'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1525:in `close'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1415:in `open'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/albacore-0.2.5/lib/albacore/zipdirectory.rb:28:in `execute'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/albacore-0.2.5/lib/albacore/support/createtask.rb:24:in `zip'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `call'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `each'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
c:/IronRuby/Lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
C:/Users/Thiago/projetos/Cosan/mapaestrutura/rakefile.rb:8
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `call'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `each'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
c:/IronRuby/Lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/bin/rake:31
C:/IronRuby/bin/rake:19:in `load'
C:/IronRuby/bin/rake:19
Unfortunately, the zip
task is one of the few items that does not work correctly in IronRuby. I've looked several times, but have not found a suitable replacement for the rubyzip
lib, either. I recommend using an external tool like 7-zip (free/very good tool) and call it from the exec
task.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With