Sha256: 377712fe8452efb7f13c00a7ef72a0a28869ed995ee246f850ab14194b4244f2

Contents?: true

Size: 710 Bytes

Versions: 1

Compression:

Stored size: 710 Bytes

Contents

require 'thor'
require 'crosstie'

module Crosstie

  class CLI < Thor

    default_task :help

    desc "new", "create a new rails application"
    def new name
      cmd = "rails new #{name} --template #{template_path}"
      puts cmd
      system cmd
    end

    desc "version", "print the version of current crosstie"
    def version
      puts "crosstie #{Crosstie::VERSION}"
    end
    map %w(-v --version) => :version

    desc "help", "print the help"
    def help
      puts "USAGE:\n\tcrosstie new my_app"
    end
    map %w(-h --help) => :help

    private

    def template_path
      File.join root, "base.rb"
    end

    def root
      File.expand_path File.dirname __FILE__
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
crosstie-0.0.2 lib/crosstie/cli.rb