Sha256: 9ae8545d72469f6decc6f5090ba713e6e5236302aa1b698c4f9937684cf2295b

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

require 'thor'
Dir[File.dirname(__FILE__) + '/application_tasks/*.rb'].each { |file| require file }

module Shortcut
  class Application < Thor
    desc "build", "Build runnable archive"
    def build
      exec('warble && mkdir -p pkg && mv *.jar pkg')
    end

    desc "start", "Build and run application"
    def start
      exec('warble && mkdir -p pkg && mv *.jar pkg && java -jar pkg/*.jar')
    end

    method_option :test, :type => :string, :lazy_default => 'rspec', :aliases => '-t', :desc => "Generate a test directory for your application. Supports: 'rspec' (default), 'minitest'"
    method_option :edit, :type => :string, :aliases => "-e",
                  :lazy_default => [ENV['BUNDLER_EDITOR'], ENV['VISUAL'], ENV['EDITOR']].find{|e| !e.nil? && !e.empty? },
                  :required => false, :banner => "/path/to/your/editor",
                  :desc => "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
    register(Shortcut::ApplicationTasks::New, :new, "new [NAME]", "Creates a skeleton for creating a shortcut app")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shortcut-0.0.2 lib/shortcut/application.rb