eivo-rails-api 0.1.6 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62d02567cabd6b9d7f1b42f1a38fb91a7424dd4232ce7f23b4d61d2f3dd1dbf2
4
- data.tar.gz: 3ca3c29c8b76195601bfa82789d29060a4f7885b755548e26a4fa792417c961b
3
+ metadata.gz: 85b110565817354fec9277b86b3934f2c8fca3b6b95643dd59ffc49446864c9e
4
+ data.tar.gz: 1a9866c9c44dc1cd23a5f034917ab00b0b946da5867b439c60d7aebb201ce807
5
5
  SHA512:
6
- metadata.gz: 65246e00f731520a75703101c8d7c3aacc35be29c938eb0a878653dd3bbe19723c688cf38d9a352418b3ac5593f70e5a09c08ad2f18d0569466e323fcfdbdacc
7
- data.tar.gz: de53b4c747f6e77e17bfa47d4fd4a15850522fe223dbb16d8c944326eb897d70b03ca2e48f55cb10c5cc1a659f12d53419e97d9122a58a3897f7936870b19367
6
+ metadata.gz: 4f5410a18221a5f98e9de1ff1fdc1600e69d4f299b5c231b2469de1b3f364ccd42f0d83bb910c08b3b4f5d0a63c4df96610923b4143c568fef095f9386da9598
7
+ data.tar.gz: 640968c7cc3ed44fb6d9f4675495a879c4239bd0e5025593a6cd206527bd27e7891880c248c7486f659f038b917223f439a45c7e215b23a3f30770a111e1f6aa
@@ -44,9 +44,6 @@ Naming/PredicateName:
44
44
  Naming/VariableNumber:
45
45
  EnforcedStyle: snake_case
46
46
 
47
- Style/BracesAroundHashParameters:
48
- EnforcedStyle: context_dependent
49
-
50
47
  Style/Documentation:
51
48
  Enabled: false
52
49
 
data/README.md CHANGED
@@ -37,10 +37,6 @@ sentry:
37
37
  dsn: ""
