lib/reap/tasks.rb in reap-6.0.0 vs lib/reap/tasks.rb in reap-6.0.1

- old
+ new

@@ -132,11 +132,10 @@ desc "Extract embedded unit tests from scripts" unless desc task name do data = data.to_openobject - data.trunk ||= master.trunk Reap::ExTest.new( data ).extract end end @@ -173,55 +172,58 @@ avail :info do ProjectInfo.exists? end - # == Installer - # - # The installer task generates a specialized - # install.rb script specifically for your - # project. It currently does not support c/c++ - # ext/ compilation. - # - # template Template for installation. (See below) - # options Hash of variable options. Project name - # and version are automatically added this. - # - # The template is a special configuration for installation. - # It should be a literal string with each line containing - # four parts seprated by spaces. - # - # [type] [from] [glob] [to] - # - # There are five types: bin, lib, ext, etc (or conf) and data. - # - # The template use variables in the from of $name. These are filled - # in using the options hash. - # - # Here's a basic example of an entry: - # - # ins: !!installer - # template: | - # bin bin * . - # lib lib **/* $name/$version - # +# # == Installer +# # +# # The installer task generates a specialized +# # install.rb script specifically for your +# # project. It currently does not support c/c++ +# # ext/ compilation. +# # +# # template Template for installation. (See below) +# # options Hash of variable options. Project name +# # and version are automatically added this. +# # +# # The template is a special configuration for installation. +# # It should be a literal string with each line containing +# # four parts seprated by spaces. +# # +# # [type] [from] [glob] [to] +# # +# # There are five types: bin, lib, ext, etc (or conf) and data. +# # +# # The template use variables in the from of $name. These are filled +# # in using the options hash. +# # +# # Here's a basic example of an entry: +# # +# # ins: !!installer +# # template: | +# # bin bin * . +# # lib lib **/* $name/$version +# # +# +# def installer( name, &data ) +# +# require 'reap/class/installer' +# +# desc "Generate install.rb script" unless desc +# +# task name do +# data = data.to_openobject +# +# data.name ||= master.name +# data.version ||= master.version +# +# i = Reap::Installer.new( data ) +# puts i.compile #_and_write +# end +# +# end - def installer( name, &data ) - - require 'reap/class/installer' - - desc "Generate install.rb script" unless desc - - task name do - data = data.to_openobject - data.options[:name] ||= master.name - data.options[:version] ||= master.version - Reap::Installer.new( data ).compile_and_write - end - - end - # == Count # # Count the file and lines of code in your project. # # dir The directory of scripts to count. @@ -231,11 +233,11 @@ desc "Line count project scripts" unless desc task name do data = data.to_openobject - incl = data.include || 'lib/**/*' # TODO maybe check trunk too + incl = data.include || 'lib/**/*' fc, l, c, t, bt, r, rb = 0, 0, 0, 0, false, 0, false Dir.glob( incl ).each do |fname| next unless fname =~ /.*rb/ # TODO should this be done? fc += 1 @@ -286,11 +288,10 @@ desc "Create a MANIFEST file for this package" unless desc task name do data = data.to_openobject - data.trunk ||= master.trunk Reap::Manifest.new( data ).generate end end @@ -354,11 +355,10 @@ data.summary ||= master.summary data.architecture ||= master.architecture data.license ||= master.license data.project ||= master.project data.homepage ||= master.homepage - data.trunk ||= master.trunk Reap::Package.new( data ).generate_packages end end @@ -445,11 +445,10 @@ task name do data = data.to_openobject data.title ||= master.title - data.trunk ||= master.trunk Reap::RDoc.new( data ).call end end @@ -563,14 +562,13 @@ desc "Locally install package using setup.rb" unless desc task name do data = data.to_openobject - data.trunk ||= master.trunk || '.' data.options ||= [] - unless provide_setup_rb( data.trunk ) + unless provide_setup_rb puts "Setup.rb is missing. Forced to cancel task." return nil end puts "Reap is shelling out work to setup.rb..." @@ -581,14 +579,12 @@ exe = %{ruby setup.rb} exe << ' -q ' unless $VERBOSE exe << data.options.join(' ') exe << ' all' - success = false - Dir.chdir( data.trunk ) do - success = sh( exe ) - end + #success = false + success = sh( exe ) puts "Setup complete!" if success end end @@ -661,12 +657,9 @@ desc "Run unit-tests (each in a separate process)" unless desc task name do data = data.to_openobject - - data.trunk ||= master.trunk - Reap::Test.new( data ).call end end