qonfig 0.7.0 → 0.8.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: 508503230a1e21322689d23c7e0bd68c1f3bd3e268719f3b7adcdb1e5595926e
4
- data.tar.gz: efc18abe1dce63006df0de913a1b1969d1fc36b4e80353985a3126f6b86a9c16
3
+ metadata.gz: 5c0b292545534b8b00206fd23720da284b5028075c172133d4813e4b6f23f6dc
4
+ data.tar.gz: f83fb1c73fa7485ef2fe21c5b27277700255c3a012355576f1261750f130eb06
5
5
  SHA512:
6
- metadata.gz: 5f507d2ef122bdd22258972c6630fd1e8f384d39476e3eb751a2131a505e8fedaae44140deaedac26bbba735854482207da89f80bc862bab4f10b739f547ade3
7
- data.tar.gz: 7160203dbfd9613b78032307dcd3f1f5bcbb00d0751a0bfbea3621b8fd9e1b645aa6e3783ba790918bba49f9151426b6e17fbdc252ce5da191e7232d2d7ed193
6
+ metadata.gz: 30bf79cc84a571522d1c7df4c05d3330f5b577fc12597035cdcc5a56b667dbb0e80466781627c0312bebeb31bc72a2f567439cfc11b13ae6519888bbd1bad611
7
+ data.tar.gz: 80c56739bcfd8664485fae8c5a080041a4357bbc72f90cf6f6b4137c0c4076b0159458d8f4397bab4892173e12dc1c12db01b01d922b4a66f6fb723f44280297
data/.rubocop.yml CHANGED
@@ -4,7 +4,7 @@ inherit_gem:
4
4
  - lib/rubocop.rspec.yml
5
5
 
6
6
  AllCops:
7
- TargetRubyVersion: 2.5.1
7
+ TargetRubyVersion: 2.5.3
8
8
  Include:
9
9
  - lib/**/*.rb
10
10
  - spec/**/*.rb
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.8.0] - 2018-11-21
5
+ ### Changed
6
+ - `expose_yaml`, `load_from_yaml`, `load_from_json` and `load_from_self` treats empty hash (`{}`)
7
+ as an option with empty hash value (previously treated as a nested setting);
8
+
4
9
  ## [0.7.0] - 2018-10-20
5
10
  ### Added
6
11
  - `expose_yaml` - a command that provides an ability to define config settings
data/README.md CHANGED
@@ -886,7 +886,7 @@ Qonfig.plugin(:plugin_name) # or Qonfig.plugin('plugin_name')
886
886
  ## Contributing
887
887
 
888
888
  - Fork it ( https://github.com/0exp/qonfig/fork )
889
- - Create your feature branch (`git checkout -b feature/my-new-feature development`)
889
+ - Create your feature branch (`git checkout -b feature/my-new-feature`)
890
890
  - Commit your changes (`git commit -am 'Add some feature'`)
891
891
  - Push to the branch (`git push origin feature/my-new-feature`)
892
892
  - Create new Pull Request
@@ -8,37 +8,37 @@ module Qonfig
8
8
  #
9
9
  # @api private
10
10
  # @since 0.2.0
11
- INTEGER_PATTERN = /\A\d+\z/
11
+ INTEGER_PATTERN = /\A\d+\z/.freeze
12
12
 
13
13
  # @return [Regexp]
14
14
  #
15
15
  # @api private
16
16
  # @since 0.2.0
17
- FLOAT_PATTERN = /\A\d+\.\d+\z/
17
+ FLOAT_PATTERN = /\A\d+\.\d+\z/.freeze
18
18
 
19
19
  # @return [Regexp]
20
20
  #
21
21
  # @api private
22
22
  # @since 0.2.0
23
- TRUE_PATTERN = /\A(t|true)\z/i
23
+ TRUE_PATTERN = /\A(t|true)\z/i.freeze
24
24
 
25
25
  # @return [Regexp]
26
26
  #
27
27
  # @api private
28
28
  # @since 0.2.0
29
- FALSE_PATTERN = /\A(f|false)\z/i
29
+ FALSE_PATTERN = /\A(f|false)\z/i.freeze
30
30
 
31
31
  # @return [Regexp]
32
32
  #
33
33
  # @api private
34
34
  # @since 0.2.0
35
- ARRAY_PATTERN = /\A[^'"].*\s*,\s*.*[^'"]\z/
35
+ ARRAY_PATTERN = /\A[^'"].*\s*,\s*.*[^'"]\z/.freeze
36
36
 
37
37
  # @return [Regexp]
38
38
  #
39
39
  # @api private
40
40
  # @since 0.2.0
41
- QUOTED_STRING_PATTERN = /\A['"].*['"]\z/
41
+ QUOTED_STRING_PATTERN = /\A['"].*['"]\z/.freeze
42
42
 
43
43
  class << self
44
44
  # @param env_data [Hash]
@@ -16,9 +16,8 @@ module Qonfig
16
16
  def build_from_hash(hash)
17
17
  Class.new(Qonfig::DataSet).tap do |data_set_klass|
18
18
  hash.each_pair do |key, value|
19
- if value.is_a?(Hash)
19
+ if value.is_a?(Hash) && value.any?
20
20
  sub_data_set_klass = build_from_hash(value)
21
-
22
21
  data_set_klass.setting(key) { compose sub_data_set_klass }
23
22
  else
24
23
  data_set_klass.setting key, value
@@ -5,5 +5,5 @@ module Qonfig
5
5
  #
6
6
  # @api public
7
7
  # @since 0.1.0
8
- VERSION = '0.7.0'
8
+ VERSION = '0.8.0'
9
9
  end
data/qonfig.gemspec CHANGED
@@ -6,7 +6,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
6
  require 'qonfig/version'
7
7
 
8
8
  Gem::Specification.new do |spec|
9
- spec.required_ruby_version = '>= 2.3.7'
9
+ spec.required_ruby_version = '>= 2.3.8'
10
10
 
11
11
  spec.name = 'qonfig'
12
12
  spec.version = Qonfig::VERSION
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.add_development_dependency 'coveralls', '~> 0.8'
32
32
  spec.add_development_dependency 'simplecov', '~> 0.16'
33
33
  spec.add_development_dependency 'rspec', '~> 3.8'
34
- spec.add_development_dependency 'armitage-rubocop', '~> 0.10'
34
+ spec.add_development_dependency 'armitage-rubocop', '~> 0.12'
35
35
 
36
36
  spec.add_development_dependency 'bundler'
37
37
  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.7.0
4
+ version: 0.8.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-10-20 00:00:00.000000000 Z
11
+ date: 2018-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coveralls
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.10'
61
+ version: '0.12'
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: '0.10'
68
+ version: '0.12'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -172,7 +172,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
172
172
  requirements:
173
173
  - - ">="
174
174
  - !ruby/object:Gem::Version
175
- version: 2.3.7
175
+ version: 2.3.8
176
176
  required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - ">="