Class: Knife::Helper::Template

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/knife/helper/template.rb

Instance Method Summary collapse

Constructor Details

#initialize(source, target, params = {}) ⇒ Template

Returns a new instance of Template.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/knife/helper/template.rb', line 10

def initialize(source, target, params={})
  super()
  self.class.source_root(
    Pathname.new(
      File.expand_path("../../../../", __FILE__)
    ).join("templates")
  )
  @source = source
  @target = target
  @params = params
end

Instance Method Details

#flushObject



22
23
24
25
26
# File 'lib/knife/helper/template.rb', line 22

def flush()
  template(@source, @target,
    @params
  )
end