Class: RakeCommandFilter::RakeTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- RakeCommandFilter::RakeTask
- Defined in:
- lib/rake_command_filter.rb
Overview
Provides a custom rake task.
require ‘rake_command_filter’ RakeCommandFilter::RakeTask.new
Instance Attribute Summary collapse
-
#fail_on_error ⇒ Object
Returns the value of attribute fail_on_error.
-
#formatters ⇒ Object
Returns the value of attribute formatters.
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#patterns ⇒ Object
Returns the value of attribute patterns.
-
#requires ⇒ Object
Returns the value of attribute requires.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
-
#initialize(*args, &task_block) ⇒ RakeTask
constructor
default rake task initializer.
-
#run_definition(defin) { ... } ⇒ Object
call this to run a CommandDefinition subclass.
-
#run_main_task(verbose) ⇒ Object
run all the tasks that have been added via #run_definition.
Constructor Details
#initialize(*args, &task_block) ⇒ RakeTask
default rake task initializer
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/rake_command_filter.rb', line 53 def initialize(*args, &task_block) @name = args.shift || :filter_tasks @verbose = true @commands = [] desc 'TODO: FILL THIS IN THE BLOCK WHERE YOU CREATE THE TASK' instance_eval(&task_block) run_task(name, *args) end |
Instance Attribute Details
#fail_on_error ⇒ Object
Returns the value of attribute fail_on_error.
46 47 48 |
# File 'lib/rake_command_filter.rb', line 46 def fail_on_error @fail_on_error end |
#formatters ⇒ Object
Returns the value of attribute formatters.
48 49 50 |
# File 'lib/rake_command_filter.rb', line 48 def formatters @formatters end |
#name ⇒ Object
Returns the value of attribute name.
44 45 46 |
# File 'lib/rake_command_filter.rb', line 44 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
50 51 52 |
# File 'lib/rake_command_filter.rb', line 50 def @options end |
#patterns ⇒ Object
Returns the value of attribute patterns.
47 48 49 |
# File 'lib/rake_command_filter.rb', line 47 def patterns @patterns end |
#requires ⇒ Object
Returns the value of attribute requires.
49 50 51 |
# File 'lib/rake_command_filter.rb', line 49 def requires @requires end |
#verbose ⇒ Object
Returns the value of attribute verbose.
45 46 47 |
# File 'lib/rake_command_filter.rb', line 45 def verbose @verbose end |
Instance Method Details
#run_definition(defin) { ... } ⇒ Object
call this to run a CommandDefinition subclass
68 69 70 71 72 |
# File 'lib/rake_command_filter.rb', line 68 def run_definition(defin, &block) command = defin defin.instance_eval(&block) if block add_command(command) end |
#run_main_task(verbose) ⇒ Object
run all the tasks that have been added via #run_definition.
75 76 77 |
# File 'lib/rake_command_filter.rb', line 75 def run_main_task(verbose) run_tasks(verbose) end |