Class: Tailor::RakeTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Tailor::RakeTask
- Includes:
- Rake::DSL
- Defined in:
- lib/tailor/rake_task.rb
Overview
This class lets you define Rake tasks to drive tailor. Specifying options is similar to specifying options in a configuration file.
Instance Attribute Summary collapse
-
#config_file ⇒ String
Use a specific configuration file.
-
#formatters ⇒ Object
Returns the value of attribute formatters.
-
#tailor_opts ⇒ Object
Specify any extra options (CLI options).
Instance Method Summary collapse
-
#file_set(file_expression, label = :default, &block) ⇒ Object
Add a file set to critique, just like you would in a config file.
-
#initialize(name = "tailor", desc = "Check style") {|_self| ... } ⇒ RakeTask
constructor
A new instance of RakeTask.
-
#recursive_file_set(file_expression, label = :default, &block) ⇒ Object
Add a recursive file set to critique, just like you would in a config file.
Constructor Details
#initialize(name = "tailor", desc = "Check style") {|_self| ... } ⇒ RakeTask
Returns a new instance of RakeTask.
57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/tailor/rake_task.rb', line 57 def initialize(name = "tailor", desc = "Check style") Tailor::Logger.log = false @name, @desc = name, desc @tailor_opts = [] @file_sets = [] @recursive_file_sets = [] yield self if block_given? define_task end |
Instance Attribute Details
#config_file ⇒ String
Use a specific configuration file. If you have a .tailor file, your RakeTask will automatically use that.
47 48 49 |
# File 'lib/tailor/rake_task.rb', line 47 def config_file @config_file end |
#formatters ⇒ Object
Returns the value of attribute formatters.
53 54 55 |
# File 'lib/tailor/rake_task.rb', line 53 def formatters @formatters end |
#tailor_opts ⇒ Object
Specify any extra options (CLI options). These will override any options set in your config file.
51 52 53 |
# File 'lib/tailor/rake_task.rb', line 51 def tailor_opts @tailor_opts end |
Instance Method Details
#file_set(file_expression, label = :default, &block) ⇒ Object
Add a file set to critique, just like you would in a config file.
74 75 76 |
# File 'lib/tailor/rake_task.rb', line 74 def file_set(file_expression, label=:default, &block) @file_sets << [file_expression, label, block] end |
#recursive_file_set(file_expression, label = :default, &block) ⇒ Object
Add a recursive file set to critique, just like you would in a config file.
83 84 85 |
# File 'lib/tailor/rake_task.rb', line 83 def recursive_file_set(file_expression, label=:default, &block) @recursive_file_sets << [file_expression, label, block] end |