torba-rails 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.travis.yml +4 -0
- data/.yardopts +3 -0
- data/CHANGELOG.md +1 -0
- data/CONTRIBUTING.md +48 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +22 -0
- data/README.md +81 -0
- data/Rakefile +26 -0
- data/lib/torba/rails.rb +29 -0
- data/lib/torba-rails.rb +1 -0
- data/test/3.2/Gemfile +12 -0
- data/test/3.2/Gemfile.lock +116 -0
- data/test/3.2/Rakefile +7 -0
- data/test/3.2/Torbafile +8 -0
- data/test/3.2/app/assets/javascripts/application.js +2 -0
- data/test/3.2/app/assets/stylesheets/application.scss +6 -0
- data/test/3.2/app/controllers/application_controller.rb +3 -0
- data/test/3.2/app/helpers/application_helper.rb +2 -0
- data/test/3.2/app/views/layouts/application.html.erb +14 -0
- data/test/3.2/bin/rails +6 -0
- data/test/3.2/config/application.rb +62 -0
- data/test/3.2/config/boot.rb +6 -0
- data/test/3.2/config/environment.rb +5 -0
- data/test/3.2/config/environments/development.rb +27 -0
- data/test/3.2/config/environments/production.rb +64 -0
- data/test/3.2/config/environments/test.rb +29 -0
- data/test/3.2/config/initializers/backtrace_silencers.rb +7 -0
- data/test/3.2/config/initializers/secret_token.rb +7 -0
- data/test/3.2/config/initializers/wrap_parameters.rb +10 -0
- data/test/3.2/config/locales/en.yml +5 -0
- data/test/3.2/config/routes.rb +58 -0
- data/test/3.2/config.ru +4 -0
- data/test/3.2/script/rails +6 -0
- data/test/4.2/Gemfile +6 -0
- data/test/4.2/Gemfile.lock +128 -0
- data/test/4.2/Rakefile +6 -0
- data/test/4.2/Torbafile +8 -0
- data/test/4.2/app/assets/javascripts/application.js +2 -0
- data/test/4.2/app/assets/stylesheets/application.scss +6 -0
- data/test/4.2/app/controllers/application_controller.rb +5 -0
- data/test/4.2/app/helpers/application_helper.rb +2 -0
- data/test/4.2/app/views/layouts/application.html.erb +13 -0
- data/test/4.2/bin/rails +4 -0
- data/test/4.2/config/application.rb +25 -0
- data/test/4.2/config/boot.rb +3 -0
- data/test/4.2/config/environment.rb +5 -0
- data/test/4.2/config/environments/development.rb +35 -0
- data/test/4.2/config/environments/production.rb +76 -0
- data/test/4.2/config/environments/test.rb +37 -0
- data/test/4.2/config/initializers/assets.rb +11 -0
- data/test/4.2/config/initializers/cookies_serializer.rb +3 -0
- data/test/4.2/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/4.2/config/initializers/session_store.rb +3 -0
- data/test/4.2/config/initializers/wrap_parameters.rb +9 -0
- data/test/4.2/config/locales/en.yml +23 -0
- data/test/4.2/config/routes.rb +56 -0
- data/test/4.2/config/secrets.yml +22 -0
- data/test/4.2/config.ru +4 -0
- data/test/5.0/Gemfile +6 -0
- data/test/5.0/Gemfile.lock +138 -0
- data/test/5.0/Rakefile +6 -0
- data/test/5.0/Torbafile +8 -0
- data/test/5.0/app/assets/javascripts/application.js +2 -0
- data/test/5.0/app/assets/stylesheets/application.scss +6 -0
- data/test/5.0/app/controllers/application_controller.rb +5 -0
- data/test/5.0/app/helpers/application_helper.rb +2 -0
- data/test/5.0/app/views/layouts/application.html.erb +13 -0
- data/test/5.0/bin/rails +4 -0
- data/test/5.0/config/application.rb +17 -0
- data/test/5.0/config/boot.rb +3 -0
- data/test/5.0/config/cable.yml +10 -0
- data/test/5.0/config/environment.rb +5 -0
- data/test/5.0/config/environments/development.rb +52 -0
- data/test/5.0/config/environments/production.rb +79 -0
- data/test/5.0/config/environments/test.rb +36 -0
- data/test/5.0/config/initializers/assets.rb +11 -0
- data/test/5.0/config/initializers/cookies_serializer.rb +5 -0
- data/test/5.0/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/5.0/config/initializers/per_form_csrf_tokens.rb +4 -0
- data/test/5.0/config/initializers/request_forgery_protection.rb +4 -0
- data/test/5.0/config/initializers/session_store.rb +3 -0
- data/test/5.0/config/initializers/wrap_parameters.rb +14 -0
- data/test/5.0/config/locales/en.yml +23 -0
- data/test/5.0/config/puma.rb +47 -0
- data/test/5.0/config/routes.rb +6 -0
- data/test/5.0/config/secrets.yml +22 -0
- data/test/5.0/config.ru +4 -0
- data/test/5.0/db/seeds.rb +7 -0
- data/test/Torbafile +8 -0
- data/test/acceptance_test.rb +68 -0
- data/test/application.js +2 -0
- data/test/application.scss +6 -0
- data/test/compiled_assets/3.2/application-32cc93d3c658f24842cdb4028d7f6a6a.js +1 -0
- data/test/compiled_assets/3.2/application-406b208e73b83fe37135274c5157c8e3.css +1 -0
- data/test/compiled_assets/3.2/trumbowyg/icons-0b2826fbd974348c269c2b8017a14314.png +0 -0
- data/test/compiled_assets/3.2/trumbowyg/icons-2x-cc69d8bc62651602e75c2f7097cf5187.png +0 -0
- data/test/compiled_assets/4.2+/application-7cdb22c682ee9bf44774492034be6952becd2c75184c101017152af1476b12a8.css +1 -0
- data/test/compiled_assets/4.2+/application-c7e50f0b91ececdd620e1c86789b65677d9bbe0f35ab4717a9a522e6c89a56f9.js +1 -0
- data/test/compiled_assets/4.2+/trumbowyg/icons-2x-39fe92cd396082eb94f0c92103537209ba97ffa3079377bbe55fea857abe5341.png +0 -0
- data/test/compiled_assets/4.2+/trumbowyg/icons-efc940454e4e764063875def5c909a2f9c8b2c4d2a41c6a98dc41fb111868f1f.png +0 -0
- data/test/test_helper.rb +35 -0
- data/torba-rails.gemspec +23 -0
- metadata +323 -0
@@ -0,0 +1,138 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../..
|
3
|
+
specs:
|
4
|
+
torba-rails (1.0.0)
|
5
|
+
railties (>= 3.2)
|
6
|
+
torba (~> 1.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actioncable (5.0.0.beta3)
|
12
|
+
actionpack (= 5.0.0.beta3)
|
13
|
+
nio4r (~> 1.2)
|
14
|
+
websocket-driver (~> 0.6.1)
|
15
|
+
actionmailer (5.0.0.beta3)
|
16
|
+
actionpack (= 5.0.0.beta3)
|
17
|
+
actionview (= 5.0.0.beta3)
|
18
|
+
activejob (= 5.0.0.beta3)
|
19
|
+
mail (~> 2.5, >= 2.5.4)
|
20
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
21
|
+
actionpack (5.0.0.beta3)
|
22
|
+
actionview (= 5.0.0.beta3)
|
23
|
+
activesupport (= 5.0.0.beta3)
|
24
|
+
rack (~> 2.x)
|
25
|
+
rack-test (~> 0.6.3)
|
26
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
27
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
28
|
+
actionview (5.0.0.beta3)
|
29
|
+
activesupport (= 5.0.0.beta3)
|
30
|
+
builder (~> 3.1)
|
31
|
+
erubis (~> 2.7.0)
|
32
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
33
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
34
|
+
activejob (5.0.0.beta3)
|
35
|
+
activesupport (= 5.0.0.beta3)
|
36
|
+
globalid (>= 0.3.6)
|
37
|
+
activemodel (5.0.0.beta3)
|
38
|
+
activesupport (= 5.0.0.beta3)
|
39
|
+
activerecord (5.0.0.beta3)
|
40
|
+
activemodel (= 5.0.0.beta3)
|
41
|
+
activesupport (= 5.0.0.beta3)
|
42
|
+
arel (~> 7.0)
|
43
|
+
activesupport (5.0.0.beta3)
|
44
|
+
concurrent-ruby (~> 1.0)
|
45
|
+
i18n (~> 0.7)
|
46
|
+
minitest (~> 5.1)
|
47
|
+
tzinfo (~> 1.1)
|
48
|
+
arel (7.0.0)
|
49
|
+
builder (3.2.2)
|
50
|
+
concurrent-ruby (1.0.1)
|
51
|
+
erubis (2.7.0)
|
52
|
+
execjs (2.6.0)
|
53
|
+
globalid (0.3.6)
|
54
|
+
activesupport (>= 4.1.0)
|
55
|
+
i18n (0.7.0)
|
56
|
+
json (1.8.3)
|
57
|
+
loofah (2.0.3)
|
58
|
+
nokogiri (>= 1.5.9)
|
59
|
+
mail (2.6.4)
|
60
|
+
mime-types (>= 1.16, < 4)
|
61
|
+
method_source (0.8.2)
|
62
|
+
mime-types (3.0)
|
63
|
+
mime-types-data (~> 3.2015)
|
64
|
+
mime-types-data (3.2016.0221)
|
65
|
+
mini_portile2 (2.0.0)
|
66
|
+
minitest (5.8.4)
|
67
|
+
nio4r (1.2.1)
|
68
|
+
nokogiri (1.6.7.2)
|
69
|
+
mini_portile2 (~> 2.0.0.rc2)
|
70
|
+
rack (2.0.0.alpha)
|
71
|
+
json
|
72
|
+
rack-test (0.6.3)
|
73
|
+
rack (>= 1.0)
|
74
|
+
rails (5.0.0.beta3)
|
75
|
+
actioncable (= 5.0.0.beta3)
|
76
|
+
actionmailer (= 5.0.0.beta3)
|
77
|
+
actionpack (= 5.0.0.beta3)
|
78
|
+
actionview (= 5.0.0.beta3)
|
79
|
+
activejob (= 5.0.0.beta3)
|
80
|
+
activemodel (= 5.0.0.beta3)
|
81
|
+
activerecord (= 5.0.0.beta3)
|
82
|
+
activesupport (= 5.0.0.beta3)
|
83
|
+
bundler (>= 1.3.0, < 2.0)
|
84
|
+
railties (= 5.0.0.beta3)
|
85
|
+
sprockets-rails (>= 2.0.0)
|
86
|
+
rails-deprecated_sanitizer (1.0.3)
|
87
|
+
activesupport (>= 4.2.0.alpha)
|
88
|
+
rails-dom-testing (1.0.7)
|
89
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
90
|
+
nokogiri (~> 1.6.0)
|
91
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
92
|
+
rails-html-sanitizer (1.0.3)
|
93
|
+
loofah (~> 2.0)
|
94
|
+
railties (5.0.0.beta3)
|
95
|
+
actionpack (= 5.0.0.beta3)
|
96
|
+
activesupport (= 5.0.0.beta3)
|
97
|
+
method_source
|
98
|
+
rake (>= 0.8.7)
|
99
|
+
thor (>= 0.18.1, < 2.0)
|
100
|
+
rake (11.1.2)
|
101
|
+
sass (3.4.22)
|
102
|
+
sass-rails (5.0.4)
|
103
|
+
railties (>= 4.0.0, < 5.0)
|
104
|
+
sass (~> 3.1)
|
105
|
+
sprockets (>= 2.8, < 4.0)
|
106
|
+
sprockets-rails (>= 2.0, < 4.0)
|
107
|
+
tilt (>= 1.1, < 3)
|
108
|
+
sprockets (3.6.0)
|
109
|
+
concurrent-ruby (~> 1.0)
|
110
|
+
rack (> 1, < 3)
|
111
|
+
sprockets-rails (3.0.4)
|
112
|
+
actionpack (>= 4.0)
|
113
|
+
activesupport (>= 4.0)
|
114
|
+
sprockets (>= 3.0.0)
|
115
|
+
thor (0.19.1)
|
116
|
+
thread_safe (0.3.5)
|
117
|
+
tilt (2.0.2)
|
118
|
+
torba (1.0.0)
|
119
|
+
thor (~> 0.19.1)
|
120
|
+
tzinfo (1.2.2)
|
121
|
+
thread_safe (~> 0.1)
|
122
|
+
uglifier (3.0.0)
|
123
|
+
execjs (>= 0.3.0, < 3)
|
124
|
+
websocket-driver (0.6.3)
|
125
|
+
websocket-extensions (>= 0.1.0)
|
126
|
+
websocket-extensions (0.1.2)
|
127
|
+
|
128
|
+
PLATFORMS
|
129
|
+
ruby
|
130
|
+
|
131
|
+
DEPENDENCIES
|
132
|
+
rails (= 5.0.0.beta3)
|
133
|
+
sass-rails (~> 5.0)
|
134
|
+
torba-rails!
|
135
|
+
uglifier (>= 1.3.0)
|
136
|
+
|
137
|
+
BUNDLED WITH
|
138
|
+
1.10.6
|
data/test/5.0/Rakefile
ADDED
data/test/5.0/Torbafile
ADDED
data/test/5.0/bin/rails
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require "rails"
|
4
|
+
require "action_controller/railtie"
|
5
|
+
require "sprockets/railtie"
|
6
|
+
|
7
|
+
# Require the gems listed in Gemfile, including any gems
|
8
|
+
# you've limited to :test, :development, or :production.
|
9
|
+
Bundler.require(*Rails.groups)
|
10
|
+
|
11
|
+
module TorbaTest
|
12
|
+
class Application < Rails::Application
|
13
|
+
# Settings in config/environments/* take precedence over those specified here.
|
14
|
+
# Application configuration should go into files in config/initializers
|
15
|
+
# -- all .rb files in that directory are automatically loaded.
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
Rails.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 web server when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
|
+
|
12
|
+
# Show full error reports.
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
|
15
|
+
# Enable/disable caching. By default caching is disabled.
|
16
|
+
if Rails.root.join('tmp/caching-dev.txt').exist?
|
17
|
+
config.action_controller.perform_caching = true
|
18
|
+
|
19
|
+
config.cache_store = :memory_store
|
20
|
+
config.public_file_server.headers = {
|
21
|
+
'Cache-Control' => 'public, max-age=172800'
|
22
|
+
}
|
23
|
+
else
|
24
|
+
config.action_controller.perform_caching = false
|
25
|
+
|
26
|
+
config.cache_store = :null_store
|
27
|
+
end
|
28
|
+
|
29
|
+
# Print deprecation notices to the Rails logger.
|
30
|
+
config.active_support.deprecation = :log
|
31
|
+
|
32
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
33
|
+
# This option may cause significant delays in view rendering with a large
|
34
|
+
# number of complex assets.
|
35
|
+
config.assets.debug = true
|
36
|
+
|
37
|
+
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
38
|
+
# yet still be able to expire them through the digest params.
|
39
|
+
config.assets.digest = true
|
40
|
+
|
41
|
+
# Adds additional error checking when serving assets at runtime.
|
42
|
+
# Checks for improperly declared sprockets dependencies.
|
43
|
+
# Raises helpful error messages.
|
44
|
+
config.assets.raise_runtime_errors = true
|
45
|
+
|
46
|
+
# Raises error for missing translations
|
47
|
+
# config.action_view.raise_on_missing_translations = true
|
48
|
+
|
49
|
+
# Use an evented file watcher to asynchronously detect changes in source code,
|
50
|
+
# routes, locales, etc. This feature depends on the listen gem.
|
51
|
+
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
52
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# Code is not reloaded between requests.
|
5
|
+
config.cache_classes = true
|
6
|
+
|
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.
|
14
|
+
config.consider_all_requests_local = false
|
15
|
+
config.action_controller.perform_caching = true
|
16
|
+
|
17
|
+
# Disable serving static files from the `/public` folder by default since
|
18
|
+
# Apache or NGINX already handles this.
|
19
|
+
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
20
|
+
|
21
|
+
# Compress JavaScripts and CSS.
|
22
|
+
config.assets.js_compressor = :uglifier
|
23
|
+
# config.assets.css_compressor = :sass
|
24
|
+
|
25
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
26
|
+
config.assets.compile = false
|
27
|
+
|
28
|
+
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
29
|
+
# yet still be able to expire them through the digest params.
|
30
|
+
config.assets.digest = true
|
31
|
+
|
32
|
+
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
33
|
+
|
34
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
35
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
36
|
+
|
37
|
+
# Specifies the header that your server uses for sending files.
|
38
|
+
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
39
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
40
|
+
|
41
|
+
# Action Cable endpoint configuration
|
42
|
+
# config.action_cable.url = 'wss://example.com/cable'
|
43
|
+
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
|
44
|
+
|
45
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
46
|
+
# config.force_ssl = true
|
47
|
+
|
48
|
+
# Use the lowest log level to ensure availability of diagnostic information
|
49
|
+
# when problems arise.
|
50
|
+
config.log_level = :debug
|
51
|
+
|
52
|
+
# Prepend all log lines with the following tags.
|
53
|
+
config.log_tags = [ :request_id ]
|
54
|
+
|
55
|
+
# Use a different logger for distributed setups.
|
56
|
+
# require 'syslog/logger'
|
57
|
+
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
58
|
+
|
59
|
+
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
60
|
+
config.logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT))
|
61
|
+
end
|
62
|
+
|
63
|
+
# Use a different cache store in production.
|
64
|
+
# config.cache_store = :mem_cache_store
|
65
|
+
|
66
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
67
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
68
|
+
# config.action_mailer.raise_delivery_errors = false
|
69
|
+
|
70
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
71
|
+
# the I18n.default_locale when a translation cannot be found).
|
72
|
+
config.i18n.fallbacks = true
|
73
|
+
|
74
|
+
# Send deprecation notices to registered listeners.
|
75
|
+
config.active_support.deprecation = :notify
|
76
|
+
|
77
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
78
|
+
config.log_formatter = ::Logger::Formatter.new
|
79
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
Rails.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
|
+
# 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
|
14
|
+
|
15
|
+
# Configure public file server for tests with Cache-Control for performance.
|
16
|
+
config.public_file_server.enabled = true
|
17
|
+
config.public_file_server.headers = {
|
18
|
+
'Cache-Control' => 'public, max-age=3600'
|
19
|
+
}
|
20
|
+
|
21
|
+
# Show full error reports and disable caching.
|
22
|
+
config.consider_all_requests_local = true
|
23
|
+
config.action_controller.perform_caching = false
|
24
|
+
|
25
|
+
# Raise exceptions instead of rendering exception templates.
|
26
|
+
config.action_dispatch.show_exceptions = false
|
27
|
+
|
28
|
+
# Disable request forgery protection in test environment.
|
29
|
+
config.action_controller.allow_forgery_protection = false
|
30
|
+
|
31
|
+
# Print deprecation notices to the stderr.
|
32
|
+
config.active_support.deprecation = :stderr
|
33
|
+
|
34
|
+
# Raises error for missing translations
|
35
|
+
# config.action_view.raise_on_missing_translations = true
|
36
|
+
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,14 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
+
# is enabled by default.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
8
|
+
wrap_parameters format: [:json]
|
9
|
+
end
|
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
|
@@ -0,0 +1,23 @@
|
|
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.
|
21
|
+
|
22
|
+
en:
|
23
|
+
hello: "Hello world"
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# Puma can serve each request in a thread from an internal thread pool.
|
2
|
+
# The `threads` method setting takes two numbers a minimum and maximum.
|
3
|
+
# Any libraries that use thread pools should be configured to match
|
4
|
+
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
5
|
+
# and maximum, this matches the default thread size of Active Record.
|
6
|
+
#
|
7
|
+
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
|
8
|
+
threads threads_count, threads_count
|
9
|
+
|
10
|
+
# Specifies the `port` that Puma will listen on to receive requests, default is 3000.
|
11
|
+
#
|
12
|
+
port ENV.fetch("PORT") { 3000 }
|
13
|
+
|
14
|
+
# Specifies the `environment` that Puma will run in.
|
15
|
+
#
|
16
|
+
environment ENV.fetch("RAILS_ENV") { "development" }
|
17
|
+
|
18
|
+
# Specifies the number of `workers` to boot in clustered mode.
|
19
|
+
# Workers are forked webserver processes. If using threads and workers together
|
20
|
+
# the concurrency of the application would be max `threads` * `workers`.
|
21
|
+
# Workers do not work on JRuby or Windows (both of which do not support
|
22
|
+
# processes).
|
23
|
+
#
|
24
|
+
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
|
25
|
+
|
26
|
+
# Use the `preload_app!` method when specifying a `workers` number.
|
27
|
+
# This directive tells Puma to first boot the application and load code
|
28
|
+
# before forking the application. This takes advantage of Copy On Write
|
29
|
+
# process behavior so workers use less memory. If you use this option
|
30
|
+
# you need to make sure to reconnect any threads in the `on_worker_boot`
|
31
|
+
# block.
|
32
|
+
#
|
33
|
+
# preload_app!
|
34
|
+
|
35
|
+
# The code in the `on_worker_boot` will be called if you are using
|
36
|
+
# clustered mode by specifying a number of `workers`. After each worker
|
37
|
+
# process is booted this block will be run, if you are using `preload_app!`
|
38
|
+
# option you will want to use this block to reconnect to any threads
|
39
|
+
# or connections that may have been created at application boot, Ruby
|
40
|
+
# cannot share connections between processes.
|
41
|
+
#
|
42
|
+
# on_worker_boot do
|
43
|
+
# ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
|
44
|
+
# end
|
45
|
+
|
46
|
+
# Allow puma to be restarted by `rails restart` command.
|
47
|
+
plugin :tmp_restart
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key is used for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
|
6
|
+
# Make sure the secret is at least 30 characters and all random,
|
7
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
8
|
+
# You can use `rake secret` to generate a secure secret key.
|
9
|
+
|
10
|
+
# Make sure the secrets in this file are kept private
|
11
|
+
# if you're sharing your code publicly.
|
12
|
+
|
13
|
+
development:
|
14
|
+
secret_key_base: 3c3d4f90a7f43a6ff4aa84bbc404d6d0294e494046c4b310714de80aac2dbcaa6c2b11e83821e3216442c318fc3c2b83d1090a558fc878488efd4c67a6551195
|
15
|
+
|
16
|
+
test:
|
17
|
+
secret_key_base: 5a3daec7e70d5b20a8f7385a1d2bee36951ade36ef335dcb4513b7b4172a58f9e355719edcbdd04aa1be24a324753f45ca49920f25d5e883554ca3ebdb5a5730
|
18
|
+
|
19
|
+
# Do not keep production secrets in the repository,
|
20
|
+
# instead read values from the environment.
|
21
|
+
production:
|
22
|
+
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
data/test/5.0/config.ru
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
# This file should contain all the record creation needed to seed the database with its default values.
|
2
|
+
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
|
3
|
+
#
|
4
|
+
# Examples:
|
5
|
+
#
|
6
|
+
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
|
7
|
+
# Mayor.create(name: 'Emanuel', city: cities.first)
|
data/test/Torbafile
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
require "open3"
|
3
|
+
|
4
|
+
module Torba
|
5
|
+
class RailsTest < Minitest::Test
|
6
|
+
def test_verify_runs_in_dev_with_default_settings
|
7
|
+
out, err, status = run_project_cmd(%{bin/rails runner 'puts "hello"'})
|
8
|
+
refute status.success?, out
|
9
|
+
assert_includes err, "Torba::Errors::MissingPackages"
|
10
|
+
|
11
|
+
out, err, status = run_project_cmd(%{bundle exec torba pack})
|
12
|
+
assert status.success?, err
|
13
|
+
assert_includes out, "Torba has been packed!"
|
14
|
+
|
15
|
+
out, err, status = run_project_cmd(%{bin/rails runner 'puts "hello"'})
|
16
|
+
assert status.success?, err
|
17
|
+
assert_includes out, "hello"
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_verify_runs_in_test_with_default_settings
|
21
|
+
out, err, status = run_project_cmd(%{bin/rails runner 'puts "hello"'}, "RAILS_ENV" => "test")
|
22
|
+
refute status.success?, out
|
23
|
+
assert_includes err, "Torba::Errors::MissingPackages"
|
24
|
+
|
25
|
+
out, err, status = run_project_cmd(%{bundle exec torba pack})
|
26
|
+
assert status.success?, err
|
27
|
+
assert_includes out, "Torba has been packed!"
|
28
|
+
|
29
|
+
out, err, status = run_project_cmd(%{bin/rails runner 'puts "hello"'}, "RAILS_ENV" => "test")
|
30
|
+
assert status.success?, err
|
31
|
+
assert_includes out, "hello"
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_verify_is_skipped_in_production_with_default_settings
|
35
|
+
out, err, status = run_project_cmd(%{bin/rails runner 'puts "hello"'}, "RAILS_ENV" => "production")
|
36
|
+
assert status.success?, err
|
37
|
+
assert_equal out, "hello\n"
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_assets_precompile
|
41
|
+
out, err, status = run_project_cmd(%{bundle exec rake assets:precompile}, "RAILS_ENV" => "production")
|
42
|
+
assert status.success?, err
|
43
|
+
assets_version = (rails_version == "3.2") ? "3.2" : "4.2+"
|
44
|
+
assert_dir_included "test/compiled_assets/#{assets_version}", "test/#{rails_version}/public/assets"
|
45
|
+
end
|
46
|
+
|
47
|
+
def rails_version
|
48
|
+
ENV["RAILS_VERSION"] || "4.2"
|
49
|
+
end
|
50
|
+
|
51
|
+
def in_project_dir(&blk)
|
52
|
+
Dir.chdir("test/#{rails_version}", &blk)
|
53
|
+
end
|
54
|
+
|
55
|
+
def run_project_cmd(cmd, env = {})
|
56
|
+
default_env = {
|
57
|
+
"BUNDLE_GEMFILE" => nil,
|
58
|
+
"TORBA_HOME_PATH" => torba_tmp_dir,
|
59
|
+
"TORBA_CACHE_PATH" => Test::TmpDir.persistent
|
60
|
+
}
|
61
|
+
env = default_env.merge(env)
|
62
|
+
|
63
|
+
in_project_dir do
|
64
|
+
Open3.capture3(env, cmd)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
data/test/application.js
ADDED