rails-app_env 0.2.0 → 0.3.0

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: 68b627e3b58352cf6fdcb39e88bb2de7ace7e6ec73889226ffd66ee479de8c3c
4
- data.tar.gz: 9382437f7ad8a5d1fdfe575871914946e7aabe7f1e2832518f388b9bec60d4bb
3
+ metadata.gz: e6d267f1004cebcc7f030c3354bb35db0c4be28518da94481b4e0fbfaf9962b1
4
+ data.tar.gz: f82e53c4ca338784fafa8131ee5aed7040d50725d78f5664820c3cdb2985b350
5
5
  SHA512:
6
- metadata.gz: 8bb85243784b26e19b41611d80c6026b6219cf23d02b28acd729507512d536f29b18bfed9fa8f1a8449b6444b817b2d7183e7438ac5bf97ffa6d16e6754e342d
7
- data.tar.gz: 7b90bf76133badc4f903165bb3abf2e94716f08ac37c55a8ca57ce616e0ea70f46202a48c11b9892e8b7d05e8984fd1a23a0e11a51f74f90b9acde60ed07a0fe
6
+ metadata.gz: 5173ccd76cc86a39a22de45e4728183228be015a55669fa7f7e4e1713ee5dec45c842592178990e45fabb2354867037aee7768b407669f1fcc9315bbab917e86
7
+ data.tar.gz: 3a6ac3879b3a21f2cf803400c39fcd7d93166028797ac14f3ef530a3fa41ec67f0066983e7b64f4dfde95b8b18d547bcb337689036b16aafbccb492c4810a435
@@ -38,7 +38,8 @@ module Rails
38
38
  end
39
39
 
40
40
  def monkey_patch_rails_credentials_command!
41
- require_relative "../rails_ext/credentials_command"
41
+ return unless defined?(Rails::Command::CredentialsCommand)
42
+ Rails::Command::CredentialsCommand.extend(Extensions::OriginalAware)
42
43
  end
43
44
  end
44
45
  end
@@ -0,0 +1,9 @@
1
+ module Rails::AppEnv::Extensions
2
+ module AppConfigurable
3
+ extend self
4
+
5
+ def app_config_for(name)
6
+ Rails.application.config_for(name, env: Rails.app_env)
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Rails::AppEnv::Extensions
2
+ module OriginalAware
3
+ private
4
+
5
+ def config
6
+ Rails::AppEnv::Credentials.original
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ module Rails
2
+ module AppEnv
3
+ module Extensions
4
+ module AppEnvAware
5
+ extend self
6
+
7
+ def app_env
8
+ @_app_env ||= EnvironmentInquirer.new(ENV["APP_ENV"] || Rails.env)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -2,8 +2,8 @@ module Rails
2
2
  module AppEnv
3
3
  class Railtie < Rails::Railtie
4
4
  config.before_configuration do
5
- Rails.extend(RailsHelpers)
6
- Rails.application.extend(ApplicationHelpers)
5
+ Rails.extend(Extensions::AppEnvAware)
6
+ Rails.application.extend(Extensions::AppConfigurable)
7
7
  end
8
8
 
9
9
  config.before_configuration do
@@ -1,5 +1,5 @@
1
1
  module Rails
2
2
  module AppEnv
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
data/lib/rails/app_env.rb CHANGED
@@ -1,13 +1,18 @@
1
1
  require_relative "app_env/version"
2
+
3
+ require_relative "app_env/error"
4
+
5
+ require_relative "app_env/console"
6
+ require_relative "app_env/credentials"
7
+ require_relative "app_env/environment_inquirer"
8
+
9
+ require_relative "app_env/extensions/rails/app_env_aware"
10
+ require_relative "app_env/extensions/credentials_command/original_aware"
11
+ require_relative "app_env/extensions/application/app_configurable"
12
+
2
13
  require_relative "app_env/railtie"
3
14
 
4
15
  module Rails
5
16
  module AppEnv
6
- autoload :ApplicationHelpers, "rails/app_env/application_helpers"
7
- autoload :Console, "rails/app_env/console"
8
- autoload :Credentials, "rails/app_env/credentials"
9
- autoload :EnvironmentInquirer, "rails/app_env/environment_inquirer"
10
- autoload :Error, "rails/app_env/error"
11
- autoload :RailsHelpers, "rails/app_env/rails_helpers"
12
17
  end
13
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-app_env
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Typist Tech Limited
@@ -49,15 +49,15 @@ files:
49
49
  - README.md
50
50
  - Rakefile
51
51
  - lib/rails/app_env.rb
52
- - lib/rails/app_env/application_helpers.rb
53
52
  - lib/rails/app_env/console.rb
54
53
  - lib/rails/app_env/credentials.rb
55
54
  - lib/rails/app_env/environment_inquirer.rb
56
55
  - lib/rails/app_env/error.rb
57
- - lib/rails/app_env/rails_helpers.rb
56
+ - lib/rails/app_env/extensions/application/app_configurable.rb
57
+ - lib/rails/app_env/extensions/credentials_command/original_aware.rb
58
+ - lib/rails/app_env/extensions/rails/app_env_aware.rb
58
59
  - lib/rails/app_env/railtie.rb
59
60
  - lib/rails/app_env/version.rb
60
- - lib/rails/rails_ext/credentials_command.rb
61
61
  - lib/tasks/rails/app_env_tasks.rake
62
62
  homepage: https://github.com/typisttech/rails-app_env
63
63
  licenses:
@@ -1,9 +0,0 @@
1
- module Rails
2
- module AppEnv
3
- module ApplicationHelpers
4
- def app_config_for(name)
5
- config_for(name, env: Rails.app_env)
6
- end
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module Rails
2
- module AppEnv
3
- module RailsHelpers
4
- def app_env
5
- @_app_env ||= EnvironmentInquirer.new(ENV["APP_ENV"] || Rails.env)
6
- end
7
- end
8
- end
9
- end
@@ -1,11 +0,0 @@
1
- module Rails
2
- module Command
3
- class CredentialsCommand
4
- private
5
-
6
- def config
7
- Rails::AppEnv::Credentials.original
8
- end
9
- end
10
- end
11
- end