Class: Ruumba::RakeTask

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

Overview

Provides a custom Rake task.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) { ... } ⇒ RakeTask

Sets up the custom Rake task. additional options are included (e.g. dir).

Parameters:

  • args (Array<String>)

    Arguments to the Rake task.

Yields:

  • If called with a block, we’ll call it to ensure



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/ruumba/rake_task.rb', line 15

def initialize(*args, &block)
  @name = args.shift || :ruumba
  @dir  = []
  @options = nil

  desc 'Run RuboCop on ERB files'
  task(name, *args) do |_, task_args|
    yield(*[self, task_args].slice(0, block.arity)) if block
    run
  end
end

Instance Attribute Details

#dirObject

Returns the value of attribute dir.



9
10
11
# File 'lib/ruumba/rake_task.rb', line 9

def dir
  @dir
end

#nameObject

Returns the value of attribute name.



9
10
11
# File 'lib/ruumba/rake_task.rb', line 9

def name
  @name
end

#optionsObject

Returns the value of attribute options.



9
10
11
# File 'lib/ruumba/rake_task.rb', line 9

def options
  @options
end