class RailsBaseline::Command
Public Instance Methods
bold()
click to toggle source
# File lib/rails_baseline/command.rb, line 15 def bold; "\033[1m" end
clear()
click to toggle source
# File lib/rails_baseline/command.rb, line 14 def clear; "\033[0m" end
cyan()
click to toggle source
# File lib/rails_baseline/command.rb, line 13 def cyan; "\033[36m" end
green()
click to toggle source
# File lib/rails_baseline/command.rb, line 17 def green; "\033[32m" end
new(name)
click to toggle source
# File lib/rails_baseline/command.rb, line 8 def new(name) run_template(name, options) end
red()
click to toggle source
# File lib/rails_baseline/command.rb, line 16 def red; "\033[31m" end
run_template(name, options = {})
click to toggle source
# File lib/rails_baseline/command.rb, line 20 def run_template(name, options = {}) puts "#{bold}Generating and Running Template..." template_path = File.join( File.dirname(__FILE__), 'template.rb' ) file = File.open( template_path ) if options[:version] system "rails _#{options[:version]}_ new #{name} -m #{file.path} --skip-bundle" else system "rails new #{name} -m #{file.path} --skip-bundle" end end
yellow()
click to toggle source
# File lib/rails_baseline/command.rb, line 18 def yellow; "\033[33m" end