Class: SCSSLint::RakeTask

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/scss_lint/rake_task.rb

Overview

Rake task for scss-lint CLI.

You can also specify the list of files as explicit task arguments:

Examples:

# Add the following to your Rakefile...
require 'scss_lint/rake_task'
SCSSLint::RakeTask.new

# ...and then execute from the command line:
rake scss_lint
# Add the following to your Rakefile...
require 'scss_lint/rake_task'
SCSSLint::RakeTask.new

# ...and then execute from the command line (single quotes prevent shell
# glob expansion and allow us to have a space after commas):
rake 'scss_lint[app/assets/**/*.scss, other_files/**/*.scss]'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = :scss_lint) {|_self| ... } ⇒ RakeTask

Create the task so it is accessible via Rake::Task.

Yields:

  • (_self)

Yield Parameters:



51
52
53
54
55
56
57
58
59
# File 'lib/scss_lint/rake_task.rb', line 51

def initialize(name = :scss_lint)
  @name = name
  @files = []
  @quiet = false

  yield self if block_given?

  define
end

Instance Attribute Details

#argsArray<String>

Command-line args to use.

Returns:

  • (Array<String>)


36
37
38
# File 'lib/scss_lint/rake_task.rb', line 36

def args
  @args
end

#configString

Configuration file to use.

Returns:

  • (String)


32
33
34
# File 'lib/scss_lint/rake_task.rb', line 32

def config
  @config
end

#filesArray<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 in the task definition.

Returns:

  • (Array<String>)


43
44
45
# File 'lib/scss_lint/rake_task.rb', line 43

def files
  @files
end

#nameString

Name of the task.

Returns:

  • (String)


28
29
30
# File 'lib/scss_lint/rake_task.rb', line 28

def name
  @name
end

#quiettrue, false

Whether output from SCSS-lint should not be displayed to the standard out stream.

Returns:

  • (true, false)


48
49
50
# File 'lib/scss_lint/rake_task.rb', line 48

def quiet
  @quiet
end