wash_out 0.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/.gitignore +9 -0
  2. data/Appraisals +7 -0
  3. data/Gemfile +3 -0
  4. data/Gemfile.lock +102 -0
  5. data/README.md +85 -0
  6. data/Rakefile +14 -0
  7. data/app/helpers/wash_out_helper.rb +14 -14
  8. data/app/views/wash_with_soap/error.builder +2 -2
  9. data/app/views/wash_with_soap/response.builder +2 -2
  10. data/app/views/wash_with_soap/wsdl.builder +19 -29
  11. data/gemfiles/rails-3.0.10.gemfile +7 -0
  12. data/gemfiles/rails-3.0.10.gemfile.lock +121 -0
  13. data/gemfiles/rails-3.1.0.gemfile +7 -0
  14. data/gemfiles/rails-3.1.0.gemfile.lock +134 -0
  15. data/init.rb +1 -19
  16. data/lib/wash_out/dispatcher.rb +55 -24
  17. data/lib/wash_out/engine.rb +4 -0
  18. data/lib/wash_out/param.rb +74 -42
  19. data/lib/wash_out/soap.rb +30 -0
  20. data/lib/wash_out/version.rb +3 -0
  21. data/lib/wash_out.rb +19 -0
  22. data/spec/dummy/Rakefile +7 -0
  23. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  24. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  25. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  26. data/spec/dummy/config/application.rb +42 -0
  27. data/spec/dummy/config/boot.rb +10 -0
  28. data/spec/dummy/config/environment.rb +5 -0
  29. data/spec/dummy/config/environments/development.rb +23 -0
  30. data/spec/dummy/config/environments/test.rb +30 -0
  31. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  32. data/spec/dummy/config/initializers/inflections.rb +10 -0
  33. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  34. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  35. data/spec/dummy/config/initializers/session_store.rb +8 -0
  36. data/spec/dummy/config/locales/en.yml +5 -0
  37. data/spec/dummy/config/routes.rb +58 -0
  38. data/spec/dummy/config.ru +4 -0
  39. data/spec/dummy/public/404.html +26 -0
  40. data/spec/dummy/public/422.html +26 -0
  41. data/spec/dummy/public/500.html +26 -0
  42. data/spec/dummy/public/favicon.ico +0 -0
  43. data/spec/dummy/public/stylesheets/.gitkeep +0 -0
  44. data/spec/dummy/script/rails +6 -0
  45. data/spec/spec_helper.rb +38 -0
  46. data/spec/support/httpi-rack.rb +34 -0
  47. data/spec/support/mock_controller.rb +34 -0
  48. data/spec/wash_out_spec.rb +98 -0
  49. data/wash_out.gemspec +12 -8
  50. metadata +82 -9
  51. data/README.rdoc +0 -55
  52. data/lib/wash_out/wash_with_soap.rb +0 -24
@@ -1,32 +1,63 @@
1
1
  module WashOut
2
+ # The WashOut::Dispatcher module should be included in a controller acting
3
+ # as a SOAP endpoint. It includes actions for generating WSDL and handling
4
+ # SOAP requests.
2
5
  module Dispatcher
3
- def wsdl
4
- @map = self.class.wash_with_soap_map
5
- @name = controller_path.gsub('/', '_')
6
+ # A SOAPError exception can be raised to return a correct SOAP error
7
+ # response.
8
+ class SOAPError < Exception; end
9
+
10
+ # This action generates the WSDL for defined SOAP methods.
11
+ def _wsdl
12
+ @map = self.class.soap_actions
6
13
  @namespace = 'urn:WashOut'
7
-
14
+ @name = controller_path.gsub('/', '_')
15
+
8
16
  render :template => 'wash_with_soap/wsdl'
9
17
  end
