Class: Jackhammer::RakeTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Jackhammer::RakeTask
- Defined in:
- lib/jackhammer/rake_task.rb
Instance Attribute Summary collapse
-
#deps ⇒ Object
Task prerequisites.
-
#description ⇒ Object
Description of the test task.
-
#env ⇒ Object
Specifies the environment to inspect.
-
#name ⇒ Object
Name of test task.
-
#path ⇒ Object
File path of the configuration file.
Instance Method Summary collapse
- #define ⇒ Object
-
#initialize {|_self| ... } ⇒ RakeTask
constructor
A new instance of RakeTask.
Constructor Details
#initialize {|_self| ... } ⇒ RakeTask
Returns a new instance of RakeTask.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/jackhammer/rake_task.rb', line 24 def initialize super @name = :jackhammer @env = 'production' @path = './config/jackhammer.yml' @description = 'Validate Jackhammer configuration' @deps = [] yield self if block_given? if @name.is_a?(Hash) @deps = @name.values.first @name = @name.keys.first end define end |
Instance Attribute Details
#deps ⇒ Object
Task prerequisites.
19 20 21 |
# File 'lib/jackhammer/rake_task.rb', line 19 def deps @deps end |
#description ⇒ Object
Description of the test task. (default is ‘Validate Jackhammer configuration’)
16 17 18 |
# File 'lib/jackhammer/rake_task.rb', line 16 def description @description end |
#env ⇒ Object
Specifies the environment to inspect. (default is ‘production’)
22 23 24 |
# File 'lib/jackhammer/rake_task.rb', line 22 def env @env end |
#name ⇒ Object
Name of test task. (default is :jackhammer)
9 10 11 |
# File 'lib/jackhammer/rake_task.rb', line 9 def name @name end |
#path ⇒ Object
File path of the configuration file. (default is ./config/jackhammer.yml)
12 13 14 |
# File 'lib/jackhammer/rake_task.rb', line 12 def path @path end |
Instance Method Details
#define ⇒ Object
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/jackhammer/rake_task.rb', line 39 def define desc @description task @name => Array(deps) do validator = ConfigurationValidator.new validator.config_yaml = YAML.safe_load(File.read(@path), [], [], true) validator.environment = env validator.validate print_results validator.errors end end |