diff options
Diffstat (limited to 'railties/lib/rails_generator/generators/components/web_service')
5 files changed, 0 insertions, 85 deletions
diff --git a/railties/lib/rails_generator/generators/components/web_service/USAGE b/railties/lib/rails_generator/generators/components/web_service/USAGE deleted file mode 100644 index 1b9192f7b1..0000000000 --- a/railties/lib/rails_generator/generators/components/web_service/USAGE +++ /dev/null @@ -1,24 +0,0 @@ -Description: - Stubs out the controller and API for a new web service using the deprecated - Action Web Service framework. Pass the web service name, either CamelCased - or under_scored, and a list of API methods as arguments. To create a web - service within a module, use a path like 'module_name/web_service_name'. - - This generates a controller in app/controllers, an API definition - in app/apis, and functional tests in test/functional. - -Example: - `./script/generate web_service User add edit list remove` - - creates the User controller, API, and functional test: - Controller: app/controllers/user_controller.rb - API: app/apis/user_api.rb - Test: test/functional/user_api_test.rb - -Modules Example: - `./script/generate web_service 'api/registration' register renew` - - creates the Registration controller, API, and functional test: - Controller: app/controllers/api/registration_controller.rb - API: app/apis/api/registration_api.rb - Test: test/functional/api/registration_api_test.rb diff --git a/railties/lib/rails_generator/generators/components/web_service/templates/api_definition.rb b/railties/lib/rails_generator/generators/components/web_service/templates/api_definition.rb deleted file mode 100644 index 97d0b60869..0000000000 --- a/railties/lib/rails_generator/generators/components/web_service/templates/api_definition.rb +++ /dev/null @@ -1,5 +0,0 @@ -class <%= class_name %>Api < ActionWebService::API::Base -<% for method_name in args -%> - api_method :<%= method_name %> -<% end -%> -end diff --git a/railties/lib/rails_generator/generators/components/web_service/templates/controller.rb b/railties/lib/rails_generator/generators/components/web_service/templates/controller.rb deleted file mode 100644 index 7b0a865709..0000000000 --- a/railties/lib/rails_generator/generators/components/web_service/templates/controller.rb +++ /dev/null @@ -1,8 +0,0 @@ -class <%= class_name %>Controller < ApplicationController - wsdl_service_name '<%= class_name %>' -<% for method_name in args -%> - - def <%= method_name %> - end -<% end -%> -end diff --git a/railties/lib/rails_generator/generators/components/web_service/templates/functional_test.rb b/railties/lib/rails_generator/generators/components/web_service/templates/functional_test.rb deleted file mode 100644 index c4d136f83d..0000000000 --- a/railties/lib/rails_generator/generators/components/web_service/templates/functional_test.rb +++ /dev/null @@ -1,19 +0,0 @@ -require File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../test_helper' -require '<%= file_path %>_controller' - -class <%= class_name %>Controller; def rescue_action(e) raise e end; end - -class <%= class_name %>ControllerApiTest < Test::Unit::TestCase - def setup - @controller = <%= class_name %>Controller.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end -<% for method_name in args -%> - - def test_<%= method_name %> - result = invoke :<%= method_name %> - assert_equal nil, result - end -<% end -%> -end diff --git a/railties/lib/rails_generator/generators/components/web_service/web_service_generator.rb b/railties/lib/rails_generator/generators/components/web_service/web_service_generator.rb deleted file mode 100644 index ee18bf8011..0000000000 --- a/railties/lib/rails_generator/generators/components/web_service/web_service_generator.rb +++ /dev/null @@ -1,29 +0,0 @@ -class WebServiceGenerator < Rails::Generator::NamedBase - def manifest - record do |m| - # Check for class naming collisions. - m.class_collisions class_path, "#{class_name}Api", "#{class_name}Controller", "#{class_name}ApiTest" - - # API and test directories. - m.directory File.join('app/apis', class_path) - m.directory File.join('app/controllers', class_path) - m.directory File.join('test/functional', class_path) - - # API definition, controller, and functional test. - m.template 'api_definition.rb', - File.join('app/apis', - class_path, - "#{file_name}_api.rb") - - m.template 'controller.rb', - File.join('app/controllers', - class_path, - "#{file_name}_controller.rb") - - m.template 'functional_test.rb', - File.join('test/functional', - class_path, - "#{file_name}_api_test.rb") - end - end -end |