cp-sparrow 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.ruby-version +1 -1
  4. data/.travis.yml +2 -5
  5. data/README.md +6 -3
  6. data/Rakefile +8 -7
  7. data/lib/cp-sparrow.rb +1 -0
  8. data/lib/sparrow/configuration.rb +5 -1
  9. data/lib/sparrow/core_ext/hash.rb +22 -17
  10. data/lib/sparrow/dependencies.rb +11 -2
  11. data/lib/sparrow/logger.rb +1 -1
  12. data/lib/sparrow/railtie.rb +3 -3
  13. data/lib/sparrow/request_http_message.rb +1 -1
  14. data/lib/sparrow/response_middleware.rb +5 -5
  15. data/lib/sparrow/route_parser.rb +1 -1
  16. data/lib/sparrow/strategies/ignore.rb +2 -2
  17. data/lib/sparrow/strategies/json_format_strategies/default_json_format_strategy.rb +1 -1
  18. data/lib/sparrow/strategies/json_format_strategies/json_format_strategy.rb +5 -4
  19. data/lib/sparrow/strategies/key_transformation/underscore_key.rb +1 -1
  20. data/lib/sparrow/strategies/transform_params.rb +5 -1
  21. data/lib/sparrow/transformable.rb +8 -8
  22. data/lib/sparrow/version.rb +1 -1
  23. data/sparrow.gemspec +5 -3
  24. data/spec/integration/apps/rack_app/app.rb +22 -5
  25. data/spec/integration/apps/rack_app/config.ru +2 -2
  26. data/spec/integration/apps/rails_app/README.rdoc +15 -248
  27. data/spec/integration/apps/rails_app/Rakefile +1 -2
  28. data/spec/integration/apps/rails_app/app/assets/images/.keep +0 -0
  29. data/spec/integration/apps/rails_app/app/assets/javascripts/application.js +4 -6
  30. data/spec/integration/apps/rails_app/app/assets/stylesheets/application.css +6 -4
  31. data/spec/integration/apps/rails_app/app/controllers/application_controller.rb +3 -1
  32. data/spec/integration/apps/rails_app/app/controllers/concerns/.keep +0 -0
  33. data/spec/integration/apps/rails_app/app/controllers/errors_controller.rb +10 -0
  34. data/spec/integration/apps/rails_app/app/controllers/welcome_controller.rb +0 -5
  35. data/spec/integration/apps/rails_app/app/mailers/.keep +0 -0
  36. data/spec/integration/apps/rails_app/app/models/.keep +0 -0
  37. data/spec/integration/apps/rails_app/app/models/concerns/.keep +0 -0
  38. data/spec/integration/apps/rails_app/app/views/layouts/application.html.erb +3 -3
  39. data/spec/integration/apps/rails_app/bin/bundle +3 -0
  40. data/spec/integration/apps/rails_app/bin/rails +4 -0
  41. data/spec/integration/apps/rails_app/bin/rake +4 -0
  42. data/spec/integration/apps/rails_app/bin/setup +29 -0
  43. data/spec/integration/apps/rails_app/config.ru +2 -2
  44. data/spec/integration/apps/rails_app/config/application.rb +6 -43
  45. data/spec/integration/apps/rails_app/config/boot.rb +4 -9
  46. data/spec/integration/apps/rails_app/config/database.yml +25 -0
  47. data/spec/integration/apps/rails_app/config/environment.rb +3 -3
  48. data/spec/integration/apps/rails_app/config/environments/development.rb +23 -13
  49. data/spec/integration/apps/rails_app/config/environments/production.rb +46 -31
  50. data/spec/integration/apps/rails_app/config/environments/test.rb +20 -10
  51. data/spec/integration/apps/rails_app/config/initializers/assets.rb +11 -0
  52. data/spec/integration/apps/rails_app/config/initializers/cookies_serializer.rb +3 -0
  53. data/spec/integration/apps/rails_app/config/initializers/filter_parameter_logging.rb +4 -0
  54. data/spec/integration/apps/rails_app/config/initializers/inflections.rb +6 -5
  55. data/spec/integration/apps/rails_app/config/initializers/mime_types.rb +0 -1
  56. data/spec/integration/apps/rails_app/config/initializers/secret_token.rb +1 -1
  57. data/spec/integration/apps/rails_app/config/initializers/session_store.rb +1 -6
  58. data/spec/integration/apps/rails_app/config/initializers/wrap_parameters.rb +6 -2
  59. data/spec/integration/apps/rails_app/config/locales/en.yml +20 -2
  60. data/spec/integration/apps/rails_app/config/routes.rb +21 -29
  61. data/spec/integration/apps/rails_app/config/secrets.yml +22 -0
  62. data/spec/integration/apps/rails_app/lib/assets/.keep +0 -0
  63. data/spec/integration/apps/rails_app/public/404.html +54 -13
  64. data/spec/integration/apps/rails_app/public/422.html +54 -13
  65. data/spec/integration/apps/rails_app/public/500.html +53 -12
  66. data/spec/integration/rack/camel_caser_spec.rb +18 -18
  67. data/spec/integration/rack/error_spec.rb +17 -0
  68. data/spec/integration/rails/camel_caser_accept_header_spec.rb +3 -3
  69. data/spec/integration/rails/camel_caser_spec.rb +30 -19
  70. data/spec/spec_helper.rb +1 -2
  71. data/spec/support/rails_app_helper.rb +1 -1
  72. data/spec/unit/configuration_spec.rb +2 -2
  73. metadata +46 -24
