Sha256: b1b02ecb95c2c8bf2fdd1bd3f74e5d4ab1c6fd91b7f15a75733eb65062fd3b0c

Contents?: true

Size: 1.26 KB

Versions: 1

Compression:

Stored size: 1.26 KB

Contents

#!/usr/bin/env ruby -w

$: << File.join(File.dirname(__FILE__),'..','lib')

require 'fileutils'
require 'optparse'
require 'methadone'
require 'methadone/cli'

include FileUtils
include Methadone::Main
include Methadone::CLI

main do |app_name|
  check_and_prepare_basedir!(app_name,options[:force])

  gemname = File.basename(app_name)
  debug "Creating project for gem #{gemname}"

  chdir File.dirname(app_name)

  %x[bundle gem #{gemname}]

  chdir gemname

  template_dirs_in(:full).each  { |dir| mkdir_p dir }

  ["Rakefile", "test/tc_something.rb", "features/support/env.rb"].each do |file|
    copy_file file
  end

  copy_file "features/executable.feature", :as => "#{gemname}.feature", :binding => binding
  copy_file "features/step_definitions/executable_steps.rb", :as => "#{gemname}_steps.rb"
  copy_file "bin/executable", :as => gemname, :executable => true

  add_to_file "#{gemname}.gemspec", [
    "  s.add_development_dependency('rdoc')",
    "  s.add_development_dependency('aruba')",
    "  s.add_development_dependency('rake','~> 0.9.2')",
    "  s.add_dependency('methadone')",
  ], :before => /^end\s*$/
end

description "Kick the bash habit by bootstrapping your Ruby command-line apps"

on("--force","Overwrite files if they exist")

arg :app_name, :required

go!

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
methadone-0.3.0 bin/methadone