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:



42
43
44
45
46
47
48
49
50
# File 'lib/scss_lint/rake_task.rb', line 42

def initialize(name = :scss_lint)
  @name = name
  @files = ['.'] # Search for everything under current directory by default
  @quiet = false

  yield self if block_given?

  define
end

Instance Attribute Details

#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>)


39
40
41
# File 'lib/scss_lint/rake_task.rb', line 39

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