@@ -1,10 +1,5 @@
1
- require 'rubygems'
2
- gemfile = File.expand_path('../../../../Gemfile', __FILE__)
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
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__)
4
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: db/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: db/test.sqlite3
22
+
23
+ production:
24
+ <<: *default
25
+ database: db/production.sqlite3
@@ -1,5 +1,5 @@
1
- # Load the rails application
1
+ # Load the Rails application.
2
2
  require File.expand_path('../application', __FILE__)
3
3
 
4
- # Initialize the rails application
5
- Dummy::Application.initialize!
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -1,31 +1,41 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # In the development environment your application's code is reloaded on
5
5
  # every request. This slows down response time but is perfect for development
6
6
  # since you don't have to restart the web server when you make code changes.
7
7
  config.cache_classes = false
8
8
 
9
- # Log error messages when you accidentally call methods on nil.
10
- config.whiny_nils = true
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
11
 
12
- # Show full error reports and disable caching
12
+ # Show full error reports and disable caching.
13
13
  config.consider_all_requests_local = true
14
14
  config.action_controller.perform_caching = false
15
15
 
16
- # Don't care if the mailer can't send
16
+ # Don't care if the mailer can't send.
17
17
  config.action_mailer.raise_delivery_errors = false
18
18
 
19
- # Print deprecation notices to the Rails logger
19
+ # Print deprecation notices to the Rails logger.
20
20
  config.active_support.deprecation = :log
21
21
 
22
- # Only use best-standards-support built into browsers
23
- config.action_dispatch.best_standards_support = :builtin
22
+ # Raise an error on page load if there are pending migrations.
23
+ # config.active_record.migration_error = :page_load
24
24
 
25
+ # Debug mode disables concatenation and preprocessing of assets.
26
+ # This option may cause significant delays in view rendering with a large
27
+ # number of complex assets.
28
+ config.assets.debug = true
25
29
 
26
- # Do not compress assets
27
- config.assets.compress = false
30
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
31
+ # yet still be able to expire them through the digest params.
32
+ config.assets.digest = true
28
33
 
29
- # Expands the lines which load the assets
30
- config.assets.debug = true
34
+ # Adds additional error checking when serving assets at runtime.
35
+ # Checks for improperly declared sprockets dependencies.
36
+ # Raises helpful error messages.
37
+ config.assets.raise_runtime_errors = true
38
+
39
+ # Raises error for missing translations
40
+ # config.action_view.raise_on_missing_translations = true
31
41
  end
@@ -1,64 +1,79 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
- # Code is not reloaded between requests
4
+ # Code is not reloaded between requests.
5
5
  config.cache_classes = true
6
6
 
