Class: ERB::Linter::Task

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/erb/linter/task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) {|_self| ... } ⇒ Task

Returns a new instance of Task.

Yields:

  • (_self)

Yield Parameters:



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/erb/linter/task.rb', line 8

def initialize(*args, &block)
  @name = args.shift || :erb_linter
  @glob = "**/*.erb"
  @root = Dir.pwd
  @tmpdir = Dir.tmpdir

  yield self

  desc 'Check ERB files for HTML correcteness'
  task(name, *args) do |_, task_args|
    run
  end
end

Instance Attribute Details

#globObject

Returns the value of attribute glob.



6
7
8
# File 'lib/erb/linter/task.rb', line 6

def glob
  @glob
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/erb/linter/task.rb', line 6

def name
  @name
end

#rootObject

Returns the value of attribute root.



6
7
8
# File 'lib/erb/linter/task.rb', line 6

def root
  @root
end

#tmpdirObject

Returns the value of attribute tmpdir.



6
7
8
# File 'lib/erb/linter/task.rb', line 6

def tmpdir
  @tmpdir
end