eivo-rails-api 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/eivo-rails-api.gemspec +1 -1
- data/lib/eivo-rails-api.rb +1 -1
- data/lib/eivo-rails-api/environments/development.rb +0 -2
- data/lib/eivo-rails-api/environments/production.rb +21 -1
- data/lib/eivo-rails-api/environments/test.rb +1 -4
- data/lib/generators/eivo/templates/Gemfile +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98ad3107efcdaa9f7dd2b381e5d20759c0131c462470a8ac725e3b0066031de6
|
4
|
+
data.tar.gz: 7bdf8d8fd29fea9f678b7a7a799c79a6f3172ef509e6b373da33db5c5ab6edf4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a52083cbacad9b1b93ccbccfb89824307cb79bf5ff96f43bffa8b84a359131f80ff2c492c667466950f6034c57204053815fe3fe27b7c89461c3c90391fb53e0
|
7
|
+
data.tar.gz: 1cc114c47766453289eec462818753167024e4bab02472aa13d1d9fe8e2a8d3163224d6b94691fe930d2ebea4227b7fd9976bd232694ecd859a50a20b8257e76
|
data/README.md
CHANGED
@@ -22,7 +22,7 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
If you don't have a Ruby On Rails project:
|
24
24
|
|
25
|
-
$ rails new ../example/ -d postgresql --skip-
|
25
|
+
$ rails new ../example/ -d postgresql --api --skip-action-mailer --skip-action-mailbox --skip-action-text --skip-active-storage --skip-action-cable --skip-sprockets --skip-spring --skip-javascript --skip-turbolinks --skip-test --skip-system-test --skip-bootsnap --skip-webpack-install
|
26
26
|
|
27
27
|
Then:
|
28
28
|
|
data/eivo-rails-api.gemspec
CHANGED
data/lib/eivo-rails-api.rb
CHANGED
@@ -13,7 +13,7 @@ require_relative 'eivo-rails-api/engine'
|
|
13
13
|
module EIVO
|
14
14
|
class << self
|
15
15
|
def configure(application)
|
16
|
-
application.config.load_defaults
|
16
|
+
application.config.load_defaults 6.0
|
17
17
|
application.config.api_only = true
|
18
18
|
|
19
19
|
application.config.require_master_key = true
|
@@ -20,8 +20,6 @@ module EIVO
|
|
20
20
|
# Enable/disable caching. By default caching is disabled.
|
21
21
|
# Run rails dev:cache to toggle caching.
|
22
22
|
if Rails.root.join('tmp', 'caching-dev.txt').exist?
|
23
|
-
config.action_controller.perform_caching = true
|
24
|
-
|
25
23
|
config.cache_store = :memory_store
|
26
24
|
config.public_file_server.headers = {
|
27
25
|
'Cache-Control' => "public, max-age=#{2.days.to_i}"
|
@@ -17,7 +17,6 @@ module EIVO
|
|
17
17
|
|
18
18
|
# Full error reports are disabled and caching is turned on.
|
19
19
|
config.consider_all_requests_local = false
|
20
|
-
config.action_controller.perform_caching = true
|
21
20
|
|
22
21
|
# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
|
23
22
|
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
|
@@ -73,6 +72,27 @@ module EIVO
|
|
73
72
|
|
74
73
|
# Do not dump schema after migrations.
|
75
74
|
config.active_record.dump_schema_after_migration = false
|
75
|
+
|
76
|
+
# Inserts middleware to perform automatic connection switching.
|
77
|
+
# The `database_selector` hash is used to pass options to the DatabaseSelector
|
78
|
+
# middleware. The `delay` is used to determine how long to wait after a write
|
79
|
+
# to send a subsequent read to the primary.
|
80
|
+
#
|
81
|
+
# The `database_resolver` class is used by the middleware to determine which
|
82
|
+
# database is appropriate to use based on the time delay.
|
83
|
+
#
|
84
|
+
# The `database_resolver_context` class is used by the middleware to set
|
85
|
+
# timestamps for the last write to the primary. The resolver uses the context
|
86
|
+
# class timestamps to determine how long to wait before reading from the
|
87
|
+
# replica.
|
88
|
+
#
|
89
|
+
# By default Rails will store a last write timestamp in the session. The
|
90
|
+
# DatabaseSelector middleware is designed as such you can define your own
|
91
|
+
# strategy for connection switching and pass that into the middleware through
|
92
|
+
# these configuration options.
|
93
|
+
# config.active_record.database_selector = { delay: 2.seconds }
|
94
|
+
# config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
|
95
|
+
# config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
|
76
96
|
end
|
77
97
|
end
|
78
98
|
end
|
@@ -6,10 +6,6 @@ module EIVO
|
|
6
6
|
Rails.application.configure do
|
7
7
|
# Settings specified here will take precedence over those in config/application.rb.
|
8
8
|
|
9
|
-
# The test environment is used exclusively to run your application's
|
10
|
-
# test suite. You never need to work with it otherwise. Remember that
|
11
|
-
# your test database is "scratch space" for the test suite and is wiped
|
12
|
-
# and recreated between test runs. Don't rely on the data there!
|
13
9
|
config.cache_classes = true
|
14
10
|
|
15
11
|
# Do not eager load code on boot. This avoids loading your whole application
|
@@ -26,6 +22,7 @@ module EIVO
|
|
26
22
|
# Show full error reports and disable caching.
|
27
23
|
config.consider_all_requests_local = true
|
28
24
|
config.action_controller.perform_caching = false
|
25
|
+
config.cache_store = :null_store
|
29
26
|
|
30
27
|
# Raise exceptions instead of rendering exception templates.
|
31
28
|
config.action_dispatch.show_exceptions = false
|
@@ -5,9 +5,9 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
|
5
5
|
|
6
6
|
ruby '2.6.3'
|
7
7
|
|
8
|
-
gem 'rails', '~>
|
8
|
+
gem 'rails', '~> 6.0.2', '>= 6.0.2.1'
|
9
9
|
gem 'pg', '>= 0.18', '< 2.0'
|
10
|
-
gem 'puma', '~>
|
10
|
+
gem 'puma', '~> 4.1'
|
11
11
|
|
12
12
|
group :development, :test do
|
13
13
|
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eivo-rails-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan VUKOVICH-TRIBOUHARET
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -216,7 +216,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
216
216
|
- !ruby/object:Gem::Version
|
217
217
|
version: '0'
|
218
218
|
requirements: []
|
219
|
-
rubygems_version: 3.0.
|
219
|
+
rubygems_version: 3.0.6
|
220
220
|
signing_key:
|
221
221
|
specification_version: 4
|
222
222
|
summary: EIVO Rails API
|