Class: CoffeeBean::Generator

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/coffee_bean/generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



16
17
18
# File 'lib/coffee_bean/generator.rb', line 16

def self.source_root
  File.dirname(__FILE__)
end

Instance Method Details

#newObject



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/coffee_bean/generator.rb', line 21

def new
  template('templates/.gitignore', "#{project_name}/.gitignore")
  template('templates/.npmignore', "#{project_name}/.npmignore")
  template('templates/LICENSE.txt', "#{project_name}/LICENSE.txt")
  template('templates/CHANGELOG.md', "#{project_name}/CHANGELOG.md")
  template('templates/README.md', "#{project_name}/README.md")
  template('templates/Makefile', "#{project_name}/Makefile")
  template('templates/package.json', "#{project_name}/package.json")

  create_file("#{project_name}/#{options[:test_framework]}/#{options[:test_framework]}_helper.js")
  create_file("#{project_name}/#{options[:test_framework]}/#{project_name}_#{options[:test_framework]}.coffee")
  create_file("#{project_name}/src/#{options[:initial_file]}.coffee")
end