7
- # Full error reports are disabled and caching is turned on
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both threaded web servers
9
+ # and those relying on copy on write to perform better.
10
+ # Rake tasks automatically ignore this option for performance.
11
+ config.eager_load = true
12
+
13
+ # Full error reports are disabled and caching is turned on.
8
14
  config.consider_all_requests_local = false
9
15
  config.action_controller.perform_caching = true
10
16
 
11
- # Disable Rails's static asset server (Apache or nginx will already do this)
12
- config.serve_static_assets = false
17
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
+ # Add `rack-cache` to your Gemfile before enabling this.
19
+ # For large-scale production use, consider using a caching reverse proxy like
20
+ # NGINX, varnish or squid.
21
+ # config.action_dispatch.rack_cache = true
22
+
23
+ # Disable serving static files from the `/public` folder by default since
24
+ # Apache or NGINX already handles this.
25
+ config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
13
26
 
14
- # Compress JavaScripts and CSS
15
- config.assets.compress = true
27
+ # Compress JavaScripts and CSS.
28
+ config.assets.js_compressor = :uglifier
29
+ # config.assets.css_compressor = :sass
16
30
 
17
- # Don't fallback to assets pipeline if a precompiled asset is missed
31
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
18
32
  config.assets.compile = false
19
33
 
20
- # Generate digests for assets URLs
34
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
35
+ # yet still be able to expire them through the digest params.
21
36
  config.assets.digest = true
22
37
 
23
- # Defaults to nil and saved in location specified by config.assets.prefix
24
- # config.assets.manifest = YOUR_PATH
38
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
25
39
 
26
- # Specifies the header that your server uses for sending files
27
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
40
+ # Specifies the header that your server uses for sending files.
41
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
42
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
29
43
 
30
44
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
45
  # config.force_ssl = true
32
46
 
33
- # See everything in the log (default is :info)
34
- # config.log_level = :debug
47
+ # Use the lowest log level to ensure availability of diagnostic information
48
+ # when problems arise.
49
+ config.log_level = :debug
35
50
 
36
- # Prepend all log lines with the following tags
51
+ # Prepend all log lines with the following tags.
37
52
  # config.log_tags = [ :subdomain, :uuid ]
38
53
 
39
- # Use a different logger for distributed setups
54
+ # Use a different logger for distributed setups.
40
55
  # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
56
 
42
- # Use a different cache store in production
57
+ # Use a different cache store in production.
43
58
  # config.cache_store = :mem_cache_store
44
59
 
45
- # Enable serving of images, stylesheets, and JavaScripts from an asset server
46
- # config.action_controller.asset_host = "http://assets.example.com"
47
-
48
- # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49
- # config.assets.precompile += %w( search.js )
60
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
61
+ # config.action_controller.asset_host = 'http://assets.example.com'
50
62
 
51
- # Disable delivery errors, bad email addresses will be ignored
63
+ # Ignore bad email addresses and do not raise email delivery errors.
64
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
52
65
  # config.action_mailer.raise_delivery_errors = false
53
66
 
54
- # Enable threaded mode
55
- # config.threadsafe!
56
-
57
67
  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58
- # the I18n.default_locale when a translation can not be found)
68
+ # the I18n.default_locale when a translation cannot be found).
59
69
  config.i18n.fallbacks = true
60
70
 
61
- # Send deprecation notices to registered listeners
71
+ # Send deprecation notices to registered listeners.
62
72
  config.active_support.deprecation = :notify
63
73
 
74
+ # Use default logging formatter so that PID and timestamp are not suppressed.
75
+ config.log_formatter = ::Logger::Formatter.new
76
+
77
+ # Do not dump schema after migrations.
78
+ # config.active_record.dump_schema_after_migration = false
64
79
  end
@@ -1,5 +1,5 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # The test environment is used exclusively to run your application's
5
5
  # test suite. You never need to work with it otherwise. Remember that
@@ -7,26 +7,36 @@ Dummy::Application.configure do
7
7
  # and recreated between test runs. Don't rely on the data there!
8
8
  config.cache_classes = true
9
9
 
10
- # Configure static asset server for tests with Cache-Control for performance
11
- config.serve_static_files = true
12
- config.static_cache_control = "public, max-age=3600"
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
13
14
 
