Class: HamlLint::RakeTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- HamlLint::RakeTask
- Defined in:
- lib/haml_lint/rake_task.rb
Overview
Rake task interface for haml-lint command line interface.
You can also specify the list of files as explicit task arguments:
Instance Attribute Summary collapse
-
#fail_level ⇒ String
The severity level above which we should fail the Rake task.
-
#files ⇒ Array<String>
List of files to lint (can contain shell globs).
-
#name ⇒ String
Name of the task.
-
#quiet ⇒ true, false
Whether output from haml-lint should not be displayed to the standard out stream.
Instance Method Summary collapse
-
#config ⇒ String
Return the configuration file path.
-
#config=(config) ⇒ Object
Set the configuration file or path.
-
#initialize(name = :haml_lint) {|_self| ... } ⇒ RakeTask
constructor
Create the task so it exists in the current namespace.
Constructor Details
#initialize(name = :haml_lint) {|_self| ... } ⇒ RakeTask
Create the task so it exists in the current namespace.
78 79 80 81 82 83 84 85 86 |
# File 'lib/haml_lint/rake_task.rb', line 78 def initialize(name = :haml_lint) @name = name @files = ['.'] # Search for everything under current directory by default @quiet = false yield self if block_given? define end |
Instance Attribute Details
#fail_level ⇒ String
The severity level above which we should fail the Rake task.
73 74 75 |
# File 'lib/haml_lint/rake_task.rb', line 73 def fail_level @fail_level end |
#files ⇒ Array<String>
List of files to lint (can contain shell globs).
Note that this will be ignored if you explicitly pass a list of files as task arguments via the command line or a task definition.
58 59 60 |
# File 'lib/haml_lint/rake_task.rb', line 58 def files @files end |
#name ⇒ String
Name of the task.
38 39 40 |
# File 'lib/haml_lint/rake_task.rb', line 38 def name @name end |
#quiet ⇒ true, false
Whether output from haml-lint should not be displayed to the standard out stream.
63 64 65 |
# File 'lib/haml_lint/rake_task.rb', line 63 def quiet @quiet end |
Instance Method Details
#config ⇒ String
Return the configuration file path.
49 50 51 |
# File 'lib/haml_lint/rake_task.rb', line 49 def config @config&.path end |
#config=(config) ⇒ Object
Set the configuration file or path.
43 44 45 |
# File 'lib/haml_lint/rake_task.rb', line 43 def config=(config) @config = config.is_a?(String) ? File.open(config, 'r') : config end |