app_generators/newgem/newgem_generator.rb in newgem-0.13.2 vs app_generators/newgem/newgem_generator.rb in newgem-0.13.3
- old
+ new
@@ -8,22 +8,22 @@
:bin_name => nil,
:email => nil,
:author => nil,
:import_path => nil,
:jruby => nil,
- :test_framework => 'test::unit',
- :version => '0.0.1',
- :website => false
+ :disable_website => nil,
+ :test_framework => 'test::unit',
+ :version => '0.0.1'
attr_reader :gem_name, :module_name
attr_reader :version, :version_str, :author, :email
# extensions/option
attr_reader :test_framework
attr_reader :bin_names_list
- attr_reader :website
+ attr_reader :disable_website
attr_reader :manifest
attr_reader :is_jruby
def initialize(runtime_args, runtime_options = {})
super
@@ -34,12 +34,12 @@
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] }
- windows = (RUBY_PLATFORM =~ /dos|win32|cygwin/i) || (RUBY_PLATFORM =~ /(:?mswin|mingw)/)
+ script_options = { :chmod => 0755, :shebang => options[:shebang] == DEFAULT_SHEBANG ? nil : options[:shebang] }
+ windows = (RUBY_PLATFORM =~ /dos|win32|cygwin/i) || (RUBY_PLATFORM =~ /(:?mswin|mingw)/)
record do |m|
# Root directory and all subdirectories.
m.directory ''
BASEDIRS.each { |path| m.directory path }
@@ -73,11 +73,11 @@
m.dependency "install_rspec", [gem_name], :destination => destination_root
end
# Website
m.dependency "install_website", [gem_name],
- :author => author, :email => email, :destination => destination_root if website
+ :author => author, :email => email, :destination => destination_root unless disable_website
# JRuby
m.dependency "install_jruby", [gem_name], :destination => destination_root if is_jruby
# Executables
@@ -97,11 +97,11 @@
def banner
<<-EOS
Take any library or Rails plugin or command line application,
gemify it, and easily share it with the Ruby world.
-Usage: #{File.basename $0} /path/to/your/app [options]"
+Usage: #{File.basename $0} /path/to/your/app [options]
EOS
end
def add_options!(opts)
opts.separator ''
@@ -129,12 +129,12 @@
"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,
"Version of the gem you are creating.",
"Default: 0.0.1") { |options[:version]| }
- opts.on("-w", "--website",
- "Includes a website for your RubyGem.") { |options[:website]| }
+ opts.on("-W", "--website-disable",
+ "Disables the generation of the website for your RubyGem.") { |options[:disable_website]| }
end
def extract_options
@version = options[:version].to_s.split(/\./)
@version_str = @version.join('.')
@@ -145,13 +145,14 @@
rubyforge_config = Newgem::Rubyforge.new
@author ||= rubyforge_config.full_name
@email ||= rubyforge_config.email
end
@bin_names_list = (options[:bin_name] || "").split(',')
- @website = options[:website]
+ @disable_website = options[:disable_website]
@test_framework = options[:test_framework] || "test::unit"
@is_jruby = options[:jruby]
+ p options
end
# Installation skeleton. Intermediate directories are automatically
# created so don't sweat their absence here.
BASEDIRS = %w(