14
- # Show full error reports and disable caching
15
+ # Configure static file server for tests with Cache-Control for performance.
16
+ config.serve_static_files = true
17
+ config.static_cache_control = 'public, max-age=3600'
18
+
19
+ # Show full error reports and disable caching.
15
20
  config.consider_all_requests_local = true
16
21
  config.action_controller.perform_caching = false
17
22
 
18
- # Raise exceptions instead of rendering exception templates
23
+ # Raise exceptions instead of rendering exception templates.
19
24
  config.action_dispatch.show_exceptions = false
20
25
 
21
- # Disable request forgery protection in test environment
22
- config.action_controller.allow_forgery_protection = false
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
23
28
 
24
29
  # Tell Action Mailer not to deliver emails to the real world.
25
30
  # The :test delivery method accumulates sent emails in the
26
31
  # ActionMailer::Base.deliveries array.
27
32
  config.action_mailer.delivery_method = :test
28
33
 
34
+ # Randomize the order test cases are executed.
35
+ config.active_support.test_order = :random
29
36
 
30
- # Print deprecation notices to the stderr
37
+ # Print deprecation notices to the stderr.
31
38
  config.active_support.deprecation = :stderr
39
+
40
+ # Raises error for missing translations
41
+ # config.action_view.raise_on_missing_translations = true
32
42
  end
@@ -0,0 +1,11 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Add additional assets to the asset load path
7
+ # Rails.application.config.assets.paths << Emoji.images_path
8
+
9
+ # Precompile additional assets.
10
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11
+ # Rails.application.config.assets.precompile += %w( search.js )
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -1,15 +1,16 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- # Add new inflection rules using the following format
4
- # (all these examples are active by default):
5
- # ActiveSupport::Inflector.inflections do |inflect|
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
6
7
  # inflect.plural /^(ox)$/i, '\1en'
7
8
  # inflect.singular /^(ox)en/i, '\1'
8
9
  # inflect.irregular 'person', 'people'
9
10
  # inflect.uncountable %w( fish sheep )
10
11
  # end
11
- #
12
+
12
13
  # These inflection rules are supported but not enabled by default:
13
- # ActiveSupport::Inflector.inflections do |inflect|
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
14
15
  # inflect.acronym 'RESTful'
15
16
  # end
@@ -2,4 +2,3 @@
2
2
 
3
3
  # Add new mime types for use in respond_to blocks:
4
4
  # Mime::Type.register "text/richtext", :rtf
5
- # Mime::Type.register_alias "text/html", :iphone
@@ -4,4 +4,4 @@
4
4
  # If you change this key, all old signed cookies will become invalid!
5
5
  # Make sure the secret is at least 30 characters and all random,
6
6
  # no regular words or you'll be exposed to dictionary attacks.
7
- Dummy::Application.config.secret_token = '03211c125d6e63548812b379cc90938ca0b2b46c69864f719082847db3e59152d162c7db9679bc3fcd67e5690f78617cadcdb3063e0ae2db32b8a38d9ef7437e'
7
+ Rails.application.config.secret_token = '03211c125d6e63548812b379cc90938ca0b2b46c69864f719082847db3e59152d162c7db9679bc3fcd67e5690f78617cadcdb3063e0ae2db32b8a38d9ef7437e'
@@ -1,8 +1,3 @@
1
1
  # Be sure to restart your server when you modify this file.
2
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
3
+ Rails.application.config.session_store :cookie_store, key: '_rails_app_session'
@@ -1,10 +1,14 @@
1
1
  # Be sure to restart your server when you modify this file.
2
- #
2
+
3
3
  # This file contains settings for ActionController::ParamsWrapper which
4
4
  # is enabled by default.
5
5
 
6
6
  # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
7
  ActiveSupport.on_load(:action_controller) do
8
- wrap_parameters format: [:json]
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
9
  end
10
10
 
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -1,5 +1,23 @@
1
- # Sample localization file for English. Add more files in this directory for other locales.
2
- # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
3
21
 
4
22
  en:
5
23
  hello: "Hello world"
@@ -1,18 +1,15 @@
1
- Dummy::Application.routes.draw do
2
- # The priority is based upon order of creation:
3
- # first created -> highest priority.
4
-
1
+ Rails.application.routes.draw do
5
2
  # Sample of regular route:
