Module: Pieces::Generator
Instance Method Summary collapse
Instance Method Details
#init(config = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/pieces/generator.rb', line 5 def init(config = {}) path = config[:path] || Dir.pwd FileUtils.mkdir_p(path) Dir["#{example_path}/{config,app}"].each do |dir| FileUtils.cp_r(dir, path) end FileUtils.cp("#{example_path}/Gemfile", "#{path}/Gemfile") end |