Class: Templater::Actions::Chmod

Inherits:
Action
  • Object
show all
Defined in:
lib/bowline/generators.rb

Overview

Touch

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(generator, destination, options = {}) ⇒ Chmod

Returns a new instance of Chmod.



39
40
41
42
43
44
# File 'lib/bowline/generators.rb', line 39

def initialize(generator, destination, options={})
  self.generator   = generator
  self.destination = destination
  self.options     = options
  self.mode        = self.options[:mode] || 0755
end

Instance Attribute Details

#modeObject

Returns the value of attribute mode.



37
38
39
# File 'lib/bowline/generators.rb', line 37

def mode
  @mode
end

Instance Method Details

#exists?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/bowline/generators.rb', line 50

def exists?
  false
end

#identical?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/bowline/generators.rb', line 54

def identical?
  false
end

#invoke!Object



58
59
60
61
62
# File 'lib/bowline/generators.rb', line 58

def invoke!
  callback(:before)
  ::FileUtils.chmod_R(self.mode, destination)
  callback(:after)
end

#renderObject



46
47
48
# File 'lib/bowline/generators.rb', line 46

def render
  ''
end