rails-env 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e00ec34d2254078e3667c53a347d45fad7dcec20bdbcfd0f059cfaaff238c845
4
- data.tar.gz: 899f3078f18680bd4f854edff0026ff47a31696022a387fd590d366e2eac460e
3
+ metadata.gz: ce003b00f171ed3cf0d04345adfaf1cde619fd0e99cbc913ca57015344c4686b
4
+ data.tar.gz: 2532b5358fbeb054778349e852baba9a8689de98339813038fb4cbe192dff6b5
5
5
  SHA512:
6
- metadata.gz: e1c11390634eb183f2fa38e87c9b5f395484691bf7bd4cbbea6b0715eda5f531ba0c4c963e9934c3a7b4d376a8259e3ff927595323ebf3c78553f9965c3157be
7
- data.tar.gz: 4a4f99bdab25e0a9b02cc588350d81ab6ea877da83531438f369ca0e2a94d10a55a0e10eec9892ede28a785a819190850f0153a0dd9c024ec44b0c98235dc061
6
+ metadata.gz: 0e18cd47c8f8637dc39235043bd83e13861d5585cddfb86ba3dc13934ed9de10739dbb27fb40f3e140d2e312c6e04570c25513716a1793284a55454b43d76590
7
+ data.tar.gz: 77a8797ca01accd1302f6866c1253915450a6b14f52284101e67590750b7928bb397beb555abae2bdb1a230504f04ec15bec226baa62947154614143ba8416f5
@@ -18,6 +18,7 @@ jobs:
18
18
  gemfile:
19
19
  - Gemfile
20
20
  - gemfiles/rails_7_0.gemfile
21
+ - gemfiles/rails_6_1.gemfile
21
22
  - gemfiles/rails_6_0.gemfile
22
23
 
23
24
  steps:
data/CHANGELOG.md CHANGED
@@ -11,9 +11,13 @@ Prefix your message with one of the following:
11
11
  - [Security] in case of vulnerabilities.
12
12
  -->
13
13
 
14
+ ## Unreleased
15
+
16
+ - [Fixed] Fix ActiveRecord 7 deprecation warnings.
17
+
14
18
  ## v2.0.1 - 2021-12-11
15
19
 
16
- - [Fixed] Rails 7 was raising an exception because
20
+ - [Fixed] Rails 7 was raising an exception because
17
21
  `ActionView::Base.raise_on_missing_translations` is not a thing anymore.
18
22
 
19
23
  ## v2.0.0 - 2021-12-06
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+ gemspec path: ".."
5
+
6
+ gem "rails", "~> 6.1.0"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsEnv
4
- VERSION = "2.0.1"
4
+ VERSION = "2.0.2"
5
5
  end
data/lib/rails-env.rb CHANGED
@@ -15,6 +15,10 @@ module Rails
15
15
  end
16
16
 
17
17
  module RailsEnv
18
+ def self.deprecations
19
+ @deprecations ||= []
20
+ end
21
+
18
22
  class Railtie < Rails::Railtie
19
23
  initializer "rails-env" do
20
24
  Rails.env.extend(Extension)
@@ -30,7 +34,15 @@ module RailsEnv
30
34
  propagate(:action_mailer, "::ActionMailer::Base")
31
35
  propagate(:action_view, "::ActionView::Base")
32
36
  propagate(:active_job, "::ActiveJob::Base")
33
- propagate(:active_record, "::ActiveRecord::Base")
37
+
38
+ with_rails_constraint("< 7.0.0") do
39
+ propagate(:active_record, "::ActiveRecord::Base")
40
+ end
41
+
42
+ with_rails_constraint(">= 7.0.0") do
43
+ propagate(:active_record, "::ActiveRecord")
44
+ end
45
+
34
46
  propagate(:time_zone, "::Time", :zone)
35
47
  propagate_hosts
36
48
  propagate_autoload_paths
@@ -101,9 +113,9 @@ module RailsEnv
101
113
  end
102
114
 
103
115
  def self.with_rails_constraint(constraint)
104
- Gem::Requirement
105
- .create(constraint)
106
- .satisfied_by?(Gem::Version.create(Rails::VERSION::STRING))
116
+ yield if Gem::Requirement
117
+ .create(constraint)
118
+ .satisfied_by?(Gem::Version.create(Rails::VERSION::STRING))
107
119
  end
108
120
 
109
121
  module Extension
data/rails-env.gemspec CHANGED
@@ -43,4 +43,5 @@ Gem::Specification.new do |spec|
43
43
  spec.add_development_dependency "rubocop"
44
44
  spec.add_development_dependency "rubocop-fnando"
45
45
  spec.add_development_dependency "simplecov"
46
+ spec.add_development_dependency "sqlite3"
46
47
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-env
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-11 00:00:00.000000000 Z
11
+ date: 2021-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: sqlite3
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  description: Avoid environment detection on Rails
126
140
  email:
127
141
  - me@fnando.com
@@ -145,9 +159,8 @@ files:
145
159
  - LICENSE.md
146
160
  - README.md
147
161
  - Rakefile
148
- - gemfiles/rails_5_0.gemfile
149
- - gemfiles/rails_5_2.gemfile
150
162
  - gemfiles/rails_6_0.gemfile
163
+ - gemfiles/rails_6_1.gemfile
151
164
  - gemfiles/rails_7_0.gemfile
152
165
  - lib/rails-env.rb
153
166
  - lib/rails-env/version.rb
@@ -159,10 +172,10 @@ metadata:
159
172
  rubygems_mfa_required: 'true'
160
173
  homepage_uri: https://github.com/fnando/rails_env
161
174
  bug_tracker_uri: https://github.com/fnando/rails_env/issues
162
- source_code_uri: https://github.com/fnando/rails_env/tree/v2.0.1
163
- changelog_uri: https://github.com/fnando/rails_env/tree/v2.0.1/CHANGELOG.md
164
- documentation_uri: https://github.com/fnando/rails_env/tree/v2.0.1/README.md
165
- license_uri: https://github.com/fnando/rails_env/tree/v2.0.1/LICENSE.md
175
+ source_code_uri: https://github.com/fnando/rails_env/tree/v2.0.2
176
+ changelog_uri: https://github.com/fnando/rails_env/tree/v2.0.2/CHANGELOG.md
177
+ documentation_uri: https://github.com/fnando/rails_env/tree/v2.0.2/README.md
178
+ license_uri: https://github.com/fnando/rails_env/tree/v2.0.2/LICENSE.md
166
179
  post_install_message:
167
180
  rdoc_options: []
168
181
  require_paths:
@@ -1,4 +0,0 @@
1
- source "https://rubygems.org"
2
- gemspec path: ".."
3
-
4
- gem "rails", "~> 5.0.0"
@@ -1,4 +0,0 @@
1
- source "https://rubygems.org"
2
- gemspec path: ".."
3
-
4
- gem "rails", "~> 5.2.0"