diff options
author | kennyj <kennyj@gmail.com> | 2012-01-30 22:47:05 +0900 |
---|---|---|
committer | kennyj <kennyj@gmail.com> | 2012-02-02 02:34:47 +0900 |
commit | 8afa8b0c218fe9c197140ebeeedd758fdf77c0e1 (patch) | |
tree | f167a31929b8c849077617c9b801c1b85dd405e1 /railties/lib/rails/generators | |
parent | d2c64009482d38d4894dd09d2d1e2fb4a165ecac (diff) | |
download | rails-8afa8b0c218fe9c197140ebeeedd758fdf77c0e1.tar.gz rails-8afa8b0c218fe9c197140ebeeedd758fdf77c0e1.tar.bz2 rails-8afa8b0c218fe9c197140ebeeedd758fdf77c0e1.zip |
Fix GH #4737. Missing helper file (LoadError) in mountable plugin.
Diffstat (limited to 'railties/lib/rails/generators')
-rw-r--r-- | railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb b/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb index 0e900a34bb..f4263d1b98 100644 --- a/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb +++ b/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb @@ -285,7 +285,9 @@ task :default => :test end def valid_const? - if camelized =~ /^\d/ + if original_name =~ /[^0-9a-zA-Z_]+/ + raise Error, "Invalid plugin name #{original_name}. Please give a name which use only alphabetic or numeric or \"_\" characters." + elsif camelized =~ /^\d/ raise Error, "Invalid plugin name #{original_name}. Please give a name which does not start with numbers." elsif RESERVED_NAMES.include?(name) raise Error, "Invalid plugin name #{original_name}. Please give a name which does not match one of the reserved rails words." |