Sha256: 6271903d9c83144da26389c7f1ad48b2d42280fd2eaa383d5ad5821813e64335
Contents?: true
Size: 999 Bytes
Versions: 1
Compression:
Stored size: 999 Bytes
Contents
require 'rake' require 'rake/tasklib' module SCSSLint # Provide task for invoking scss-lint via Rake. # # @example # require 'scss_lint/rake_task' # SCSSLint::RakeTask.new class RakeTask < Rake::TaskLib # The name of the task (default 'scss-lint') attr_accessor :name def initialize(*args, &task_block) @name = args.shift || :scss_lint desc 'Run scss-lint' unless ::Rake.application.last_comment task(name, *args) do |_, task_args| if task_block task_block.call(*[self, task_args].slice(0, task_block.arity)) end run_task end end def run_task # Lazy load so task doesn't impact load time of Rakefile require 'scss_lint' require 'scss_lint/cli' CLI.new.run([]) rescue SystemExit => ex if ex.status == CLI::EXIT_CODES[:data] abort('scss-lint found lints') elsif ex.status != 0 abort('scss-lint failed with an error') end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
scss-lint-0.32.0 | lib/scss_lint/rake_task.rb |