Sha256: e795f7bd0a097097157aa72630c132d2ec9295c6fb3edf7bcce994d749e1caa4

Contents?: true

Size: 739 Bytes

Versions: 8

Compression:

Stored size: 739 Bytes

Contents

require File.expand_path(File.join('..', '..', '..', 'lib', 'pah', 'version.rb'), File.dirname(__FILE__))

module Pah
  class Commands
    class App < Base

      def run(argv)
        puts "Creating a new rails app in #{argv[0]}".green
        exec build_rails_command(argv[0])
      end

      private
        def build_rails_command(app_name)
          parts = []
          parts << "rails _#{::Pah::RAILS_VERSION}_ new #{app_name} -T"
          parts << "-q" unless options[:verbose]
          parts << "-m #{template_path}"
          parts.join(" ")
        end

        def template_path
          File.expand_path(File.join('..', '..', '..', 'lib', 'pah', 'rails_template.rb'), File.dirname(__FILE__))
        end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pah-0.0.28 lib/pah/commands/app.rb
pah-0.0.27 lib/pah/commands/app.rb
pah-0.0.26 lib/pah/commands/app.rb
pah-0.0.25 lib/pah/commands/app.rb
pah-0.0.24 lib/pah/commands/app.rb
pah-0.0.23 lib/pah/commands/app.rb
pah-0.0.22 lib/pah/commands/app.rb
pah-0.0.21 lib/pah/commands/app.rb