Class: GitValidation::Task
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- GitValidation::Task
- Includes:
- FileUtils
- Defined in:
- lib/git_validation/task.rb
Overview
Task implements the task for the git-validation tool.
Instance Attribute Summary collapse
-
#from ⇒ Object
Returns the value of attribute from.
-
#quiet ⇒ Object
Returns the value of attribute quiet.
-
#run ⇒ Object
Returns the value of attribute run.
Instance Method Summary collapse
-
#initialize(name = :"git-validation", *args, &block) ⇒ Task
constructor
A new instance of Task.
Constructor Details
#initialize(name = :"git-validation", *args, &block) ⇒ Task
Returns a new instance of Task.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/git_validation/task.rb', line 33 def initialize(name = :"git-validation", *args, &block) set_ivars desc "Run git-validation" unless ::Rake.application.last_description task(name, *args) do |_, task_args| abort("The git-validation command could not be found") unless git_validation? yield(*[self, task_args].slice(0, block.arity)) if block_given? abort("Bad type for 'from' option") unless @from.is_a?(String) execute! end end |
Instance Attribute Details
#from ⇒ Object
Returns the value of attribute from.
29 30 31 |
# File 'lib/git_validation/task.rb', line 29 def from @from end |
#quiet ⇒ Object
Returns the value of attribute quiet.
31 32 33 |
# File 'lib/git_validation/task.rb', line 31 def quiet @quiet end |
#run ⇒ Object
Returns the value of attribute run.
30 31 32 |
# File 'lib/git_validation/task.rb', line 30 def run @run end |