Class: RoCommands::Generators::RailsNewApp

Inherits:
Object
  • Object
show all
Includes:
RailsGenerator
Defined in:
lib/ro_commands/generators/rails_new_app.rb

Class Method Summary collapse

Methods included from RailsGenerator

included

Class Method Details

.create(name) ⇒ Object



8
9
10
11
12
# File 'lib/ro_commands/generators/rails_new_app.rb', line 8

def create(name)
  bashs "rails new #{name} -Bf -d mysql"
  Dir.chdir name
  template("Gemfile", "Gemfile")
end

.template(from, to) ⇒ Object



14
15
16
17
18
19
# File 'lib/ro_commands/generators/rails_new_app.rb', line 14

def template(from, to)
  from_path = File.join(File.expand_path("../rails_templates/", __FILE__), "#{from}.erb")
  ctn = ::RoFile.read(from_path)
  result = ERB.new(ctn).result(binding)
  ::RoFile.write(to, result)
end