6
3
  # match 'products/:id' => 'catalog#view'
7
4
  # Keep in mind you can assign values other than :controller and :action
8
-
5
+
9
6
  # Sample of named route:
10
7
  # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
11
8
  # This route can be invoked with purchase_url(:id => product.id)
12
-
9
+
13
10
  # Sample resource route (maps HTTP verbs to controller actions automatically):
14
11
  # resources :products
15
-
12
+
16
13
  # Sample resource route with options:
17
14
  # resources :products do
18
15
  # member do
@@ -24,13 +21,13 @@ Dummy::Application.routes.draw do
24
21
  # get 'sold'
25
22
  # end
26
23
  # end
27
-
24
+
28
25
  # Sample resource route with sub-resources:
29
26
  # resources :products do
30
27
  # resources :comments, :sales
31
28
  # resource :seller
32
29
  # end
33
-
30
+
34
31
  # Sample resource route with more complex sub-resources
35
32
  # resources :products do
36
33
  # resources :comments
@@ -38,31 +35,26 @@ Dummy::Application.routes.draw do
38
35
  # get 'recent', :on => :collection
39
36
  # end
40
37
  # end
41
-
38
+
42
39
  # Sample resource route within a namespace:
43
40
  # namespace :admin do
44
41
  # # Directs /admin/products/* to Admin::ProductsController
45
42
  # # (app/controllers/admin/products_controller.rb)
46
43
  # resources :products
47
44
  # end
48
-
45
+
49
46
  # You can have the root of your site routed with "root"
50
47
  # just remember to delete public/index.html.
51
- root :to => 'welcome#index', defaults: { format: 'json' }
52
- post '/posts' => 'welcome#posts', defaults: {format: 'json'}
53
- get '/welcome' => 'welcome#show', default: {format: 'json'}
54
- get '/welcome/non_json_text_response' => 'welcome#non_json_text_response', default: {format: 'json'}
55
- get '/welcome/non_json_binary_response' => 'welcome#non_json_binary_response', default: {format: 'json'}
56
- get '/array_of_elements' => 'welcome#array_of_elements', default: {format: 'json'}
57
- get '/upcase_first_name' => 'welcome#upcase_first_name', default: {format: 'json'}
58
- get '/ignore' => 'welcome#ignore', default: {format: 'json'}
59
- get '/ignore/non_json_text_response' => 'welcome#non_json_text_response', default: {format: 'json'}
60
- get '/ignore/non_json_binary_response' => 'welcome#non_json_binary_response', default: {format: 'json'}
61
- get '/error' => 'welcome#error', default: {format: 'json'}
62
-
63
- # See how all your routes lay out with "rake routes"
64
-
65
- # This is a legacy wild controller route that's not recommended for RESTful applications.
66
- # Note: This route will make all actions in every controller accessible via GET requests.
67
- # match ':controller(/:action(/:id))(.:format)'
68
- end
48
+ root to: 'welcome#index', defaults: {format: 'json'}
49
+ post '/posts', to: 'welcome#posts', defaults: {format: 'json'}
50
+ get '/welcome', to: 'welcome#show', defaults: {format: 'json'}
51
+ get '/welcome/non_json_text_response', to: 'welcome#non_json_text_response' #, defaults: {format: 'json'}
52
+ get '/welcome/non_json_binary_response', to: 'welcome#non_json_binary_response' #, defaults: {format: 'json'}
53
+ get '/array_of_elements', to: 'welcome#array_of_elements', defaults: {format: 'json'}
54
+ get '/upcase_first_name', to: 'welcome#upcase_first_name', defaults: {format: 'json'}
55
+ get '/ignore', to: 'welcome#ignore', defaults: {format: 'json'}
56
+ get '/ignore/non_json_text_response', to: 'welcome#non_json_text_response' # , defaults: {format: 'json'}
57
+ get '/ignore/non_json_binary_response', to: 'welcome#non_json_binary_response' #, defaults: {format: 'json'}
58
+ get '/error', to: 'errors#error', defaults: {format: 'json'}
59
+ get '/error-507', to: 'errors#error_507'
60
+ end