Class: ClusterBomb::Bomb::Task

Inherits:
Object
  • Object
show all
Defined in:
lib/cluster_bomb/bomb.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, group, filename = nil, filetime = nil, opts = {}) ⇒ Task

Returns a new instance of Task.



19
20
21
22
23
24
25
26
27
# File 'lib/cluster_bomb/bomb.rb', line 19

def initialize(name, group, filename=nil, filetime=nil, opts={})
  @name=name
  self.roles=[]
  @filename=filename
  @group = group
  @filetime=filetime  
  @options=opts      
  @sudo = opts[:sudo]
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



16
17
18
# File 'lib/cluster_bomb/bomb.rb', line 16

def description
  @description
end

#filenameObject (readonly)

Returns the value of attribute filename.



17
18
19
# File 'lib/cluster_bomb/bomb.rb', line 17

def filename
  @filename
end

#groupObject (readonly)

Returns the value of attribute group.



17
18
19
# File 'lib/cluster_bomb/bomb.rb', line 17

def group
  @group
end

#nameObject (readonly)

Returns the value of attribute name.



17
18
19
# File 'lib/cluster_bomb/bomb.rb', line 17

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



18
19
20
# File 'lib/cluster_bomb/bomb.rb', line 18

def options
  @options
end

#procObject

Returns the value of attribute proc.



16
17
18
# File 'lib/cluster_bomb/bomb.rb', line 16

def proc
  @proc
end

#rolesObject

Returns the value of attribute roles.



16
17
18
# File 'lib/cluster_bomb/bomb.rb', line 16

def roles
  @roles
end

#sudoObject

Returns the value of attribute sudo.



16
17
18
# File 'lib/cluster_bomb/bomb.rb', line 16

def sudo
  @sudo
end

Instance Method Details

#updated?Boolean

Returns:

  • (Boolean)


28
29
30
31
# File 'lib/cluster_bomb/bomb.rb', line 28

def updated?
  return false if !self.filename
  File.stat(self.filename).mtime  != @filetime
end