app_generators/newgem/newgem_generator.rb in newgem-0.13.0 vs app_generators/newgem/newgem_generator.rb in newgem-0.13.1

- old
+ new

@@ -26,20 +26,19 @@ attr_reader :is_jruby def initialize(runtime_args, runtime_options = {}) super usage if args.empty? - @destination_root = args.shift - @gem_name = File.basename(File.expand_path(@destination_root)) + @destination_root = File.expand_path(args.shift) + @gem_name = File.basename(destination_root) @module_name = gem_name.camelize extract_options end def manifest # Use /usr/bin/env if no special shebang was specified script_options = { :chmod => 0755, :shebang => options[:shebang] == DEFAULT_SHEBANG ? nil : options[:shebang] } - dispatcher_options = { :chmod => 0755, :shebang => options[:shebang] } windows = (RUBY_PLATFORM =~ /dos|win32|cygwin/i) || (RUBY_PLATFORM =~ /(:?mswin|mingw)/) record do |m| # Root directory and all subdirectories. m.directory '' @@ -57,15 +56,16 @@ # Config m.template_copy_each %w( hoe.rb requirements.rb ), "config" # Scripts - %w( generate destroy ).each do |file| - m.template "script/#{file}", "script/#{file}", script_options - m.template "script/win_script.cmd", "script/#{file}.cmd", - :assigns => { :filename => file } if windows - end + # %w( generate destroy ).each do |file| + # m.template "script/#{file}", "script/#{file}", script_options + # m.template "script/win_script.cmd", "script/#{file}.cmd", + # :assigns => { :filename => file } if windows + # end + m.dependency "install_rubigen_scripts", [destination_root, "rubygems", "newgem"], :shebang => options[:shebang] %w(debug).each { |file| m.file "empty.log", "log/#{file}.log", :chmod => 0666 } @@ -92,10 +92,12 @@ for bin_name in bin_names_list m.dependency "executable", [bin_name], :destination => destination_root end m.write_manifest "Manifest.txt" + + m.readme "readme" end end protected def banner @@ -125,10 +127,10 @@ opts.on("-a", "--author=PATH", String, "Your name to be inserted into generated files.", "Default: ~/.rubyforge/user-config.yml[user_name]") { |options[:author]| } opts.on("-r", "--ruby=path", String, "Path to the Ruby binary of your choice (otherwise scripts use env, dispatchers current path).", - "Default: #{DEFAULT_SHEBANG}") { |v| options[:shebang] = v } + "Default: #{DEFAULT_SHEBANG}") { |options[:shebang]| } opts.on("-T", "--test-with=TEST_FRAMEWORK", String, "Select your preferred testing framework.", "Options: test::unit (default), rspec.") { |options[:test_framework]| } opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.") opts.on("-V", "--set-version=YOUR_VERSION", String,