diff options
author | José Valim <jose.valim@gmail.com> | 2010-03-23 13:40:19 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-03-23 13:40:41 +0100 |
commit | b61f6f59805eec4f5bb873a85910c9fe00e839a9 (patch) | |
tree | 485dc3cee827ab4d79756e90d639ccc4dad464e1 /railties/lib/generators/rails/plugin | |
parent | b144b56d8288246f0de7437d10361a0f1ed2bd83 (diff) | |
download | rails-b61f6f59805eec4f5bb873a85910c9fe00e839a9.tar.gz rails-b61f6f59805eec4f5bb873a85910c9fe00e839a9.tar.bz2 rails-b61f6f59805eec4f5bb873a85910c9fe00e839a9.zip |
Load generators from both lib/rails/generators and lib/generators. Using the former since it's less obstrusive.
Diffstat (limited to 'railties/lib/generators/rails/plugin')
10 files changed, 0 insertions, 111 deletions
diff --git a/railties/lib/generators/rails/plugin/USAGE b/railties/lib/generators/rails/plugin/USAGE deleted file mode 100644 index 00a429c585..0000000000 --- a/railties/lib/generators/rails/plugin/USAGE +++ /dev/null @@ -1,13 +0,0 @@ -Description: - Stubs out a new plugin at vendor/plugins. Pass the plugin name, either - CamelCased or under_scored, as an argument. - -Example: - `rails generate plugin BrowserFilters` - - creates a standard browser_filters plugin: - vendor/plugins/browser_filters/README - vendor/plugins/browser_filters/init.rb - vendor/plugins/browser_filters/install.rb - vendor/plugins/browser_filters/lib/browser_filters.rb - vendor/plugins/browser_filters/test/browser_filters_test.rb diff --git a/railties/lib/generators/rails/plugin/plugin_generator.rb b/railties/lib/generators/rails/plugin/plugin_generator.rb deleted file mode 100644 index 8f01dcd589..0000000000 --- a/railties/lib/generators/rails/plugin/plugin_generator.rb +++ /dev/null @@ -1,47 +0,0 @@ -require 'generators/rails/generator/generator_generator' - -module Rails - module Generators - class PluginGenerator < NamedBase - class_option :tasks, :desc => "When supplied creates tasks base files." - - check_class_collision - - def create_root_files - directory '.', plugin_dir, :recursive => false - end - - def create_lib_files - directory 'lib', plugin_dir('lib'), :recursive => false - end - - def create_tasks_files - return unless options[:tasks] - directory 'lib/tasks', plugin_dir('lib/tasks') - end - - hook_for :generator do |generator| - inside plugin_dir, :verbose => true do - invoke generator, [ name ], :namespace => false - end - end - - hook_for :test_framework do |test_framework| - inside plugin_dir, :verbose => true do - invoke test_framework - end - end - - protected - - def plugin_dir(join=nil) - if join - File.join(plugin_dir, join) - else - "vendor/plugins/#{file_name}" - end - end - - end - end -end diff --git a/railties/lib/generators/rails/plugin/templates/MIT-LICENSE.tt b/railties/lib/generators/rails/plugin/templates/MIT-LICENSE.tt deleted file mode 100644 index 8717df053d..0000000000 --- a/railties/lib/generators/rails/plugin/templates/MIT-LICENSE.tt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) <%= Date.today.year %> [name of plugin creator] - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/railties/lib/generators/rails/plugin/templates/README.tt b/railties/lib/generators/rails/plugin/templates/README.tt deleted file mode 100644 index 702db07cb1..0000000000 --- a/railties/lib/generators/rails/plugin/templates/README.tt +++ /dev/null @@ -1,13 +0,0 @@ -<%= class_name %> -<%= "=" * class_name.size %> - -Introduction goes here. - - -Example -======= - -Example goes here. - - -Copyright (c) <%= Date.today.year %> [name of plugin creator], released under the MIT license diff --git a/railties/lib/generators/rails/plugin/templates/Rakefile.tt b/railties/lib/generators/rails/plugin/templates/Rakefile.tt deleted file mode 100644 index e94c0bfc77..0000000000 --- a/railties/lib/generators/rails/plugin/templates/Rakefile.tt +++ /dev/null @@ -1,10 +0,0 @@ -require 'rake/testtask' - -desc 'Default: run unit tests.' -task :default => :test - -desc 'Test the <%= file_name %> plugin.' -Rake::TestTask.new(:test) do |t| - t.libs << 'test' - t.pattern = 'test/**/*_test.rb' -end diff --git a/railties/lib/generators/rails/plugin/templates/init.rb b/railties/lib/generators/rails/plugin/templates/init.rb deleted file mode 100644 index 3c19a743c9..0000000000 --- a/railties/lib/generators/rails/plugin/templates/init.rb +++ /dev/null @@ -1 +0,0 @@ -# Include hook code here diff --git a/railties/lib/generators/rails/plugin/templates/install.rb b/railties/lib/generators/rails/plugin/templates/install.rb deleted file mode 100644 index f7732d3796..0000000000 --- a/railties/lib/generators/rails/plugin/templates/install.rb +++ /dev/null @@ -1 +0,0 @@ -# Install hook code here diff --git a/railties/lib/generators/rails/plugin/templates/lib/%file_name%.rb.tt b/railties/lib/generators/rails/plugin/templates/lib/%file_name%.rb.tt deleted file mode 100644 index d8d908a959..0000000000 --- a/railties/lib/generators/rails/plugin/templates/lib/%file_name%.rb.tt +++ /dev/null @@ -1 +0,0 @@ -# <%= class_name %> diff --git a/railties/lib/generators/rails/plugin/templates/lib/tasks/%file_name%_tasks.rake.tt b/railties/lib/generators/rails/plugin/templates/lib/tasks/%file_name%_tasks.rake.tt deleted file mode 100644 index 72920a9d3a..0000000000 --- a/railties/lib/generators/rails/plugin/templates/lib/tasks/%file_name%_tasks.rake.tt +++ /dev/null @@ -1,4 +0,0 @@ -# desc "Explaining what the task does" -# task :<%= file_name %> do -# # Task goes here -# end diff --git a/railties/lib/generators/rails/plugin/templates/uninstall.rb b/railties/lib/generators/rails/plugin/templates/uninstall.rb deleted file mode 100644 index 9738333463..0000000000 --- a/railties/lib/generators/rails/plugin/templates/uninstall.rb +++ /dev/null @@ -1 +0,0 @@ -# Uninstall hook code here |