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 +4 -4
- data/.travis.yml +11 -6
- data/CHANGELOG.md +5 -0
- data/README.md +11 -2
- data/lib/qonfig/configurable.rb +8 -0
- data/lib/qonfig/version.rb +1 -1
- data/qonfig.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05d98b03ee4891914d9701ee98e6965d523f0b75b84d8c5d8aafc6e0d1efdcf0
|
4
|
+
data.tar.gz: 493e96ebeb18d92870a538d21b68f6b79905f719433e8ba201345e60f4d6317f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 013cf27437a8434c3b9ba5750ca0a9483479e224bc35244cf8d76d53e712e47c120a22e14e44ed15b0092f1d89a5e41c9d26aee47e16d2edc32ce3f1543a26da
|
7
|
+
data.tar.gz: fa6498dd72113cde54b22659dfad3d8ae5a092a34d4f1b9efb4d004a5f89c2d1470abe5eef81fd5bd86e9d0a8fde5036670ea41ce76b468e6fa5090c5f787565
|
data/.travis.yml
CHANGED
@@ -1,10 +1,15 @@
|
|
1
1
|
language: ruby
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
- 2.
|
6
|
-
-
|
7
|
-
-
|
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
|
-
|
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
|
-
|
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
|
|
data/lib/qonfig/configurable.rb
CHANGED
data/lib/qonfig/version.rb
CHANGED
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.
|
35
|
-
spec.add_development_dependency 'armitage-rubocop', '~> 0.
|
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.
|
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-
|
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.
|
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.
|
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.
|
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.
|
82
|
+
version: '0.6'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|