qonfig 0.23.0 → 0.24.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: 00007ac8bbe4ff23e06817dc5c30baac54ea36f60c5b5b08cccb85108e6b1b57
4
- data.tar.gz: 393b03500de77eeefc8f9617603d4a0eeb183ad2da598d107cca25929ab999ff
3
+ metadata.gz: 43bd1182137cdfc1dbba1156fb39daa755a0e0aa4fa8cd9a58e9ee62afd8a682
4
+ data.tar.gz: 983d47af7e7d3edceff06ccdc5e17dfe18befa6768496c8dfbdbd909c7746beb
5
5
  SHA512:
6
- metadata.gz: 1d5dfc6dfbb9a8c142f1a98eb9a4c9650c460f29a689adf619c6f71ca579f049ad418dbb2cf0ee2eb5e9f4feae7ca425334fc973b3da466fbcc44e58e58af953
7
- data.tar.gz: 46c85ca1393f7db4bf06534e14ef6418e313ed46acfb13226d8a957d43b5d12824e0631c2579ca8cb612b598671143f0c91f268713351424104fb543a44c651e
6
+ metadata.gz: 544c1f4704f5cd33e08354bb47f202f8fe5356e698577eb15d176827e24fff77ecbc5d9fab19e79a1550c6d6771a70f8bec3228c2478737c24e15b49bf812986
7
+ data.tar.gz: 59fb280050df43e2af4b37e548073083fdcce19f7250778e8c5db596a0c2fbd373b4f479dea721531c39b3a51ed0fe643e08b3251b93d2ea31952609db1241c4
@@ -4,28 +4,33 @@ matrix:
4
4
  include:
5
5
  - rvm: 2.4.9
6
6
  gemfile: gemfiles/with_external_deps.gemfile
7
- env: TEST_PLUGINS=true
7
+ env: TEST_PLUGINS=true FULL_TEST_COVERAGE_CHECK=true
8
8
  - rvm: 2.5.7
9
9
  gemfile: gemfiles/with_external_deps.gemfile
10
- env: TEST_PLUGINS=true
10
+ env: TEST_PLUGINS=true FULL_TEST_COVERAGE_CHECK=true
11
11
  - rvm: 2.6.5
12
12
  gemfile: gemfiles/with_external_deps.gemfile
13
- env: TEST_PLUGINS=true
13
+ env: TEST_PLUGINS=true FULL_TEST_COVERAGE_CHECK=true
14
+ - rvm: 2.7.0
15
+ gemfile: gemfiles/with_external_deps.gemfile
16
+ env: TEST_PLUGINS=true FULL_TEST_COVERAGE_CHECK=true
14
17
  - rvm: ruby-head
15
18
  gemfile: gemfiles/with_external_deps.gemfile
16
- env: TEST_PLUGINS=true
19
+ env: TEST_PLUGINS=true FULL_TEST_COVERAGE_CHECK=true
17
20
  - rvm: jruby-head
18
21
  gemfile: gemfiles/with_external_deps.gemfile
19
- env: TEST_PLUGINS=true
22
+ env: TEST_PLUGINS=true FULL_TEST_COVERAGE_CHECK=true
20
23
  - rvm: truffleruby
21
24
  gemfile: gemfiles/with_external_deps.gemfile
22
- env: TEST_PLUGINS=true
25
+ env: TEST_PLUGINS=true FULL_TEST_COVERAGE_CHECK=true
23
26
  - rvm: 2.4.9
24
27
  gemfile: gemfiles/without_external_deps.gemfile
25
28
  - rvm: 2.5.7
26
29
  gemfile: gemfiles/without_external_deps.gemfile
27
30
  - rvm: 2.6.5
28
31
  gemfile: gemfiles/without_external_deps.gemfile
32
+ - rvm: 2.7.0
33
+ gemfile: gemfiles/without_external_deps.gemfile
29
34
  - rvm: ruby-head
30
35
  gemfile: gemfiles/without_external_deps.gemfile
31
36
  - rvm: jruby-head
@@ -40,6 +45,3 @@ sudo: false
40
45
  cache: bundler
41
46
  before_install: gem install bundler
42
47
  script: bundle exec rspec
