Sha256: e7768b88c70513bd11e977a24c9b05bdfedd4b52c05cfc67fb03ff99694ccf23

Contents?: true

Size: 1.38 KB

Versions: 3

Compression:

Stored size: 1.38 KB

Contents

#!/usr/bin/env ruby
$LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib')))

require 'core'

Signal.trap("INT"){}

ARGV << '-h' if ARGV.empty?
options = {}

OptionParser.new do |opts|
  opts.banner = "Generate starter code for different coding environments.\n\nUsage: #{File.basename($PROGRAM_NAME)} [options] [task] NewProjectName\nRadon version: #{Paint[VERSION, '#2ecc71']}"
  opts.separator Paint["\nGlobal Options: ", '#95a5a6']


  opts.on('--list-env', 'List all supported environments') do
    all = Radon::Environments.getAllNames
    puts "Supported environments are:"
    all.each do |e|
      puts "  #{e}"
    end
  end

  opts.on('-q', '--quiet', 'Run with suppresed console output.') do
    $quiet = true
  end

  opts.on('--verbose', 'Run verbosely') do
    $verbose = true
  end

  opts.on('-v', '--version', 'Show the krypton version and exit') do
    puts "Krypton version: #{Paint[VERSION, '#2ecc71']}"
    exit 0
  end

  opts.on('-h', '--help', 'Show this help message') do
    puts opts
    exit
  end


end.parse!(ARGV)

while (opt = ARGV.shift) do
  Radon::Util.first_run
  if Radon::Environments.getAllNames.include? opt
    Radon::Environments.extract(opt, ARGV[0])
    puts Paint["Done! Your project is set up in #{File.expand_path(ARGV[0])}.", :bold, :bright]
    exit 0
  else
    error "#{opt} is not a supported environment!"
    exit 1
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
radon-0.1.6 bin/radon
radon-0.1.5 bin/radon
radon-0.1.4 bin/radon