Class: FPM::RakeTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- FPM::RakeTask
- Defined in:
- lib/fpm/rake_task.rb
Defined Under Namespace
Classes: Options
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Options.
Instance Method Summary collapse
-
#initialize(package_name, opts = {}, &block) ⇒ RakeTask
constructor
A new instance of RakeTask.
Constructor Details
#initialize(package_name, opts = {}, &block) ⇒ RakeTask
Returns a new instance of RakeTask.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/fpm/rake_task.rb', line 34 def initialize(package_name, opts = {}, &block) #@options = OpenStruct.new(:name => package_name.to_s) = Options.new(:name => package_name.to_s) @source, @target = opts.values_at(:source, :target).map(&:to_s) @directory = File.(opts[:directory].to_s) (@source.empty? || @target.empty? || .name.empty?) && abort("Must specify package name, source and output") desc "Package #{@name}" unless ::Rake.application.last_description task(.name) do |_, task_args| block.call(*[, task_args].first(block.arity)) if block_given? abort("Must specify args") if .args.nil? @args = .args run_cli end end |
Instance Attribute Details
#options ⇒ Object (readonly)
Options
32 33 34 |
# File 'lib/fpm/rake_task.rb', line 32 def end |