class Rocketwheel::Command::CLI::New

Public Class Methods

source_root() click to toggle source
# File lib/rocketwheel/command/cli/new.rb, line 9
def self.source_root
  File.join(Rocketwheel::Command.templates, 'project')
end

Public Instance Methods

new(name) click to toggle source
# File lib/rocketwheel/command/cli/new.rb, line 16
def new(name)
  dir = version.dup
  until File.exists?(File.join(self.class.source_root, dir)) do
    raise Thor::Error, "No project template for version #{version}" unless dir.gsub! /(.*)\..*/, '\\1'
  end
  directory dir, name
end
version() click to toggle source
# File lib/rocketwheel/command/cli/new.rb, line 25
def version
  options[:version] || Rocketwheel::Command::Player.latest_version
end

Private Instance Methods

directory(source, *args, &block) click to toggle source
# File lib/rocketwheel/command/cli/new.rb, line 62
def directory(source, *args, &block)
  config = args.last.is_a?(Hash) ? args.pop : {}
  destination = args.first || source
  action NoTemplateDirectory.new(self, source, destination || source, config, &block)
end