Sha256: de5e30d9907ce8d07e0087a31440b70587d8969722e8305a50fd2053bce3488a
Contents?: true
Size: 981 Bytes
Versions: 2
Compression:
Stored size: 981 Bytes
Contents
require 'fileutils' module TinyRails module Commands class New < Thor::Group include Thor::Actions include Actions argument :app_path, :required => true # TODO: Move to a base command def self.source_root "#{File.expand_path('../../../../templates', __FILE__)}/" end def self.banner "tiny-rails new #{self.arguments.map(&:usage).join(' ')} [options]" end def self.templates @templates ||= %w( .gitignore Gemfile boot.rb application_controller.rb index.html.erb server config.ru ) end def create_root self.destination_root = File.expand_path(app_path) empty_directory '.' FileUtils.cd destination_root end def scaffold self.class.templates.each do |template| template(template) end chmod 'server', 0755 end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
tiny-rails-0.1.1 | lib/tiny-rails/commands/new.rb |
tiny-rails-0.1.0 | lib/tiny-rails/commands/new.rb |