qonfig 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4478b75a75d9df31fedab5728cc55af2509b858158d522cefc8fbe15811c216
4
- data.tar.gz: d50efec1ffcc132225be42a6e54d9b47e6d548cde6b45ac09f345a9f01fbc2d3
3
+ metadata.gz: 05d98b03ee4891914d9701ee98e6965d523f0b75b84d8c5d8aafc6e0d1efdcf0
4
+ data.tar.gz: 493e96ebeb18d92870a538d21b68f6b79905f719433e8ba201345e60f4d6317f
5
5
  SHA512:
6
- metadata.gz: e5be60954fc592e1c62545c92d025d48cc6d5643ec80955cc9b4dea9bc0c65ccde98638de01a17aabc451bfdfc1d6be4b2465d5ce1f7d2f472ac9e2ef4012efe
7
- data.tar.gz: 1a6e33b588e5df992e10921fd3c09df4de70786aa54968feeb3966170ff33083615110de566f40dd18b8921ee65da5dfd47b40956b08464104f246f68e625671
6
+ metadata.gz: 013cf27437a8434c3b9ba5750ca0a9483479e224bc35244cf8d76d53e712e47c120a22e14e44ed15b0092f1d89a5e41c9d26aee47e16d2edc32ce3f1543a26da
7
+ data.tar.gz: fa6498dd72113cde54b22659dfad3d8ae5a092a34d4f1b9efb4d004a5f89c2d1470abe5eef81fd5bd86e9d0a8fde5036670ea41ce76b468e6fa5090c5f787565
data/.travis.yml CHANGED
@@ -1,10 +1,15 @@
1
1
  language: ruby
2
- rvm:
3
- - 2.3.7
4
- - 2.4.4
5
- - 2.5.1
6
- - ruby-head
7
- - jruby-head
2
+ matrix:
3
+ fast_finish: true
4
+ include:
5
+ - rvm: 2.3.7
6
+ - rvm: 2.4.4
7
+ - rvm: 2.5.1
8
+ - rvm: ruby-head
9
+ - rvm: jruby-head
10
+ allow_failures:
11
+ - rvm: ruby-head
12
+ - rvm: jruby-head
8
13
  sudo: false
9
14
  cache: bundler
10
15
  before_install: gem install bundler
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [0.6.0] - 2018-08-22
5
+ ### Added
6
+ - `#shared_config` - instance method that provides an access to the class level config
7
+ object from `Qonfig::Configurable` instances;
8
+
4
9
  ## [0.5.0] - 2018-07-27
5
10
  ### Added
6
11
  - `load_from_json`- a command that provides an ability to define config settings
data/README.md CHANGED
@@ -520,7 +520,7 @@ config.settings.rubySettings.withAdditionals # => false
520
520
  # --- strict mode ---
521
521
  class Config < Qonfig::DataSet
522
522
  setting :nonexistent_json do
523
- load_from_yaml 'nonexistent_json.json', strict: true # true by default
523
+ load_from_json 'nonexistent_json.json', strict: true # true by default
524
524
  end
525
525
 
526
526
  setting :another_key
@@ -531,7 +531,7 @@ Config.new # => Qonfig::FileNotFoundError
531
531
  # --- non-strict mode ---
532
532
  class Config < Qonfig::DataSet
533
533
  settings :nonexistent_json do
534
- load_from_yaml 'nonexistent_json.json', strict: false
534
+ load_from_json 'nonexistent_json.json', strict: false
535
535
  end
536
536
 
537
537
  setting :another_key
@@ -661,6 +661,7 @@ connection_timeout:
661
661
  - instance-level:
662
662
  - `#configure` - configuration;
663
663
  - `#config` - config object;
664
+ - `#shared_config` - class-level config object;
664
665
 
665
666
  ```ruby
666
667
  # --- usage ---
@@ -685,6 +686,10 @@ Application.config.settings.password # => nil
685
686
  app.config.settings.user # => nil
686
687
  app.config.settings.password # => nil
687
688
 
689
+ # access to the class level config from an instance
690
+ app.shared_config.settings.user # => nil
691
+ app.shared_config.settings.password # => nil
692
+
688
693
  # class-level configuration
689
694
  Application.configure do |conf|
690
695
  conf.user = '0exp'
@@ -705,6 +710,10 @@ Application.config.settings.password # => 'test123'
705
710
  app.config.settings.user # => 'admin'
706
711
  app.config.settings.password # => '123test'
707
712
 
713
+ # access to the class level config from an instance
714
+ app.shared_config.settings.user # => '0exp'
715
+ app.shared_config.settings.password # => 'test123'
716
+
708
717
  # and etc... (all Qonfig-related features)
709
718
  ```
710
719
 
@@ -94,6 +94,14 @@ module Qonfig
94
94
  end
95
95
  end
96
96
 
97
+ # @return [Qonfig::DataSet]
98
+ #
99
+ # @api public
100
+ # @since 0.6.0
101
+ def shared_config
102
+ self.class.config
103
+ end
104
+
97
105
  # @param options_map [Hash]
98
106
  # @param block [Proc]
99
107
  # @return [void]
@@ -3,5 +3,5 @@
3
3
  module Qonfig
4
4
  # @api public
5
5
  # @since 0.1.0
6
- VERSION = '0.5.0'
6
+ VERSION = '0.6.0'
7
7
  end
data/qonfig.gemspec CHANGED
@@ -31,8 +31,8 @@ Gem::Specification.new do |spec|
31
31
  spec.add_development_dependency 'coveralls', '~> 0.8'
32
32
  spec.add_development_dependency 'simplecov', '~> 0.14'
33
33
  spec.add_development_dependency 'simplecov-json', '~> 0.2'
34
- spec.add_development_dependency 'rspec', '~> 3.7'
35
- spec.add_development_dependency 'armitage-rubocop', '~> 0.4'
34
+ spec.add_development_dependency 'rspec', '~> 3.8'
35
+ spec.add_development_dependency 'armitage-rubocop', '~> 0.6'
36
36
 
37
37
  spec.add_development_dependency 'bundler'
38
38
  spec.add_development_dependency 'rake'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qonfig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rustam Ibragimov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-26 00:00:00.000000000 Z
11
+ date: 2018-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coveralls
@@ -58,28 +58,28 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.7'
61
+ version: '3.8'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.7'
68
+ version: '3.8'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: armitage-rubocop
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0.4'
75
+ version: '0.6'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0.4'
82
+ version: '0.6'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: bundler
85
85
  requirement: !ruby/object:Gem::Requirement