Sha256: e5f2c3fe7f96d236b4561cfd620b1541cab441310ec01472ba11038336adcc75

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

#!/usr/bin/env ruby

# rubocop:disable Layout/IndentHeredoc
USAGE = <<-END.freeze
calagator: setup Calagator in a new or existing Rails applicaton

Usage:
  calagator new APP_PATH [options]
  calagator install

calagator new: generates a new Rails app and install Calagator into it

  Options:
    --dummy   # Generates an app suitable for use in spec/dummy for Calagator
              # development and testing

    In the case of `calagator new`, all other options will be passed along
    to `rails new`; see `rails new --help` for supported options.

    To generate an app using a specific Rails version, e.g. for 4.2.1:

      calagator _4.2.1_ new my_great_calendar

calagator install: install Calagator into an existing Rails application

    Options:
      none
END
# rubocop:enable Layout/IndentHeredoc

TEMPLATE_PATH = File.expand_path('../rails_template.rb', __dir__)

command = ARGV.shift

case command
when /_\d+\.\d+\.\d+_/, 'new'
  system "rails #{command} #{ARGV.join(' ')} -m #{TEMPLATE_PATH} --skip-bundle"
when 'install'
  system "bundle exec rake rails:template LOCATION=#{TEMPLATE_PATH}"
else
  puts USAGE
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
calagator-1.1.0 bin/calagator