Class: Crosstie::CLI
- Inherits:
-
Thor
- Object
- Thor
- Crosstie::CLI
- Defined in:
- lib/crosstie/cli.rb
Instance Method Summary collapse
Instance Method Details
#config ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/crosstie/cli.rb', line 22 def config puts 'writing config.yml' File.write 'config.yml', "options:\n local: \#{!!options[:local]}\nresources:\n article:\n- title:string\n- content:text\n comment:\n- article:references\n- content:text\n EOF\nend\n" |
#new(name) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/crosstie/cli.rb', line 10 def new name if File.exist? 'config.yml' FileUtils.mkdir_p '/tmp/crosstie' FileUtils.cp 'config.yml', '/tmp/crosstie/config.yml' end cmd = "rails new #{name} --template #{template_path} --skip-spring --skip-test-unit --skip-bundle" puts cmd system cmd end |
#version ⇒ Object
38 39 40 |
# File 'lib/crosstie/cli.rb', line 38 def version puts "crosstie #{Crosstie::VERSION}" end |