10
-
11
- def soap
12
- @map = self.class.wash_with_soap_map
13
- @method = request.env['HTTP_SOAPACTION'].gsub(/^\"(.*)\"$/, '\1')
14
- @current = @map[@method] || @map[@method.to_sym]
15
-
16
- wash_out_error("Method does not exist") and return if @current.blank?
17
-
18
- data = Crack::XML.parse(request.raw_post).values.first.select{|k,v| k[-4,4] == "Body"}.values.first[@method]
19
-
20
- @soap = @current[:in].load(data)
21
- @result = @current[:out].load(send @method.to_sym)
22
-
23
- render :template => 'wash_with_soap/response'
18
+
19
+ # This action maps the SOAP action to a controller method defined with
20
+ # +soap_action+.
21
+ def _action
22
+ map = self.class.soap_actions
23
+ method = request.env['HTTP_SOAPACTION'].gsub(/^\"(.*)\"$/, '\1')
24
+ @_current = map[method]
25
+
26
+ raise SoapError, "Method #{method} does not exists" unless @_current
27
+
28
+ xml_data = params['Envelope']['Body'][method]
29
+
30
+ params = (xml_data || {}).map do |opt, value|
31
+ opt = opt.underscore
32
+ param = @_current[:in].find { |param| param.name == opt }
33
+ raise SOAPError, "unknown parameter #{opt}" unless param
34
+ [ opt, param.load(value) ]
35
+ end
36
+ @_params.merge!(Hash[*params.flatten])
37
+
38
+ send(@_current[:to])
39
+ end
40
+
41
+ def _render_soap(result, options)
42
+ result = { 'value' => result } unless result.is_a? Hash
43
+ result = HashWithIndifferentAccess.new(result)
44
+ result = Hash[*@_current[:out].map do |param|
45
+ [param, param.store(result[param.name])]
46
+ end.flatten]
47
+
48
+ render :template => 'wash_with_soap/response',
49
+ :locals => { :result => result }
50
+ end
51
+
52
+ private
53
+
54
+ def self.included(controller)
55
+ controller.send :rescue_from, SOAPError, :with => :_render_soap_error
24
56
  end
25
-
26
- private
27
-
28
- def wash_out_error(description)
29
- @error = description and render :template => 'wash_with_soap/error'
57
+
58
+ def _render_soap_error(error)
59
+ render :template => 'wash_with_soap/error', :status => 500,
60
+ :locals => { :error_message => error.message }
30
61
  end
31
62
  end
32
- end
63
+ end
@@ -0,0 +1,4 @@
1
+ module WashOut
2
+ class Engine < ::Rails::Engine
3
+ end
4
+ end
@@ -4,63 +4,95 @@ module WashOut
4
4
  attr_accessor :map
5
5
  attr_accessor :type
6
6
  attr_accessor :multiplied
7
-
8
- attr_accessor :value
9
- def value
10
- struct? ? map : @value
11
- end
12
-
13
- def [](key)
14
- map[key]
15
- end
16
-
17
- def struct?
18
- type == 'struct'
19
- end
20
-
21
- def namespaced_type
22
- struct? ? "typens:#{name}" : "xsd:#{type}"
23
- end
24
-
7
+
8
+ # Defines a WSDL parameter with name +name+ and type specifier +type+.
9
+ # The type specifier format is described in #parse_def.
25
10
  def initialize(name, type, multiplied = false)
26
11
  type ||= {}
27
-
12
+
28
13
  @name = name.to_s
29
14
  @map = {}
30
15
  @multiplied = multiplied
31
16
 
32
- if type.is_a?(Hash)
17
+ if type.is_a?(Symbol)
18
+ @type = type.to_s
19
+ else
33
20
  @type = 'struct'
34
-
35
- type.each do |name, type|
36
- if type.is_a?(Array)
37
- @map[name.to_s] = Param.new(name, type[0], true)
38
- else
39
- @map[name.to_s] = Param.new(name, type)
40
- end
21
+ @map = self.class.parse_def(type)
22
+ end
23
+ end
24
+
25
+ # Converts a generic externally derived Ruby value, such as String or
26
+ # Hash, to a native Ruby object according to the definition of this type.
27
+ def load(data)
28
+ if struct?
29
+ data = ActiveSupport::HashWithIndifferentAccess.new(data)
30
+ @map.map do |param|
31
+ param.load(data[param.name])
41
32
  end
42
33
  else
43
- @type = type.to_s
34
+ case type
35
+ when 'string'; data.to_s
36
+ when 'integer'; data.to_i
37
+ when 'double'; data.to_f
38
+ when 'boolean'; data == 'true' # Is this bad?
39
+ else raise RuntimeError, "Invalid WashOut simple type: #{type}"
40
+ end
44
41
  end
45
42
  end
46
-
47
- def load(data)
43
+
44
+ # The opposite of #load.
45
+ def store(data)
48
46
  if struct?
49
- map.each do |name, param|
50
- param.load(data[name] || data[name.to_sym])
47
+ data = ActiveSupport::HashWithIndifferentAccess.new(data)
48
+ @map.map do |param|
49
+ param.store(data[param.name])
51
50
  end
52
51
  else
53
- @value = Param.convert_scalar(data, type)
52
+ data.to_s
54
53
  end
55
-
56
- self
57
54
  end
58
-
59
- def self.convert_scalar(data, type)
60
- return data.to_s if type == 'string'
61
- return data.to_i if type == 'integer'
62
- return data.to_f if type == 'double'
63
- return data.to_bool if type == 'boolean'
55
+
56
+ # Checks if this Param defines a complex type.
57
+ def struct?
58
+ type == 'struct'
59
+ end
60
+
61
+ # Returns a WSDL namespaced identifier for this type.
62
+ def namespaced_type
63
+ struct? ? "typens:#{name}" : "xsd:#{type}"
64
+ end
65
+
66
+ # Parses a +definition+. The format of the definition is best described
67
+ # by the following BNF-like grammar.
68
+ #
69
+ # simple_type := :string | :integer | :double | :boolean
70
+ # nested_type := type_hash | simple_type | WashOut::Param instance
71
+ # type_hash := { :parameter_name => nested_type, ... }
72
+ # definition := [ WashOut::Param, ... ] |
73
+ # type_hash |
74
+ # simple_type
75
+ #
76
+ # If a simple type is passed as the +definition+, a single Param is returned
77
+ # with the +name+ set to "value".
78
+ # If a WashOut::Param instance is passed as a +nested_type+, the corresponding
79
+ # +:parameter_name+ is ignored.
80
+ #
81
+ # This function returns an array of WashOut::Param objects.
82
+ def self.parse_def(definition)
83
+ definition = { :value => definition } if definition.is_a? Symbol
84
+
85
+ if definition.is_a? Hash
86
+ definition.map do |name, opt|
87
+ if opt.is_a? WashOut::Param
88
+ opt
89
+ else
90
+ WashOut::Param.new(name, opt)
91
+ end
92
+ end
93
+ else
94
+ definition.to_a
95
+ end
64
96
  end
65
97
  end
66
- end
98
+ end
@@ -0,0 +1,30 @@
1
+ require 'active_support/concern'
2
+
3
+ module WashOut
4
+ module SOAP
5
+ extend ActiveSupport::Concern
6
+
7
+ module ClassMethods
8
+ attr_accessor :soap_actions
9
+
10
+ # Define a SOAP action +action+. The function has two required +options+:
11
+ # :args and :return. Each is a type +definition+ of format described in
12
+ # WashOut::Param#parse_def.
13
+ #
14
+ # An optional option :to can be passed to allow for names of SOAP actions
15
+ # which are not valid Ruby function names.
16
+ def soap_action(action, options={})
17
+ self.soap_actions[action.to_s] = {
18
+ :in => WashOut::Param.parse_def(options[:args]),
19
+ :out => WashOut::Param.parse_def(options[:return]),
20
+ :to => options[:to] || action
21
+ }
22
+ end
23
+ end
24
+
25
+ included do
26
+ include WashOut::Dispatcher
27
+ self.soap_actions = {}
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,3 @@
1
+ module WashOut
2
+ VERSION = "0.2.0"
3
+ end
data/lib/wash_out.rb ADDED
@@ -0,0 +1,19 @@
1
+ require 'wash_out/engine'
2
+ require 'wash_out/param'
3
+ require 'wash_out/dispatcher'
4
+ require 'wash_out/soap'
5
+
6
+ module ActionDispatch::Routing
7
+ class Mapper
8
+ # Adds the routes for a SOAP endpoint at +controller+.
9
+ def wash_out(controller)
10
+ match "#{controller.to_s}/wsdl" => "#{controller.to_s}#_wsdl"
11
+ match "#{controller.to_s}/action" => "#{controller.to_s}#_action", :defaults => { :format => 'soap' }
12
+ end
13
+ end
14
+ end
15
+
16
+ Mime::Type.register "application/soap+xml", :soap
17
+ ActionController::Renderers.add :soap do |what, options|
18
+ _render_soap(what, options)
19
+ end
@@ -0,0 +1,7 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+ require 'rake'
6
+
7
+ Dummy::Application.load_tasks
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag :all %>
6
+ <%= javascript_include_tag :defaults %>
7
+ <%= csrf_meta_tag %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,42 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require "action_controller/railtie"
4
+ require "rails/test_unit/railtie"
5
+
6
+ Bundler.require
7
+ require "wash_out"
8
+
9
+ module Dummy
10
+ class Application < Rails::Application
11
+ # Settings in config/environments/* take precedence over those specified here.
12
+ # Application configuration should go into files in config/initializers
13
+ # -- all .rb files in that directory are automatically loaded.
14
+
15
+ # Custom directories with classes and modules you want to be autoloadable.
16
+ # config.autoload_paths += %W(#{config.root}/extras)
17
+
18
+ # Only load the plugins named here, in the order given (default is alphabetical).
19
+ # :all can be used as a placeholder for all plugins not explicitly named.
20
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
21
+
22
+ # Activate observers that should always be running.
23
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
24
+
25
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
26
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
27
+ # config.time_zone = 'Central Time (US & Canada)'
28
+
29
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
30
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
31
+ # config.i18n.default_locale = :de
32
+
33
+ # JavaScript files you want as :defaults (application.js is always included).
34
+ # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
35
+
36
+ # Configure the default encoding used in templates for Ruby 1.9.
37
+ config.encoding = "utf-8"
38
+
39
+ # Configure sensitive parameters which will be filtered from the log file.
40
+ config.filter_parameters += [:password]
41
+ end
42
+ end
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,23 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the webserver when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_view.debug_rjs = true
15
+ config.action_controller.perform_caching = false
16
+
17
+ # Print deprecation notices to the Rails logger
18
+ config.active_support.deprecation = :log
19
+
20
+ # Only use best-standards-support built into browsers
21
+ config.action_dispatch.best_standards_support = :builtin
22
+ end
23
+
@@ -0,0 +1,30 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Log error messages when you accidentally call methods on nil.
11
+ config.whiny_nils = true
12
+
13
+ # Show full error reports and disable caching
14
+ config.consider_all_requests_local = true
15
+ config.action_controller.perform_caching = false
16
+
17
+ # Raise exceptions instead of rendering exception templates
18
+ config.action_dispatch.show_exceptions = false
19
+
20
+ # Disable request forgery protection in test environment
21
+ config.action_controller.allow_forgery_protection = false
22
+
23
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
24
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
25
+ # like if you have constraints or database-specific column types
26
+ # config.active_record.schema_format = :sql
27
+
28
+ # Print deprecation notices to the stderr
29
+ config.active_support.deprecation = :stderr
30
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,10 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = 'b8d5d5687c012c2ef1a7a6e8006172402c48a3dcccca67c076eaad81c4712ad236ca2717c3706df7b286468c749d223f22acb0d96c27bdf33bbdbb9684ad46e5'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, :key => '_dummy_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,58 @@
1
+ Dummy::Application.routes.draw do
2
+ # The priority is based upon order of creation:
3
+ # first created -> highest priority.
4
+
5
+ # Sample of regular route:
6
+ # match 'products/:id' => 'catalog#view'
7
+ # Keep in mind you can assign values other than :controller and :action
8
+
9
+ # Sample of named route:
10
+ # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
11
+ # This route can be invoked with purchase_url(:id => product.id)
12
+
13
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
14
+ # resources :products
15
+
16
+ # Sample resource route with options:
17
+ # resources :products do
18
+ # member do
19
+ # get 'short'
20
+ # post 'toggle'
21
+ # end
22
+ #
23
+ # collection do
24
+ # get 'sold'
25
+ # end
26
+ # end
27
+
28
+ # Sample resource route with sub-resources:
29
+ # resources :products do
30
+ # resources :comments, :sales
31
+ # resource :seller
32
+ # end
33
+
34
+ # Sample resource route with more complex sub-resources
35
+ # resources :products do
36
+ # resources :comments
37
+ # resources :sales do
38
+ # get 'recent', :on => :collection
39
+ # end
40
+ # end
41
+
42
+ # Sample resource route within a namespace:
43
+ # namespace :admin do
44
+ # # Directs /admin/products/* to Admin::ProductsController
45
+ # # (app/controllers/admin/products_controller.rb)
46
+ # resources :products
47
+ # end
48
+
49
+ # You can have the root of your site routed with "root"
50
+ # just remember to delete public/index.html.
51
+ # root :to => "welcome#index"
52
+
53
+ # See how all your routes lay out with "rake routes"
54
+
55
+ # This is a legacy wild controller route that's not recommended for RESTful applications.
56
+ # Note: This route will make all actions in every controller accessible via GET requests.
57
+ # match ':controller(/:action(/:id(.:format)))'
58
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
24
+ </div>
25
+ </body>
26
+ </html>
File without changes
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'