config_default 0.1.0 → 0.1.1

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: cd56026f65a3563933736e9159c7e051b4fd4899300afe65c4430dbd451bdcc9
4
- data.tar.gz: 38255f6582b3bd549af219f9c4ce45ac56085223b26fdee55f38c9743af6446e
3
+ metadata.gz: 8986cd898691eacd74aec36524a3eacd38433629b6ba8e71638619b33dd9f817
4
+ data.tar.gz: 87e0031a77052c3f9e42b87a2c670874cca926a6e1d0803c0c9c113d717f441f
5
5
  SHA512:
6
- metadata.gz: 71bf47a44b41498644f8bf6209204d265975127e7732bdeb2be05cc3da92a1d44679651348abb190af19cd27638f50367a6bdd535377d94d4de6ed4e583699ff
7
- data.tar.gz: 991e86e3c91f03abdab3e02e0a747a808fb05625c6fead718b4b3187941601696dba5d5c03e272939afc382e1e3d8c9ccaede17b703133af6c665a20de4d803b
6
+ metadata.gz: f86e0e505bea0492833852ef4957c73ed8b3ab1b1f43e81e114cce90923fe737fb457ddf0259c5234a079b5458e6b1a6325c4dd560d2ad9c64526c63894bb432
7
+ data.tar.gz: 68a825fe3fd12616f413d28a20b712b9d8783d18bbc3b88615999502581fcbb58a3f74b714149c7d07ea627a8f721f9f8ff4ade4026a7fe7cf8eed7a7ef1800f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.1.1
2
+
3
+ - Remove Rails dependency.
4
+
1
5
  ## 0.1.0
2
6
 
3
- - Test version for publish and test workflow.
7
+ - Default behaviour.
8
+ - Option `recursive` to `#load_struct`.
9
+ - Option `allow_nil` to `#load_struct`.
10
+ - Specs.
11
+ - Documentation and examples.
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- config_default (0.1.0)
5
- rails (~> 6)
4
+ config_default (0.1.1)
5
+ activesupport (~> 6)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -106,7 +106,7 @@ config = ConfigDefault.load(:app, key: "preprod") # Will search preprod key in f
106
106
 
107
107
  ### Struct using
108
108
 
109
- If you want to use configuration as an struct object you can use `#load_struct` method.
109
+ If you want to use configuration as a struct object you can use `#load_struct` method.
110
110
  Let's see an example with `database.yaml` config above:
111
111
 
112
112
  ```ruby
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ConfigDefault::RailsMonkeyPatch
4
+ extend self
5
+
6
+ def call
7
+ return unless Object.const_defined?("Rails")
8
+ return unless Object.const_defined?("Rails::Application")
9
+ return unless Object.const_defined?("Rails::Application::Configuration")
10
+
11
+ require "config_default/rails/application_extension"
12
+ require "config_default/rails/application/configuration_extension"
13
+ end
14
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ConfigDefault
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
@@ -5,9 +5,7 @@ require "active_support/core_ext/hash"
5
5
  require "config_default/version"
6
6
  require "config_default/config"
7
7
  require "config_default/struct"
8
-
9
- require "config_default/rails/application/configuration_extension"
10
- require "config_default/rails/application_extension"
8
+ require "config_default/rails_monkey_patch"
11
9
 
12
10
  module ConfigDefault
13
11
  extend self
@@ -48,3 +46,5 @@ module ConfigDefault
48
46
  ConfigDefault::Struct.new(attributes, recursive: recursive, allow_nil: allow_nil)
49
47
  end
50
48
  end
49
+
50
+ ConfigDefault::RailsMonkeyPatch.call
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: config_default
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stepan Kirushkin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-19 00:00:00.000000000 Z
11
+ date: 2021-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
14
+ name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
@@ -55,6 +55,7 @@ files:
55
55
  - lib/config_default/config.rb
56
56
  - lib/config_default/rails/application/configuration_extension.rb
57
57
  - lib/config_default/rails/application_extension.rb
58
+ - lib/config_default/rails_monkey_patch.rb
58
59
  - lib/config_default/struct.rb
59
60
  - lib/config_default/version.rb
60
61
  homepage: https://github.com/skirushkin/config_default