lite-regulations 1.1.0 → 1.1.1

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: 50614563a4ce1e9b8fa5dd7d6b6a48d6adfb09945274d90d004ff1bba75de5e3
4
- data.tar.gz: f57f1fcef110593d34b604b2dea323bb22fba8668f8d7452fbb914b3394a45a2
3
+ metadata.gz: 6acbbef86579433a77664ff0bcd047b9425afbce5883b676b3bad427d24b9c87
4
+ data.tar.gz: e77daf09160432da89a91c178a7bffb340c3e1e096fb453c2f8eb4c3f53074db
5
5
  SHA512:
6
- metadata.gz: 1d0e5e82075d337820371f622daf347111ab11ef6a0206fa1cbbe1aab53f379a21eb1be2882d7d3b00db036b4d74014f256eb74b9b22b948fd92be61e14fab6f
7
- data.tar.gz: a5b6ce8d9da619896eebfc8d7380095f054009a1cd2d8f1bc44205d4d5278b99b9a0c02791ee35796ce7468cf92bb058a2e2740374f3a02678fa1c50fceb4375
6
+ metadata.gz: 58dcf0493ba2cb0448bdd06910fb099a77bb9dee27a1ad81fb6471e1d2072dbc75b4f61e73816a14e4aa5c78e9c763566d7fb9dd448a2dd8942370f967e0718e
7
+ data.tar.gz: ba0d5cac1e383674a0b7b4910d5e9bfa796356c29ab393cacd7488dabe65b71fb33a92b98d1af85f7f499df31a29bc538287c22fc0bbc70f858c4e6b5c467214
data/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.1.1] - 2021-07-21
10
+ ### Changed
11
+ - Improved Railtie support
12
+
9
13
  ## [1.1.0] - 2021-07-19
10
14
  ### Added
11
15
  - Added Ruby 3.0 support
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lite-regulations (1.1.0)
4
+ lite-regulations (1.1.1)
5
5
  activerecord
6
6
  activesupport
7
7
 
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'active_record'
4
- require 'active_support'
3
+ require 'active_record' unless defined?(ActiveRecord)
4
+ require 'active_support' unless defined?(ActiveSupport)
5
5
 
6
+ require 'lite/regulations/railtie' if defined?(Rails::Railtie)
6
7
  require 'lite/regulations/version'
7
- require 'lite/regulations/railtie' if defined?(Rails)
8
8
 
9
9
  %w[base activation containment expiration quarantine suspension visibility].each do |name|
10
10
  require "lite/regulations/#{name}"
File without changes
@@ -1,20 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rails/railtie'
4
-
5
3
  module Lite
6
4
  module Regulations
7
- class Railtie < ::Rails::Railtie
5
+ class Railtie < Rails::Railtie
8
6
 
9
- initializer 'lite-regulations' do |app|
10
- Lite::Regulations::Railtie.instance_eval do
11
- [app.config.i18n.available_locales].flatten.each do |locale|
12
- path = File.expand_path("../../../config/locales/#{locale}.yml", __FILE__)
13
- next if !File.file?(path) || I18n.load_path.include?(path)
7
+ initializer 'lite-regulations.configure_locales' do |app|
8
+ Array(app.config.i18n.available_locales).each do |locale|
9
+ path = File.expand_path("../locales/#{locale}.yml", __FILE__)
10
+ next unless File.file?(path)
14
11
 
15
- I18n.load_path << path
16
- end
12
+ I18n.load_path << path
17
13
  end
14
+
15
+ I18n.reload!
18
16
  end
19
17
 
20
18
  end
@@ -3,7 +3,7 @@
3
3
  module Lite
4
4
  module Regulations
5
5
 
6
- VERSION = '1.1.0'
6
+ VERSION = '1.1.1'
7
7
 
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lite-regulations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-20 00:00:00.000000000 Z
11
+ date: 2021-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -215,7 +215,6 @@ files:
215
215
  - _config.yml
216
216
  - bin/console
217
217
  - bin/setup
218
- - config/locales/en.yml
219
218
  - docs/ACTIVATION.md
220
219
  - docs/CONTAINMENT.md
221
220
  - docs/EXPIRATION.md
@@ -227,6 +226,7 @@ files:
227
226
  - lib/lite/regulations/base.rb
228
227
  - lib/lite/regulations/containment.rb
229
228
  - lib/lite/regulations/expiration.rb
229
+ - lib/lite/regulations/locales/en.yml
230
230
  - lib/lite/regulations/quarantine.rb
231
231
  - lib/lite/regulations/railtie.rb
232
232
  - lib/lite/regulations/suspension.rb