rails-env 1.0.2 → 1.0.3
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 +4 -4
- data/lib/rails-env.rb +12 -0
- data/lib/rails-env/version.rb +1 -1
- data/spec/rails_spec.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64a1b33d78a2f6ea1a3f825247a2f9b6d31641df
|
4
|
+
data.tar.gz: 67ebba6d2ee4cb55d4609fabfe5ce14c442e3eb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b06243ae47079aa2ca637d0f174da7c2f24107f8411ee968a7edbd3bc88f7618ba7458abc7d2fe9163e7897c15a6a213b35bdc03388abd8321aecf8378e71e8
|
7
|
+
data.tar.gz: 7091a7be49d361700ced30a828cc0f3891173711ad32d7551d85414b6b5ba7521ce069faff5d9a429b83dbcafd78fa94cf3c25a7dd78d1b75b1c4eca8e1844a9
|
data/lib/rails-env.rb
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
require 'rails-env/version'
|
2
2
|
|
3
|
+
module Rails
|
4
|
+
class << self
|
5
|
+
env_method = instance_method(:env=)
|
6
|
+
|
7
|
+
define_method :env= do |env|
|
8
|
+
env_method.bind(self).call(env)
|
9
|
+
Rails.env.extend(RailsEnv::Extension)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
3
14
|
module RailsEnv
|
4
15
|
class Railtie < Rails::Railtie
|
5
16
|
initializer 'rails-env' do
|
@@ -15,6 +26,7 @@ module RailsEnv
|
|
15
26
|
propagate(:action_mailer, '::ActionMailer::Base')
|
16
27
|
propagate(:active_record, '::ActiveRecord::Base')
|
17
28
|
propagate(:active_job, '::ActiveJob::Base')
|
29
|
+
propagate(:action_controller, '::ActionController::Base')
|
18
30
|
propagate(:time_zone, '::Time', :zone)
|
19
31
|
propagate_i18n
|
20
32
|
end
|
data/lib/rails-env/version.rb
CHANGED
data/spec/rails_spec.rb
CHANGED
@@ -12,6 +12,11 @@ describe RailsEnv, '::ActionMailer' do
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
+
it 'assigns extended environment' do
|
16
|
+
Rails.env = 'test'
|
17
|
+
expect(Rails.env).to respond_to(:on)
|
18
|
+
end
|
19
|
+
|
15
20
|
it 'sets url options' do
|
16
21
|
expect(ActionMailer::Base.default_url_options).to include(host: 'localhost', port: 3000)
|
17
22
|
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: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|