Sha256: a4103352e1adb95f19ab02506d868e251fa4789179b97c742a53d42c0a014a91

Contents?: true

Size: 714 Bytes

Versions: 1

Compression:

Stored size: 714 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, "template.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.1 lib/crosstie/cli.rb