1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #11203 from schneems/schneems/plugin_new-plugin

s/plugin_new/plugin
This commit is contained in:
Rafael Mendonça França 2013-07-01 11:36:47 -07:00
commit ab6601ccdf
35 changed files with 20 additions and 16 deletions

View file

@ -1,3 +1,7 @@
* Rename `commands/plugin_new.rb` to `commands/plugin.rb` and fix references
*Richard Schneeman*
* Fix `rails plugin --help` command.
*Richard Schneeman*

View file

@ -10,7 +10,7 @@ Signal.trap("INT") { puts; exit(1) }
if ARGV.first == 'plugin'
ARGV.shift
require 'rails/commands/plugin_new'
require 'rails/commands/plugin'
else
require 'rails/commands/application'
end

View file

@ -36,7 +36,7 @@ command = aliases[command] || command
case command
when 'plugin'
require "rails/commands/plugin_new"
require "rails/commands/plugin"
when 'generate', 'destroy'
require 'rails/generators'

View file

@ -0,0 +1,9 @@
if ARGV.first != "new"
ARGV[0] = "--help"
else
ARGV.shift
end
require 'rails/generators'
require 'rails/generators/rails/plugin/plugin_generator'
Rails::Generators::PluginGenerator.start

View file

@ -1,9 +0,0 @@
if ARGV.first != "new"
ARGV[0] = "--help"
else
ARGV.shift
end
require 'rails/generators'
require 'rails/generators/rails/plugin_new/plugin_new_generator'
Rails::Generators::PluginNewGenerator.start

View file

@ -225,7 +225,7 @@ module Rails
rails = groups.delete("rails")
rails.map! { |n| n.sub(/^rails:/, '') }
rails.delete("app")
rails.delete("plugin_new")
rails.delete("plugin")
print_list("rails", rails)
hidden_namespaces.each { |n| groups.delete(n.to_s) }

View file

@ -154,7 +154,7 @@ task default: :test
end
module Generators
class PluginNewGenerator < AppBase # :nodoc:
class PluginGenerator < AppBase # :nodoc:
add_shared_options_for "plugin"
alias_method :plugin_path, :app_path

View file

@ -1,5 +1,5 @@
require 'generators/generators_test_helper'
require 'rails/generators/rails/plugin_new/plugin_new_generator'
require 'rails/generators/rails/plugin/plugin_generator'
require 'generators/shared_generator_tests'
DEFAULT_PLUGIN_FILES = %w(
@ -18,7 +18,7 @@ DEFAULT_PLUGIN_FILES = %w(
test/dummy
)
class PluginNewGeneratorTest < Rails::Generators::TestCase
class PluginGeneratorTest < Rails::Generators::TestCase
include GeneratorsTestHelper
destination File.join(Rails.root, "tmp/bukkits")
arguments [destination_root]

View file

@ -106,7 +106,7 @@ class GeneratorsTest < Rails::Generators::TestCase
def test_rails_generators_help_does_not_include_app_nor_plugin_new
output = capture(:stdout){ Rails::Generators.help }
assert_no_match(/app/, output)
assert_no_match(/plugin_new/, output)
assert_no_match(/[^:]plugin/, output)
end
def test_rails_generators_with_others_information