bin/methadone in methadone-0.5.1 vs bin/methadone in methadone-1.0.0.rc1
- old
+ new
@@ -6,10 +6,11 @@
require 'methadone/cli'
include FileUtils
include Methadone::Main
include Methadone::CLI
+include Methadone::SH
main do |app_name|
check_and_prepare_basedir!(app_name,options[:force])
using_readme = options[:readme]
@@ -18,11 +19,11 @@
debug "Creating project for gem #{gemname}"
chdir File.dirname(app_name)
- %x[bundle gem #{gemname}]
+ sh! "bundle gem #{gemname}"
chdir gemname
template_dirs_in(:full).each { |dir| mkdir_p dir }
@@ -48,14 +49,15 @@
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, :binding => binding
+ gem_variable = File.open("#{gemname}.gemspec") { |x| x.read }.match(/(\w+)\.executables/)[1]
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')",
+ " #{gem_variable}.add_development_dependency('rdoc')",
+ " #{gem_variable}.add_development_dependency('aruba')",
+ " #{gem_variable}.add_development_dependency('rake','~> 0.9.2')",
+ " #{gem_variable}.add_dependency('methadone')",
], :before => /^end\s*$/
end
options[:readme] = true