Class: DataMapper::Visualizer::Rake::Task

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/dm-visualizer/rake/task.rb

Direct Known Subclasses

GraphVizTask

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) {|task| ... } ⇒ Task

Creates a new task.

Parameters:

  • options (Hash) (defaults to: {})

    Options for the DataMapper Visualizer.

Yields:

  • (task)

    The given block will be passed the newly created task.

Yield Parameters:

  • task (Task)

    The new Task.



23
24
25
26
27
28
29
30
# File 'lib/dm-visualizer/rake/task.rb', line 23

def initialize(options={})
  @options = {:bundle => File.file?('Gemfile')}
  @options.merge!(options)

  yield self if block_given?

  define()
end

Instance Attribute Details

#optionsObject (readonly)

Options for the DataMapper Visualizer.



9
10
11
# File 'lib/dm-visualizer/rake/task.rb', line 9

def options
  @options
end

Instance Method Details

#define(&block) ⇒ Object

Defines a task within the dm:doc namespace.



35
36
37
38
39
40
41
# File 'lib/dm-visualizer/rake/task.rb', line 35

def define(&block)
  namespace :dm do
    namespace(:doc,&block)
  end

  task 'db:doc' => 'dm:doc'
end