43
- notifications:
44
- slack:
45
- secure: I03SDv+IrKy3IkeGjjHUJ9VneFMiYpLzIgPOixGFO5zGVXgulwmun82KsrPSW5HkK1UEQCahfoXt1hNECPwxcdsY01q6LBYJQx1jD0q17bXHllN/q0C6lx3peRN0KqNAAOU3/mHZxLt3HFV+N3HsSnoxDMuSYJgKbjCL/QVG2L2UYT9vi+JRNM/thj8R6MWKWlOHemik40GbLr2anCOCqiALzxnJzh5nJyGj+9SGvjhHfQq/fAIrg1+Scu+UchG8d+1yS5JWsGTt1/JF08i+Ux4ceTQ7GNBNeA5cj/xuUzvRx6A85renxyTiZMKIL0+jeceUm8c+/46XFcq0F7/kJB36lwjFhX1JRphcu/VouRdEwW/BvH74wnyHtygqOpk0LH4shp7A1DIS1DlnBbeJxrR5hdMDnmV85kTU6w6H0BbncsYY/pH1fji1kgH6jCsdwqDlq4wLB8x8I+eZABBsfb/r55z/HnBmmxlvR7Rt3X5/yR3gJrsgRrDBBZ5LwYy1RSCDu76vMQqWGJKG03FdfqSNqmC5V4MC5Ez8yjGDW0Yle09mwvsL2c6fDXyDPCeB/gwNk+FvgLRXnv7C4BaBNEoG4JnCL/dwauoJNg0lB6uF34BEmYAhZIrdY1CI6BqPWnaVMJfcJSYekBVXDIELDnTFRWjaGU1y8dM6lNzDmYE=
@@ -1,6 +1,10 @@
1
1
  # Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [0.24.0] - 2019-12-29
5
+ ### Added
6
+ - Support for **Ruby@2.7**;
7
+
4
8
  ## [0.23.0] - 2019-12-12
5
9
  ### Added
6
10
  - Support for `Pathname` file path in `.load_from_json`, `.load_from_yaml`, `.load_from_toml`, `.expose_yaml`, `.expose_json`, `.expose_toml`;
