Class: Pipin::Exec
- Inherits:
-
Object
- Object
- Pipin::Exec
- Defined in:
- lib/pipin.rb
Instance Method Summary collapse
- #build ⇒ Object
- #create_from_template ⇒ Object
-
#initialize(*args) ⇒ Exec
constructor
A new instance of Exec.
Constructor Details
#initialize(*args) ⇒ Exec
Returns a new instance of Exec.
16 17 18 |
# File 'lib/pipin.rb', line 16 def initialize(*args) @args = args.empty? ? ARGV : args end |
Instance Method Details
#build ⇒ Object
27 28 29 30 |
# File 'lib/pipin.rb', line 27 def build page_name, *opts = @args Builder.new(config[:dir][:dist]).__send__('render_' + page_name, *opts) end |
#create_from_template ⇒ Object
20 21 22 23 24 25 |
# File 'lib/pipin.rb', line 20 def create_from_template dir = @args.first File.exist?(dir) && raise("File exists - #{dir}") FileUtils.cp_r File.join(rootdir ,'templates'), dir puts Dir.glob(File.join(dir, '**/*')).map {|e| ' create ' + e } end |