Class: ThemeJuice::Task

Inherits:
Object
  • Object
show all
Defined in:
lib/theme-juice/task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Task

Returns a new instance of Task.



7
8
9
10
11
12
13
14
15
# File 'lib/theme-juice/task.rb', line 7

def initialize(opts = {})
  @env     = Env
  @io      = IO
  @project = Project
  @config  = Config
  @util    = Util.new
  @opts    = opts.dup
  @tasks   = []
end

Instance Attribute Details

#tasksObject (readonly)

Returns the value of attribute tasks.



5
6
7
# File 'lib/theme-juice/task.rb', line 5

def tasks
  @tasks
end

Instance Method Details

#executeObject



21
22
23
# File 'lib/theme-juice/task.rb', line 21

def execute
  @io.error "Method 'execute' not implemented for #{self.class.name}", NotImplementedError
end

#runner {|@tasks| ... } ⇒ Object

Yields:



17
18
19
# File 'lib/theme-juice/task.rb', line 17

def runner
  yield @tasks
end

#unexecuteObject



25
26
27
# File 'lib/theme-juice/task.rb', line 25

def unexecute
  @io.error "Method 'unexecute' not implemented for #{self.class.name}", NotImplementedError
end