Class: LintTrappings::RakeTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- LintTrappings::RakeTask
- Defined in:
- lib/lint_trappings/rake_task.rb
Overview
Rake task interface factory for a LintTrappings application.
In your application, define your Rake task factory class as:
require 'lint_trappings/rake_task'
require 'my_app'
module MyApp
class RakeTask < LintTrappings::RakeTask
def initialize(name = :my_app)
@application_class = MyApp::Application
super
end
end
end
Then developers can follow the instructions below (swapping out MyApp/my_app with the appropriate name of your application) to invoke your application via Rake.
You can also specify the list of files as explicit task arguments:
Instance Attribute Summary collapse
-
#config ⇒ String
Path of the configuration file to use.
-
#files ⇒ Array<String>
List of files to lint.
-
#name ⇒ String
Name of the task.
-
#quiet ⇒ true, false
Whether output from application should not be displayed to the standard out stream.
Instance Method Summary collapse
-
#initialize(name) {|_self| ... } ⇒ RakeTask
constructor
Create the task so it exists in the current namespace.
Constructor Details
#initialize(name) {|_self| ... } ⇒ RakeTask
Create the task so it exists in the current namespace.
73 74 75 76 77 78 79 80 81 82 |
# File 'lib/lint_trappings/rake_task.rb', line 73 def initialize(name) @name = name @files = [] @quiet = false # Allow custom configuration to be defined in a block passed to constructor yield self if block_given? define end |
Instance Attribute Details
#config ⇒ String
Path of the configuration file to use.
56 57 58 |
# File 'lib/lint_trappings/rake_task.rb', line 56 def config @config end |
#files ⇒ Array<String>
List of files to lint.
Note that this will be ignored if you explicitly pass a list of files as task arguments via the command line.
63 64 65 |
# File 'lib/lint_trappings/rake_task.rb', line 63 def files @files end |
#name ⇒ String
Name of the task.
52 53 54 |
# File 'lib/lint_trappings/rake_task.rb', line 52 def name @name end |
#quiet ⇒ true, false
Whether output from application should not be displayed to the standard out stream.
68 69 70 |
# File 'lib/lint_trappings/rake_task.rb', line 68 def quiet @quiet end |