38
38
  ```
39
39
 
40
- ### Warning
41
-
42
- `force_ssl` option is not enabled, for performance reasons SSL / TLS should be managed by the web server (nginx, Apache).
43
-
44
40
  ## License
45
41
 
46
42
  This project is released under the MIT license. See the LICENSE file for more info.
@@ -52,9 +52,11 @@ module EIVO
52
52
  render_errors json_errors.flatten
53
53
  end
54
54
 
55
- def render_error(code, status: :bad_request, source: nil)
55
+ def render_error(code, status: :bad_request, title: nil, detail: nil, source: nil)
56
56
  render_errors([{
57
57
  code: code,
58
+ title: title,
59
+ detail: detail,
58
60
  source: source,
59
61
  status: ::Rack::Utils::SYMBOL_TO_STATUS_CODE[status].to_s
60
62
  }.compact], status: status)
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'lograge'
4
+
3
5
  if Rails.env.staging? || Rails.env.production?
4
6
  Rails.application.configure do
5
7
  config.colorize_logging = false
@@ -4,7 +4,7 @@ $LOAD_PATH.push File.expand_path('lib', __dir__)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'eivo-rails-api'
7
- spec.version = '0.1.6'
7
+ spec.version = '0.1.11'
8
8
  spec.authors = ['Jonathan VUKOVICH-TRIBOUHARET']
9
9
  spec.email = ['jonathan@eivo.co']
10
10
 
@@ -27,8 +27,8 @@ Gem::Specification.new do |spec|
27
27
 
28
28
  spec.add_dependency 'kaminari'
29
29
 
30
- spec.add_dependency 'sentry-raven'
31
30
  spec.add_dependency 'lograge'
31
+ spec.add_dependency 'sentry-raven'
32
32
 
33
33
  spec.add_development_dependency 'bundler'
34
34
  spec.add_development_dependency 'rake'
@@ -39,7 +39,7 @@ module EIVO
39
39
  # Highlight code that triggered database queries in logs.
40
40
  config.active_record.verbose_query_logs = true
41
41
 
42
- # Raises error for missing translations
42
+ # Raises error for missing translations.
43
43
  # config.action_view.raise_on_missing_translations = true
44
44
 
45
45
  # Use an evented file watcher to asynchronously detect changes in source code,
@@ -16,7 +16,7 @@ module EIVO
16
16
  config.eager_load = true
17
17
 
18
18
  # Full error reports are disabled and caching is turned on.
19
- config.consider_all_requests_local = false
19
+ config.consider_all_requests_local = false
20
20
 
21
21
  # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
22
22
  # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
@@ -31,10 +31,11 @@ module EIVO
31
31
 
32
32
  # Specifies the header that your server uses for sending files.
33
33
  # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
34
- config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
34
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
35
35
 
36
36
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
37
- # config.force_ssl = true
37
+ config.force_ssl = true
38
+ config.ssl_options = { redirect: { exclude: ->(request) { request.path == '/status' } } }
38
39
 
39
40
  # Use the lowest log level to ensure availability of diagnostic information
40
41
  # when problems arise.
@@ -46,7 +47,7 @@ module EIVO
46
47
  # Use a different cache store in production.
47
48
  # config.cache_store = :mem_cache_store
48
49
 
49
- # Use a real queuing backend for Active Job (and separate queues per environment)
50
+ # Use a real queuing backend for Active Job (and separate queues per environment).
50
51
  # config.active_job.queue_adapter = :resque
51
52
  # config.active_job.queue_name_prefix = "example_#{Rails.env}"
52
53
 
@@ -73,7 +74,7 @@ module EIVO
73
74
  logger = ActiveSupport::Logger.new(STDOUT)
74
75
  logger.formatter = config.log_formatter
75
76
  config.log_level = :info
76
- config.logger = logger
77
+ config.logger = logger
77
78
  end
78
79
 
79
80
  # Do not dump schema after migrations.
@@ -3,6 +3,10 @@
3
3
  module EIVO
4
4
  class Environment
5
5
  def self.test
6
+ # The test environment is used exclusively to run your application's
7
+ # test suite. You never need to work with it otherwise. Remember that
8
+ # your test database is "scratch space" for the test suite and is wiped
9
+ # and recreated between test runs. Don't rely on the data there!
6
10
  Rails.application.configure do
7
11
  # Settings specified here will take precedence over those in config/application.rb.
8
12
 
@@ -33,7 +37,7 @@ module EIVO
33
37
  # Print deprecation notices to the stderr.
34
38
  config.active_support.deprecation = :stderr
35
39
 
36
- # Raises error for missing translations
40
+ # Raises error for missing translations.
37
41
  # config.action_view.raise_on_missing_translations = true
38
42
  end
39
43
  end
@@ -3,9 +3,9 @@
3
3
  source 'https://rubygems.org'
4
4
  git_source(:github) { |repo| "https://github.com/#{repo}.git" }
5
5
 
6
- ruby '2.6.3'
6
+ ruby '2.7.1'
7
7
 
8
- gem 'rails', '~> 6.0.2', '>= 6.0.2.1'
8
+ gem 'rails', '~> 6.0.3', '>= 6.0.3.1'
9
9
  gem 'pg', '>= 0.18', '< 2.0'
10
10
  gem 'puma', '~> 4.1'
11
11
 
@@ -14,7 +14,7 @@ group :development, :test do
14
14
  end
15
15
 
16
16
  group :development do
17
- gem 'listen', '>= 3.0.5', '< 3.2'
17
+ gem 'listen', '~> 3.2'
18
18
  end
19
19
 
20
20
  gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- workers ENV.fetch('WEB_CONCURRENCY') { 0 }
4
- threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
3
+ workers ENV.fetch('WEB_CONCURRENCY') { 0 }.to_i
4
+ threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }.to_i
5
5
  threads threads_count, threads_count
6
6
 
7
7
  environment ENV.fetch('RAILS_ENV') { 'development' }
@@ -9,7 +9,7 @@ environment ENV.fetch('RAILS_ENV') { 'development' }
9
9
  if %w[production staging].include?(ENV['RAILS_ENV'])
10
10
  pidfile 'tmp/pids/puma.pid'
11
11
  state_path 'tmp/pids/puma.state'
12
- daemonize ENV.fetch('RAILS_DAEMONIZE') { false }
12
+ daemonize ActiveModel::Type::Boolean.new.cast(ENV.fetch('RAILS_DAEMONIZE') { false })
13
13
 
14
14
  if ENV['PORT']
15
15
  bind "tcp://0.0.0.0:#{ENV['PORT']}"
@@ -17,7 +17,7 @@ if %w[production staging].include?(ENV['RAILS_ENV'])
17
17
  bind 'unix://tmp/sockets/puma.sock'
18
18
  end
19
19
  else
20
- port ENV.fetch('PORT') { 3000 }
20
+ port ENV.fetch('PORT') { 3000 }.to_i
21
21
  end
22
22
 
23
23
  before_fork do
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.1.6
4
+ version: 0.1.11
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: 2020-05-01 00:00:00.000000000 Z
11
+ date: 2020-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: sentry-raven
84
+ name: lograge
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -95,7 +95,7 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: lograge
98
+ name: sentry-raven
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ">="