data/README.md CHANGED
@@ -103,6 +103,7 @@ require 'qonfig'
103
103
  - [toml](#plugins-toml) (support for `TOML` format)
104
104
  - [pretty_print](#plugins-pretty_print) (beautified/prettified console output)
105
105
  - [Roadmap](#roadmap)
106
+ - [Build](#build)
106
107
  ---
107
108
 
108
109
  ## Definition
@@ -633,9 +634,8 @@ config.settings.web_api # => "api.google.com"
633
634
 
634
635
  ---
635
636
 
636
- - `Qonfig::Compacted`: represents the compacted config object with setting readers and setting writers;
637
+ - `Qonfig::Compacted`: represents the compacted config object with setting readers, setting writers and setting predicates only - and no any other useful instance-based functionality:
637
638
  - setting keys are represented as direct instace methods (`#settings` invokation does not need);
638
- - no any other useful instance-based functionality - just setting readers, setting writers and setting predicates:
639
639
  - support for index-like access methods (`[]`,`[]=`);
640
640
  - full support of `Qonfig::DataSet` definition DSL commands:
641
641
  - `setting`, `re_setting` [doc](#definition-and-access)
@@ -646,9 +646,9 @@ config.settings.web_api # => "api.google.com"
646
646
  - support for validation of potential setting values `.valid_with?` [documentation](#validation-of-potential-setting-values);
647
647
  - can be instantiated by:
648
648
  - by existing config object: `Qonfig::DataSet#compacted` or `Qonfig::Compacted.build_from(config, &configuration)`;
649
- - from existing `Qonfig::DataSet` class: ``Qonfig::DataSet.build_compacted`;
649
+ - from existing `Qonfig::DataSet` class: `Qonfig::DataSet.build_compacted`;
650
650
  - by direct instantiation: `Qonfig::Compacted.new(settings_values = {}, &configuration)`;
651
- - by implicit instance building without explicit class definition `Qonfig::Compacted.build(&dsl_commands) # => instance of Qonfig::Compacted`;
651
+ - by implicit instance building without explicit class definition `Qonfig::Compacted.build(&dsl_commands)`;
652
652
  - you can define your own instance methods too;
653
653
 
654
654
  ---
@@ -3214,6 +3214,13 @@ config = Config.new
3214
3214
  - Rails reload plugin;
3215
3215
  - **Minor**:
3216
3216
 
3217
+ ## Build
3218
+
3219
+ ```shell
3220
+ bin/rspec -w # test the core functionality and plugins
3221
+ bin/rspec -n # test only the core functionality
3222
+ ```
3223
+
3217
3224
  ## Contributing
3218
3225
 
3219
3226
  - Fork it ( https://github.com/0exp/qonfig/fork )
data/bin/rspec CHANGED
@@ -36,6 +36,7 @@ module QonfigSpecRunner
36
36
 
37
37
  def run_with_specs_for_plugins!
38
38
  ENV['TEST_PLUGINS'] = 'true'
39
+ ENV['FULL_TEST_COVERAGE_CHECK'] = 'true'
39
40
  ENV['BUNDLE_GEMFILE'] = GEMFILES[:with_external_deps]
40
41
  run_tests!
41
42
  end
@@ -15,7 +15,7 @@ module Qonfig::DSL # rubocop:disable Metrics/ModuleLength
15
15
  # @api private
16
16
  # @since 0.1.0
17
17
  # @version 0.20.0
18
- # rubocop:disable Metrics/LineLength, Metrics/AbcSize
18
+ # rubocop:disable Layout/LineLength, Metrics/AbcSize
19
19
  def extended(child_klass)
20
20
  child_klass.instance_variable_set(:@definition_commands, Qonfig::CommandSet.new)
21
21
  child_klass.instance_variable_set(:@instance_commands, Qonfig::CommandSet.new)
@@ -33,7 +33,7 @@ module Qonfig::DSL # rubocop:disable Metrics/ModuleLength
33
33
  end
34
34
  end)
35
35
  end
36
- # rubocop:enable Metrics/LineLength, Metrics/AbcSize
36
+ # rubocop:enable Layout/LineLength, Metrics/AbcSize
37
37
  end
38
38
 
39
39
  # @return [Qonfig::CommandSet]
@@ -8,8 +8,14 @@ class Qonfig::Plugins::PrettyPrint < Qonfig::Plugins::Abstract
8
8
  #
9
9
  # @api private
10
10
  # @since 0.19.0
11
- # @version 0.21.0
11
+ # @version 0.24.0
12
12
  def install!
13
+ # :nocov:
14
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7.0')
15
+ require_relative 'pretty_print/ruby_2_7_basic_object_pp_patch'
16
+ end
17
+ # :nocov:
18
+
13
19
  require_relative 'pretty_print/mixin'
14
20
  require_relative 'pretty_print/data_set'
15
21
  require_relative 'pretty_print/settings'
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ # NOTE: why not `.prepend` ?
4
+ # `prepend` in this case works incorrectly and sometimes this patch can not be correctly
5
+ # injected to the original module and it's children ancestors (Ruby-specific behaviour of
6
+ # module including and prepending).
7
+
8
+ # @api public
9
+ # @since 0.24.0
10
+ module PP::PPMethods
11
+ # :nocov:
12
+ def pp(obj)
13
+ # If obj is a Delegator then use the object being delegated to for cycle
14
+ # detection
15
+
16
+ # NOTE: --- PATCH ---
17
+ if defined?(::Delegator) and (
18
+ begin
19
+ (class << obj; self; end) <= ::Delegator # patch
20
+ rescue ::TypeError
21
+ obj.is_a?(::Delegator)
22
+ end
23
+ )
24
+ obj = obj.__getobj__
25
+ end # instead of: obj = obj.__getobj__ if defined?(::Delegator) and obj.is_a?(::Delegator)
26
+ # NOTE:
27
+ # Old implementation can not be used with BasicObject instances
28
+ # (with Qonfig::Compacted in our case)
29
+ # NOTE: --- PATCH ---
30
+
31
+ if check_inspect_key(obj)
32
+ group { obj.pretty_print_cycle self }
33
+ return
34
+ end
35
+
36
+ begin
37
+ push_inspect_key(obj)
38
+ group { obj.pretty_print self }
39
+ ensure
40
+ pop_inspect_key(obj) unless PP.sharing_detection
41
+ end
42
+ end
43
+ # :nocov:
44
+ end
@@ -217,7 +217,7 @@ class Qonfig::Settings # NOTE: Layout/ClassStructure is disabled only for CORE_M
217
217
  #
218
218
  # @api private
219
219
  # @since 0.1.0
220
- # rubocop:disable Metrics/LineLength
220
+ # rubocop:disable Layout/LineLength
221
221
  def __to_hash__(transform_key: BASIC_SETTING_KEY_TRANSFORMER, transform_value: BASIC_SETTING_VALUE_TRANSFORMER)
222
222
  unless transform_key.is_a?(Proc)
223
223
  ::Kernel.raise(Qonfig::IncorrectKeyTransformerError, 'Key transformer should be a type of proc')
@@ -231,7 +231,7 @@ class Qonfig::Settings # NOTE: Layout/ClassStructure is disabled only for CORE_M
231
231
  __build_hash_representation__(transform_key: transform_key, transform_value: transform_value)
232
232
  end
233
233
  end
234
- # rubocop:enable Metrics/LineLength
234
+ # rubocop:enable Layout/LineLength
235
235
  alias_method :__to_h__, :__to_hash__
236
236
 
237
237
  # @option all_variants [Boolean]
@@ -47,7 +47,7 @@ class Qonfig::Uploaders::YAML < Qonfig::Uploaders::File
47
47
  # @since 0.11.0
48
48
  def represent_settings(settings, options, &value_processor)
49
49
  settings_hash_opts = hash_representation_options(options, &value_processor)
50
- settings_hash = settings.__to_hash__(settings_hash_opts)
50
+ settings_hash = settings.__to_hash__(**settings_hash_opts)
51
51
  to_yaml_string(settings_hash, options)
52
52
  end
53
53
 
@@ -5,5 +5,5 @@ module Qonfig
5
5
  #
6
6
  # @api public
7
7
  # @since 0.1.0
8
- VERSION = '0.23.0'
8
+ VERSION = '0.24.0'
9
9
  end
@@ -29,12 +29,11 @@ Gem::Specification.new do |spec|
29
29
  f.match(%r{^(test|spec|features)/})
30
30
  end
31
31
 
32
- spec.add_development_dependency 'coveralls', '~> 0.8'
33
- spec.add_development_dependency 'simplecov', '~> 0.16'
34
- spec.add_development_dependency 'rspec', '~> 3.8'
35
- spec.add_development_dependency 'armitage-rubocop', '~> 0.77'
32
+ spec.add_development_dependency 'simplecov', '~> 0.17'
33
+ spec.add_development_dependency 'rspec', '~> 3.9'
34
+ spec.add_development_dependency 'armitage-rubocop', '~> 0.78'
36
35
 
37
36
  spec.add_development_dependency 'bundler'
38
- spec.add_development_dependency 'rake'
37
+ spec.add_development_dependency 'rake', '>= 13'
39
38
  spec.add_development_dependency 'pry'
40
39
  end
metadata CHANGED
@@ -1,71 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qonfig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.0
4
+ version: 0.24.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: 2019-12-12 00:00:00.000000000 Z
11
+ date: 2019-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: coveralls
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '0.8'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '0.8'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: simplecov
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
17
  - - "~>"
32
18
  - !ruby/object:Gem::Version
33
- version: '0.16'
19
+ version: '0.17'
34
20
  type: :development
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
24
  - - "~>"
39
25
  - !ruby/object:Gem::Version
40
- version: '0.16'
26
+ version: '0.17'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: rspec
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
31
  - - "~>"
46
32
  - !ruby/object:Gem::Version
47
- version: '3.8'
33
+ version: '3.9'
48
34
  type: :development
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
38
  - - "~>"
53
39
  - !ruby/object:Gem::Version
54
- version: '3.8'
40
+ version: '3.9'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: armitage-rubocop
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
45
  - - "~>"
60
46
  - !ruby/object:Gem::Version
61
- version: '0.77'
47
+ version: '0.78'
62
48
  type: :development
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
52
  - - "~>"
67
53
  - !ruby/object:Gem::Version
68
- version: '0.77'
54
+ version: '0.78'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: bundler
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +72,14 @@ dependencies:
86
72
  requirements:
87
73
  - - ">="
88
74
  - !ruby/object:Gem::Version
89
- version: '0'
75
+ version: '13'
90
76
  type: :development
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
80
  - - ">="
95
81
  - !ruby/object:Gem::Version
96
- version: '0'
82
+ version: '13'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: pry
99
85
  requirement: !ruby/object:Gem::Requirement
@@ -183,6 +169,7 @@ files:
183
169
  - lib/qonfig/plugins/pretty_print/compacted.rb
184
170
  - lib/qonfig/plugins/pretty_print/data_set.rb
185
171
  - lib/qonfig/plugins/pretty_print/mixin.rb
172
+ - lib/qonfig/plugins/pretty_print/ruby_2_7_basic_object_pp_patch.rb
186
173
  - lib/qonfig/plugins/pretty_print/settings.rb
187
174
  - lib/qonfig/plugins/registry.rb
188
175
  - lib/qonfig/plugins/toml.rb
@@ -244,8 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
231
  - !ruby/object:Gem::Version
245
232
  version: '0'
246
233
  requirements: []
247
- rubyforge_project:
248
- rubygems_version: 2.7.6
234
+ rubygems_version: 3.1.2
249
235
  signing_key:
250
236
  specification_version: 4
251
237
  summary: Config object