dry-config 1.1.1 → 1.1.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
  SHA1:
3
- metadata.gz: 9fc702b1e8fa15764de2145c492312394887f9de
4
- data.tar.gz: 5606c9fe6b4a8da8dbec549793a54831f4eb8a86
3
+ metadata.gz: 815f725119b9da037800fb9bcb685e616c4f670c
4
+ data.tar.gz: 6973bbe93f7cd1349614c1925ff7441c5e689f76
5
5
  SHA512:
6
- metadata.gz: bfb015871bbfa151420f29b31ecfc184c0e46f49961e19e09be0dc92a248300122a0d5100784f6aacd1d138fb49e864e838096e14915f761e40389cbb7ba69ba
7
- data.tar.gz: a45f11f647a4048dc184fb9aa2ac76176e3821c602cb8bf059341c3adc2befbcd09b88869a810b5b2a55b167f88d8e3a9d0020ea13bb238efc794297c6e0d6bf
6
+ metadata.gz: ba9aab3171b96b1d3b0798c02cd8f283ecf7238182c3c5de05c0dcbec637bb431ad6cda43142a3a1034b84e530e45903118b12b8ada9e1801a1effeab92e7693
7
+ data.tar.gz: 67caa764e2f9c0e222e38088bb56b1d9ba24d29a77a10ed467a6e282b4efaa79b2c19ffc4d5e21b6464db89bdd8af1a6a37adf1d172cdb293fd8685d0b8b6422
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Dry::Config
1
+ # dry-config
2
2
 
3
3
  Simple base class for DRY configurations configurations that can be loaded from multiple overriding yml files.
4
4
 
@@ -28,82 +28,82 @@ Or install it yourself as:
28
28
  Note this sample uses the `Singleton` pattern, which is useful but not required.
29
29
 
30
30
  ```ruby
31
- require 'singleton'
32
- require 'dry/config'
31
+ require 'singleton'
32
+ require 'dry/config'
33
+
34
+ class AcmeConfig < Dry::Config::Base
35
+
36
+ # (optional) make this the only instance
37
+ include Singleton
33
38
 
34
- class AcmeConfig < Dry::Config::Base
35
-
36
- # (optional) make this the only instance
37
- include Singleton
38
-
39
- # seed the sensible defaults here
40
- def seed_default_configuration
41
-
42
- @configuration = {
43
- environment: nil,
44
- strategy: :blue_green,
45
- package: {
46
- verbose: false
47
- },
48
- options: {}
49
- }
50
- end
39
+ # seed the sensible defaults here
40
+ def seed_default_configuration
41
+
42
+ @configuration = {
43
+ environment: nil,
44
+ strategy: :blue_green,
45
+ package: {
46
+ verbose: false
47
+ },
48
+ options: {}
49
+ }
51
50
  end
51
+ end
52
52
  ```
53
53
 
54
54
  ### Step 2. Write a yml config file
55
55
 
56
56
  ```yaml
57
- # sample config demonstrating multi-environment override
58
- ---
59
- app: acme
60
- title: Acme Holdings, LLC
61
- #---
62
- options:
63
- aws:elasticbeanstalk:application:environment:
64
- RAILS_ENV: foobar
65
-
66
- aws:autoscaling:launchconfiguration:
67
- InstanceType: foo
68
-
69
- #---
70
- development:
71
- strategy: inplace-update
72
- package:
73
- verbose: true
74
- options:
75
- aws:autoscaling:launchconfiguration:
76
- InstanceType: t1.micro
77
- aws:elasticbeanstalk:application:environment:
78
- RAILS_ENV: development
79
-
80
- #---
81
- production:
82
- options:
83
- aws:autoscaling:launchconfiguration:
84
- InstanceType: t1.large
85
- aws:elasticbeanstalk:application:environment:
86
- RAILS_ENV: production
57
+ # sample config demonstrating multi-environment override
58
+ ---
59
+ app: acme
60
+ title: Acme Holdings, LLC
61
+ #---
62
+ options:
63
+ aws:elasticbeanstalk:application:environment:
64
+ RAILS_ENV: foobar
65
+
66
+ aws:autoscaling:launchconfiguration:
67
+ InstanceType: foo
68
+
69
+ #---
70
+ development:
71
+ strategy: inplace-update
72
+ package:
73
+ verbose: true
74
+ options:
75
+ aws:autoscaling:launchconfiguration:
76
+ InstanceType: t1.micro
77
+ aws:elasticbeanstalk:application:environment:
78
+ RAILS_ENV: development
79
+
80
+ #---
81
+ production:
82
+ options:
83
+ aws:autoscaling:launchconfiguration:
84
+ InstanceType: t1.large
85
+ aws:elasticbeanstalk:application:environment:
86
+ RAILS_ENV: production
87
87
  ```
88
88
 
89
89
  ### Step 3. Load your config
90
90
  Note that multiple files can be loaded and overriden. A nil environment is also possible.
91
91
 
92
92
  ```ruby
93
- AcmeConfig.instance.load!(:production, 'path_to/acme.yml')
93
+ AcmeConfig.instance.load!(:production, 'path_to/acme.yml')
94
94
  ```
95
95
 
96
96
  ### Step 4. Use the values
97
97
  Note that all keys are symbolized upon loading.
98
98
 
99
99
  ```ruby
100
- config = Acme.config.instance
101
- config.load!(:production, 'path_to/acme.yml')
102
-
103
- config.app # acme
104
- config.title # Acme Holdings, LLC
105
- config.strategy # :blue_green,
106
- config.options[:'aws:autoscaling:launchconfiguration'][:InstanceType] # t1.large
100
+ config = Acme.config.instance
101
+ config.load!(:production, 'path_to/acme.yml')
102
+
103
+ config.app # acme
104
+ config.title # Acme Holdings, LLC
105
+ config.strategy # :blue_green,
106
+ config.options[:'aws:autoscaling:launchconfiguration'][:InstanceType] # t1.large
107
107
  ```
108
108
 
109
109
  ## Other options
@@ -17,7 +17,7 @@ module Dry
17
17
  attr_reader :environment
18
18
  attr_reader :filenames
19
19
 
20
- def initialize
20
+ def initialize(*args)
21
21
  seed_default_configuration
22
22
 
23
23
  # used for pruning initial base set. See #load!
@@ -1,5 +1,5 @@
1
1
  module Dry
2
2
  module Config
3
- VERSION = '1.1.1'
3
+ VERSION = '1.1.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Ross