grape-swagger-rails 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/head.yml +32 -0
- data/.github/workflows/rubocop.yml +14 -0
- data/.github/workflows/test.yml +11 -19
- data/.rubocop.yml +7 -2
- data/.rubocop_todo.yml +78 -125
- data/CHANGELOG.md +9 -0
- data/Dangerfile +2 -0
- data/Gemfile +8 -7
- data/README.md +2 -1
- data/Rakefile +5 -9
- data/app/assets/config/grape_swagger_rails_manifest.js +2 -0
- data/app/controllers/grape_swagger_rails/application_controller.rb +4 -2
- data/app/views/grape_swagger_rails/application/index.html.erb +1 -1
- data/config/routes.rb +2 -0
- data/grape-swagger-rails.gemspec +10 -4
- data/lib/grape-swagger-rails/engine.rb +2 -0
- data/lib/grape-swagger-rails/version.rb +3 -1
- data/lib/grape-swagger-rails.rb +17 -14
- data/lib/script/rails +4 -2
- data/lib/tasks/swagger_ui.rake +6 -3
- data/spec/dummy/Rakefile +6 -3
- data/spec/dummy/app/api/api.rb +2 -0
- data/spec/dummy/app/assets/config/manifest.js +3 -4
- data/spec/dummy/app/assets/javascripts/application.js +0 -2
- data/spec/dummy/app/controllers/application_controller.rb +2 -0
- data/spec/dummy/app/controllers/welcome_controller.rb +3 -2
- data/spec/dummy/app/views/layouts/application.html.erb +1 -0
- data/spec/dummy/bin/rails +3 -5
- data/spec/dummy/bin/rake +2 -4
- data/spec/dummy/bin/setup +27 -0
- data/spec/dummy/config/application.rb +11 -10
- data/spec/dummy/config/boot.rb +4 -7
- data/spec/dummy/config/environment.rb +6 -2
- data/spec/dummy/config/environments/development.rb +40 -19
- data/spec/dummy/config/environments/production.rb +31 -31
- data/spec/dummy/config/environments/test.rb +30 -20
- data/spec/dummy/config/initializers/assets.rb +13 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +10 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/swagger.rb +2 -0
- data/spec/dummy/config/routes.rb +2 -0
- data/spec/dummy/config.ru +6 -2
- data/spec/dummy/public/404.html +6 -6
- data/spec/dummy/public/422.html +6 -6
- data/spec/dummy/public/500.html +6 -6
- data/spec/features/grape-swagger-rails_spec.rb +5 -1
- data/spec/features/swagger_spec.rb +97 -35
- data/spec/features/welcome_spec.rb +3 -0
- data/spec/spec_helper.rb +4 -2
- data/spec/support/capybara.rb +2 -0
- data/spec/support/rails.rb +2 -0
- metadata +16 -56
- data/spec/dummy/bin/bundle +0 -3
- data/spec/dummy/bin/spring +0 -18
- data/spec/dummy/config/initializers/cookies_serializer.rb +0 -1
- data/spec/dummy/config/initializers/session_store.rb +0 -1
- data/spec/dummy/vendor/assets/javascripts/.keep +0 -0
- data/spec/dummy/vendor/assets/stylesheets/.keep +0 -0
data/lib/tasks/swagger_ui.rake
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'git'
|
2
4
|
|
3
5
|
namespace :swagger_ui do
|
@@ -9,7 +11,7 @@ namespace :swagger_ui do
|
|
9
11
|
# clone wordnik/swagger-ui
|
10
12
|
Git.clone 'git@github.com:wordnik/swagger-ui.git', 'swagger-ui', path: dir, depth: 0
|
11
13
|
# prune local files
|
12
|
-
root = File.expand_path '
|
14
|
+
root = File.expand_path '../..', __dir__
|
13
15
|
puts "Removing files from #{root} ..."
|
14
16
|
repo = Git.open root
|
15
17
|
# Javascripts
|
@@ -17,7 +19,8 @@ namespace :swagger_ui do
|
|
17
19
|
FileUtils.rm_r "#{root}/app/assets/javascripts/grape_swagger_rails"
|
18
20
|
FileUtils.cp_r "#{dir}/swagger-ui/dist/lib", "#{root}/app/assets/javascripts"
|
19
21
|
FileUtils.mv "#{root}/app/assets/javascripts/lib", "#{root}/app/assets/javascripts/grape_swagger_rails"
|
20
|
-
FileUtils.cp_r Dir.glob("#{dir}/swagger-ui/dist/swagger-ui.min.js"),
|
22
|
+
FileUtils.cp_r Dir.glob("#{dir}/swagger-ui/dist/swagger-ui.min.js"),
|
23
|
+
"#{root}/app/assets/javascripts/grape_swagger_rails"
|
21
24
|
FileUtils.cp Dir.glob("#{root}/lib/javascripts/*.js"), "#{root}/app/assets/javascripts/grape_swagger_rails"
|
22
25
|
# Generate application.js
|
23
26
|
JAVASCRIPT_FILES = [
|
@@ -74,7 +77,7 @@ namespace :swagger_ui do
|
|
74
77
|
# rewrite screen.css into screen.css.erb with dynamic image paths
|
75
78
|
File.open "#{root}/app/assets/stylesheets/grape_swagger_rails/screen.css.erb", 'w+' do |file|
|
76
79
|
contents = File.read "#{root}/app/assets/stylesheets/grape_swagger_rails/screen.css"
|
77
|
-
contents.gsub!
|
80
|
+
contents.gsub!(%r{url\(('*).*/(?<filename>[\w.]*)('*)\)}) do |_match|
|
78
81
|
"url(<%= image_path('grape_swagger_rails/#{$LAST_MATCH_INFO[:filename]}') %>)"
|
79
82
|
end
|
80
83
|
file.write contents
|
data/spec/dummy/Rakefile
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
4
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
4
5
|
|
5
|
-
|
6
|
+
require_relative 'config/application'
|
7
|
+
|
8
|
+
Rails.application.load_tasks
|
data/spec/dummy/app/api/api.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
//=
|
2
|
-
//=
|
3
|
-
//= link
|
4
|
-
//= link grape_swagger_rails/application.js
|
1
|
+
//= link_directory ../stylesheets .css
|
2
|
+
//= link_directory ../javascripts .js
|
3
|
+
//= link grape_swagger_rails_manifest.js
|
data/spec/dummy/bin/rails
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
end
|
6
|
-
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../config/application', __dir__)
|
7
5
|
require_relative '../config/boot'
|
8
6
|
require 'rails/commands'
|
data/spec/dummy/bin/rake
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'fileutils'
|
5
|
+
|
6
|
+
# path to your application root.
|
7
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
8
|
+
|
9
|
+
def system!(*args)
|
10
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
11
|
+
end
|
12
|
+
|
13
|
+
FileUtils.chdir APP_ROOT do
|
14
|
+
# This script is a way to set up or update your development environment automatically.
|
15
|
+
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
|
16
|
+
# Add necessary setup steps to this file.
|
17
|
+
|
18
|
+
puts '== Installing dependencies =='
|
19
|
+
system! 'gem install bundler --conservative'
|
20
|
+
system('bundle check') || system!('bundle install')
|
21
|
+
|
22
|
+
puts "\n== Removing old logs and tempfiles =="
|
23
|
+
system! 'bin/rails log:clear tmp:clear'
|
24
|
+
|
25
|
+
puts "\n== Restarting application server =="
|
26
|
+
system! 'bin/rails restart'
|
27
|
+
end
|
@@ -1,23 +1,24 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
require 'action_view/railtie'
|
5
|
-
require 'sprockets/railtie'
|
6
|
-
require 'jquery-rails'
|
7
|
-
require 'rack/cors'
|
8
|
-
require 'rack/no_animations'
|
3
|
+
require_relative 'boot'
|
9
4
|
|
5
|
+
require 'rails/all'
|
6
|
+
|
7
|
+
# Require the gems listed in Gemfile, including any gems
|
8
|
+
# you've limited to :test, :development, or :production.
|
10
9
|
Bundler.require(*Rails.groups)
|
11
10
|
require 'grape-swagger-rails'
|
12
11
|
|
13
12
|
module Dummy
|
14
13
|
class Application < Rails::Application
|
15
|
-
config.
|
16
|
-
|
14
|
+
config.load_defaults Rails::VERSION::STRING.to_f
|
15
|
+
|
16
|
+
# For compatibility with applications that use this config
|
17
|
+
config.action_controller.include_all_helpers = false
|
17
18
|
config.middleware.use Rack::Cors do
|
18
19
|
allow do
|
19
20
|
origins '*'
|
20
|
-
resource '*', headers: :any, methods: [
|
21
|
+
resource '*', headers: :any, methods: %i[get post options]
|
21
22
|
end
|
22
23
|
end
|
23
24
|
end
|
data/spec/dummy/config/boot.rb
CHANGED
@@ -1,10 +1,7 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
# Set up gems listed in the Gemfile.
|
4
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
|
4
5
|
|
5
6
|
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
6
|
-
|
7
|
-
require 'sass'
|
8
|
-
require 'grape'
|
9
|
-
require 'grape-swagger'
|
10
|
-
require 'coffee_script'
|
7
|
+
$LOAD_PATH.unshift File.expand_path('../../../lib', __dir__)
|
@@ -1,37 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'active_support/core_ext/integer/time'
|
4
|
+
|
1
5
|
Rails.application.configure do
|
2
6
|
# Settings specified here will take precedence over those in config/application.rb.
|
3
7
|
|
4
|
-
# In the development environment your application's code is reloaded
|
5
|
-
#
|
8
|
+
# In the development environment your application's code is reloaded any time
|
9
|
+
# it changes. This slows down response time but is perfect for development
|
6
10
|
# since you don't have to restart the web server when you make code changes.
|
7
11
|
config.cache_classes = false
|
8
12
|
|
9
13
|
# Do not eager load code on boot.
|
10
14
|
config.eager_load = false
|
11
15
|
|
12
|
-
# Show full error reports
|
13
|
-
config.consider_all_requests_local
|
14
|
-
|
16
|
+
# Show full error reports.
|
17
|
+
config.consider_all_requests_local = true
|
18
|
+
|
19
|
+
# Enable server timing
|
20
|
+
config.server_timing = true
|
21
|
+
|
22
|
+
# Enable/disable caching. By default caching is disabled.
|
23
|
+
# Run rails dev:cache to toggle caching.
|
24
|
+
if Rails.root.join('tmp/caching-dev.txt').exist?
|
25
|
+
config.action_controller.perform_caching = true
|
26
|
+
config.action_controller.enable_fragment_cache_logging = true
|
15
27
|
|
16
|
-
|
17
|
-
|
28
|
+
config.cache_store = :memory_store
|
29
|
+
config.public_file_server.headers = {
|
30
|
+
'Cache-Control' => "public, max-age=#{2.days.to_i}"
|
31
|
+
}
|
32
|
+
else
|
33
|
+
config.action_controller.perform_caching = false
|
34
|
+
|
35
|
+
config.cache_store = :null_store
|
36
|
+
end
|
18
37
|
|
19
38
|
# Print deprecation notices to the Rails logger.
|
20
39
|
config.active_support.deprecation = :log
|
21
40
|
|
22
|
-
#
|
23
|
-
|
24
|
-
|
25
|
-
|
41
|
+
# Raise exceptions for disallowed deprecations.
|
42
|
+
config.active_support.disallowed_deprecation = :raise
|
43
|
+
|
44
|
+
# Tell Active Support which deprecation messages to disallow.
|
45
|
+
config.active_support.disallowed_deprecation_warnings = []
|
46
|
+
|
47
|
+
# Suppress logger output for asset requests.
|
48
|
+
config.assets.quiet = true
|
26
49
|
|
27
|
-
#
|
28
|
-
#
|
29
|
-
# Raises helpful error messages.
|
30
|
-
config.assets.raise_runtime_errors = true
|
50
|
+
# Raises error for missing translations.
|
51
|
+
# config.i18n.raise_on_missing_translations = true
|
31
52
|
|
32
|
-
#
|
33
|
-
# config.action_view.
|
53
|
+
# Annotate rendered view with file names.
|
54
|
+
# config.action_view.annotate_rendered_view_with_filenames = true
|
34
55
|
|
35
|
-
#
|
36
|
-
config.
|
56
|
+
# Uncomment if you wish to allow Action Cable access from any origin.
|
57
|
+
# config.action_cable.disable_request_forgery_protection = true
|
37
58
|
end
|
@@ -1,3 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'active_support/core_ext/integer/time'
|
4
|
+
|
1
5
|
Rails.application.configure do
|
2
6
|
# Settings specified here will take precedence over those in config/application.rb.
|
3
7
|
|
@@ -14,16 +18,17 @@ Rails.application.configure do
|
|
14
18
|
config.consider_all_requests_local = false
|
15
19
|
config.action_controller.perform_caching = true
|
16
20
|
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
# config.action_dispatch.rack_cache = true
|
21
|
+
# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
|
22
|
+
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
|
23
|
+
# config.require_master_key = true
|
21
24
|
|
22
|
-
# Disable
|
23
|
-
|
25
|
+
# Disable serving static files from the `/public` folder by default since
|
26
|
+
# Apache or NGINX already handles this.
|
27
|
+
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
24
28
|
|
25
29
|
# Compress JavaScripts and CSS.
|
26
30
|
config.assets.js_compressor = :uglifier
|
31
|
+
# Compress CSS using a preprocessor.
|
27
32
|
# config.assets.css_compressor = :sass
|
28
33
|
|
29
34
|
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
@@ -32,48 +37,43 @@ Rails.application.configure do
|
|
32
37
|
# Generate digests for assets URLs.
|
33
38
|
config.assets.digest = true
|
34
39
|
|
35
|
-
#
|
40
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
41
|
+
# config.asset_host = "http://assets.example.com"
|
36
42
|
|
37
43
|
# Specifies the header that your server uses for sending files.
|
38
|
-
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for
|
39
|
-
# config.action_dispatch.x_sendfile_header =
|
44
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
|
45
|
+
# config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
|
40
46
|
|
41
47
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
42
48
|
# config.force_ssl = true
|
43
49
|
|
44
|
-
#
|
50
|
+
# Include generic and useful information about system operation, but avoid logging too much
|
51
|
+
# information to avoid inadvertent exposure of personally identifiable information (PII).
|
45
52
|
config.log_level = :info
|
46
53
|
|
47
54
|
# Prepend all log lines with the following tags.
|
48
|
-
|
49
|
-
|
50
|
-
# Use a different logger for distributed setups.
|
51
|
-
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
55
|
+
config.log_tags = [:request_id]
|
52
56
|
|
53
57
|
# Use a different cache store in production.
|
54
58
|
# config.cache_store = :mem_cache_store
|
55
59
|
|
56
|
-
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
57
|
-
# config.action_controller.asset_host = "http://assets.example.com"
|
58
|
-
|
59
|
-
# Precompile additional assets.
|
60
|
-
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
61
|
-
# config.assets.precompile += %w( search.js )
|
62
|
-
|
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.
|
65
|
-
# config.action_mailer.raise_delivery_errors = false
|
66
|
-
|
67
60
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
68
61
|
# the I18n.default_locale when a translation cannot be found).
|
69
62
|
config.i18n.fallbacks = true
|
70
63
|
|
71
|
-
#
|
72
|
-
config.active_support.
|
73
|
-
|
74
|
-
# Disable automatic flushing of the log to improve performance.
|
75
|
-
# config.autoflush_log = false
|
64
|
+
# Don't log any deprecations.
|
65
|
+
config.active_support.report_deprecations = false
|
76
66
|
|
77
67
|
# Use default logging formatter so that PID and timestamp are not suppressed.
|
78
|
-
config.log_formatter =
|
68
|
+
config.log_formatter = Logger::Formatter.new
|
69
|
+
|
70
|
+
# Use a different logger for distributed setups.
|
71
|
+
# require "syslog/logger"
|
72
|
+
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
|
73
|
+
|
74
|
+
if ENV['RAILS_LOG_TO_STDOUT'].present?
|
75
|
+
logger = ActiveSupport::Logger.new($stdout)
|
76
|
+
logger.formatter = config.log_formatter
|
77
|
+
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
78
|
+
end
|
79
79
|
end
|
@@ -1,24 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'active_support/core_ext/integer/time'
|
4
|
+
|
5
|
+
# The test environment is used exclusively to run your application's
|
6
|
+
# test suite. You never need to work with it otherwise. Remember that
|
7
|
+
# your test database is "scratch space" for the test suite and is wiped
|
8
|
+
# and recreated between test runs. Don't rely on the data there!
|
9
|
+
|
1
10
|
Rails.application.configure do
|
2
11
|
# Settings specified here will take precedence over those in config/application.rb.
|
3
12
|
|
4
|
-
#
|
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!
|
13
|
+
# Turn false under Spring and add config.action_view.cache_template_loading = true.
|
8
14
|
config.cache_classes = true
|
9
15
|
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
config.eager_load =
|
16
|
+
# Eager loading loads your whole application. When running a single test locally,
|
17
|
+
# this probably isn't necessary. It's a good idea to do in a continuous integration
|
18
|
+
# system, or in some way before deploying your code.
|
19
|
+
config.eager_load = ENV['CI'].present?
|
14
20
|
|
15
|
-
# Configure
|
16
|
-
config.
|
17
|
-
config.
|
21
|
+
# Configure public file server for tests with Cache-Control for performance.
|
22
|
+
config.public_file_server.enabled = true
|
23
|
+
config.public_file_server.headers = {
|
24
|
+
'Cache-Control' => "public, max-age=#{1.hour.to_i}"
|
25
|
+
}
|
18
26
|
|
19
27
|
# Show full error reports and disable caching.
|
20
28
|
config.consider_all_requests_local = true
|
21
29
|
config.action_controller.perform_caching = false
|
30
|
+
config.cache_store = :null_store
|
22
31
|
|
23
32
|
# Raise exceptions instead of rendering exception templates.
|
24
33
|
config.action_dispatch.show_exceptions = false
|
@@ -26,17 +35,18 @@ Rails.application.configure do
|
|
26
35
|
# Disable request forgery protection in test environment.
|
27
36
|
config.action_controller.allow_forgery_protection = false
|
28
37
|
|
29
|
-
# Tell Action Mailer not to deliver emails to the real world.
|
30
|
-
# The :test delivery method accumulates sent emails in the
|
31
|
-
# ActionMailer::Base.deliveries array.
|
32
|
-
# config.action_mailer.delivery_method = :test
|
33
|
-
|
34
38
|
# Print deprecation notices to the stderr.
|
35
39
|
config.active_support.deprecation = :stderr
|
36
40
|
|
37
|
-
#
|
38
|
-
|
41
|
+
# Raise exceptions for disallowed deprecations.
|
42
|
+
config.active_support.disallowed_deprecation = :raise
|
43
|
+
|
44
|
+
# Tell Active Support which deprecation messages to disallow.
|
45
|
+
config.active_support.disallowed_deprecation_warnings = []
|
46
|
+
|
47
|
+
# Raises error for missing translations.
|
48
|
+
# config.i18n.raise_on_missing_translations = true
|
39
49
|
|
40
|
-
#
|
41
|
-
config.
|
50
|
+
# Annotate rendered view with file names.
|
51
|
+
# config.action_view.annotate_rendered_view_with_filenames = true
|
42
52
|
end
|
@@ -1 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Be sure to restart your server when you modify this file.
|
4
|
+
|
5
|
+
# Version of your assets, change this if you want to expire all your assets.
|
1
6
|
Rails.application.config.assets.version = '1.0'
|
7
|
+
|
8
|
+
# Add additional assets to the asset load path.
|
9
|
+
# Rails.application.config.assets.paths << Emoji.images_path
|
10
|
+
|
11
|
+
# Precompile additional assets.
|
12
|
+
# application.js, application.css, and all non-JS/CSS in the app/assets
|
13
|
+
# folder are already added.
|
14
|
+
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Be sure to restart your server when you modify this file.
|
4
|
+
|
5
|
+
# Configure parameters to be filtered from the log file. Use this to limit dissemination of
|
6
|
+
# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported
|
7
|
+
# notations and behaviors.
|
8
|
+
Rails.application.config.filter_parameters += %i[
|
9
|
+
passw secret token _key crypt salt certificate otp ssn
|
10
|
+
]
|
@@ -1,3 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Be sure to restart your server when you modify this file.
|
4
|
+
|
5
|
+
# Add new inflection rules using the following format. Inflections
|
6
|
+
# are locale specific, and you may define rules for as many different
|
7
|
+
# locales as you wish. All of these examples are active by default:
|
8
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
9
|
+
# inflect.plural /^(ox)$/i, "\\1en"
|
10
|
+
# inflect.singular /^(ox)en/i, "\\1"
|
11
|
+
# inflect.irregular "person", "people"
|
12
|
+
# inflect.uncountable %w( fish sheep )
|
13
|
+
# end
|
14
|
+
|
15
|
+
# These inflection rules are supported but not enabled by default:
|
1
16
|
ActiveSupport::Inflector.inflections(:en) do |inflect|
|
2
17
|
inflect.acronym 'API'
|
3
18
|
end
|
data/spec/dummy/config/routes.rb
CHANGED
data/spec/dummy/config.ru
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# This file is used by Rack-based servers to start the application.
|
2
4
|
|
3
|
-
|
4
|
-
|
5
|
+
require_relative 'config/environment'
|
6
|
+
|
7
|
+
run Rails.application
|
8
|
+
Rails.application.load_server
|
data/spec/dummy/public/404.html
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
<title>The page you were looking for doesn't exist (404)</title>
|
5
5
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
6
|
<style>
|
7
|
-
|
7
|
+
.rails-default-error-page {
|
8
8
|
background-color: #EFEFEF;
|
9
9
|
color: #2E2F30;
|
10
10
|
text-align: center;
|
@@ -12,13 +12,13 @@
|
|
12
12
|
margin: 0;
|
13
13
|
}
|
14
14
|
|
15
|
-
div.dialog {
|
15
|
+
.rails-default-error-page div.dialog {
|
16
16
|
width: 95%;
|
17
17
|
max-width: 33em;
|
18
18
|
margin: 4em auto 0;
|
19
19
|
}
|
20
20
|
|
21
|
-
div.dialog > div {
|
21
|
+
.rails-default-error-page div.dialog > div {
|
22
22
|
border: 1px solid #CCC;
|
23
23
|
border-right-color: #999;
|
24
24
|
border-left-color: #999;
|
@@ -31,13 +31,13 @@
|
|
31
31
|
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
32
|
}
|
33
33
|
|
34
|
-
h1 {
|
34
|
+
.rails-default-error-page h1 {
|
35
35
|
font-size: 100%;
|
36
36
|
color: #730E15;
|
37
37
|
line-height: 1.5em;
|
38
38
|
}
|
39
39
|
|
40
|
-
div.dialog > p {
|
40
|
+
.rails-default-error-page div.dialog > p {
|
41
41
|
margin: 0 0 1em;
|
42
42
|
padding: 1em;
|
43
43
|
background-color: #F7F7F7;
|
@@ -54,7 +54,7 @@
|
|
54
54
|
</style>
|
55
55
|
</head>
|
56
56
|
|
57
|
-
<body>
|
57
|
+
<body class="rails-default-error-page">
|
58
58
|
<!-- This file lives in public/404.html -->
|
59
59
|
<div class="dialog">
|
60
60
|
<div>
|
data/spec/dummy/public/422.html
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
<title>The change you wanted was rejected (422)</title>
|
5
5
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
6
|
<style>
|
7
|
-
|
7
|
+
.rails-default-error-page {
|
8
8
|
background-color: #EFEFEF;
|
9
9
|
color: #2E2F30;
|
10
10
|
text-align: center;
|
@@ -12,13 +12,13 @@
|
|
12
12
|
margin: 0;
|
13
13
|
}
|
14
14
|
|
15
|
-
div.dialog {
|
15
|
+
.rails-default-error-page div.dialog {
|
16
16
|
width: 95%;
|
17
17
|
max-width: 33em;
|
18
18
|
margin: 4em auto 0;
|
19
19
|
}
|
20
20
|
|
21
|
-
div.dialog > div {
|
21
|
+
.rails-default-error-page div.dialog > div {
|
22
22
|
border: 1px solid #CCC;
|
23
23
|
border-right-color: #999;
|
24
24
|
border-left-color: #999;
|
@@ -31,13 +31,13 @@
|
|
31
31
|
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
32
|
}
|
33
33
|
|
34
|
-
h1 {
|
34
|
+
.rails-default-error-page h1 {
|
35
35
|
font-size: 100%;
|
36
36
|
color: #730E15;
|
37
37
|
line-height: 1.5em;
|
38
38
|
}
|
39
39
|
|
40
|
-
div.dialog > p {
|
40
|
+
.rails-default-error-page div.dialog > p {
|
41
41
|
margin: 0 0 1em;
|
42
42
|
padding: 1em;
|
43
43
|
background-color: #F7F7F7;
|
@@ -54,7 +54,7 @@
|
|
54
54
|
</style>
|
55
55
|
</head>
|
56
56
|
|
57
|
-
<body>
|
57
|
+
<body class="rails-default-error-page">
|
58
58
|
<!-- This file lives in public/422.html -->
|
59
59
|
<div class="dialog">
|
60
60
|
<div>
|