invar 0.7.0 → 0.8.0

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
  SHA256:
3
- metadata.gz: 62fcbaf0763469c256af4915bdae35ded8a2691c647356a24bd6e68635bf3030
4
- data.tar.gz: a54dce1295a10292f208318faeefe43b0c279934154f2c6f112e5b22278126a6
3
+ metadata.gz: a4826c528fc5940bcc955a1fc762abc2b4800a30eb4ce5b34af0ea313dd990ab
4
+ data.tar.gz: f463ed247adc47ea89d7b6965cd427d21a98de125271b262541eb0703a792d62
5
5
  SHA512:
6
- metadata.gz: 5c0d9b6ae497f3e1ca0ba6701cdc99c1b8408ceabcdfd1970b67c465576f2cd0439caf92fc6413eb40db21d7289d5f5cab495adeb3499bdeef3c3a4da43a0e2b
7
- data.tar.gz: 206b350e643afabd1892db2cf393b375e7555fe85f65d56705c718757ce172d4360fb9f6c4102b70da64223ee42a9d0ef960298240bce9e755b91512f7d1406a
6
+ metadata.gz: 6bbc1f4df04c3f4917a2cfcce611acde0859ccd74b412c0b9faa021770c4f01d246defb0131fc8052d0e2aeb40d904d40a043ecccb7a872f966b4a9264e812a3
7
+ data.tar.gz: 32a1754130909b04d488adb88b67e5efe193c2173103d9041338652026ef45a55b3e4fbaa49bed2863f8b5d0d70a257ace52b5bbff913236f4c82b4a90af06bf
data/.rubocop.yml CHANGED
@@ -4,17 +4,6 @@ AllCops:
4
4
  Exclude:
5
5
  - 'bin/*'
6
6
 
7
- TargetRubyVersion: 2.7
8
-
9
- Layout/LineLength:
10
- Exclude:
11
- - 'spec/**/*.rb'
12
-
13
- # setting to 6 to match RubyMine autoformat
14
- Layout/FirstArrayElementIndentation:
15
- IndentationWidth: 6
16
-
17
-
18
7
  # rspec blocks are huge by design
19
8
  Metrics/BlockLength:
20
9
  Exclude:
@@ -23,4 +12,3 @@ Metrics/BlockLength:
23
12
  Metrics/ModuleLength:
24
13
  Exclude:
25
14
  - 'spec/**/*.rb'
26
-
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.7.8
1
+ ruby-3.1.4
data/Gemfile CHANGED
@@ -2,14 +2,19 @@
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ # Gem's dependencies in invar.gemspec
6
+ gemspec
7
+
5
8
  group :development do
6
9
  gem 'bundler', '~> 2.3'
7
- gem 'fakefs', '~> 2.5'
8
10
  gem 'rake', '~> 13.0'
9
- gem 'rspec', '~> 3.12'
10
- gem 'simplecov', '~> 0.22'
11
+ gem 'rubocop', '~> 1.56'
12
+ gem 'rubocop-performance', '~> 1.19'
11
13
  gem 'yard', '~> 0.9'
12
14
  end
13
15
 
14
- # Specify your gem's dependencies in invar.gemspec
15
- gemspec
16
+ group :test do
17
+ gem 'fakefs', '~> 2.5'
18
+ gem 'rspec', '~> 3.12'
19
+ gem 'simplecov', '~> 0.22'
20
+ end
data/RELEASE_NOTES.md CHANGED
@@ -13,6 +13,34 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
13
13
 
14
14
  ### Minor Changes
15
15
 
16
+ * none
17
+
18
+ ### Bugfixes
19
+
20
+ * none
21
+
22
+ ## [0.8.0] - 2023-09-13
23
+
24
+ ### Major Changes
25
+
26
+ * none
27
+
28
+ ### Minor Changes
29
+
30
+ * Increased minimum Ruby to 3.1
31
+
32
+ ### Bugfixes
33
+
34
+ * none
35
+
36
+ ## [0.7.0] - 2023-08-06
37
+
38
+ ### Major Changes
39
+
40
+ * none
41
+
42
+ ### Minor Changes
43
+
16
44
  * Tweaked file missing error messages
17
45
  * Extracted testing helper features into a separate module
18
46
  * Added support for multiple after_load hooks
data/invar.gemspec CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ['lib']
29
29
 
30
- spec.required_ruby_version = '>= 2.7'
30
+ spec.required_ruby_version = '>= 3.1'
31
31
 
32
32
  spec.add_dependency 'dry-schema', '>= 1.0'
33
33
  spec.add_dependency 'lockbox', '>= 1.0'
data/lib/invar/errors.rb CHANGED
@@ -1,5 +1,7 @@
1
- module Invar
1
+ # frozen_string_literal: true
2
2
 
3
+ # :nodoc:
4
+ module Invar
3
5
  # Raised when no config file can be found within the search paths.
4
6
  class MissingConfigFileError < RuntimeError
5
7
  end
@@ -41,11 +43,11 @@ module Invar
41
43
  require 'invar/test'
42
44
  HINT
43
45
 
44
- PRETEND_MSG = "Method 'Invar::Scope#pretend' is defined in the testing extension. #{ HINT }"
45
- HOOK_MSG = "Methods 'Invar.after_load and clear_hooks' are defined in the testing extension. #{ HINT }"
46
+ PRETEND_MSG = "Method 'Invar::Scope#pretend' is defined in the testing extension. #{ HINT }".freeze
47
+ HOOK_MSG = "Methods 'Invar.after_load and clear_hooks' are defined in the testing extension. #{ HINT }".freeze
46
48
  end
47
49
 
48
50
  # Raised when schema validation fails
49
51
  class SchemaValidationError < RuntimeError
50
52
  end
51
- end
53
+ end
@@ -30,8 +30,8 @@ module Invar
30
30
  #
31
31
  # @param (see #define)
32
32
  # @see Tasks#define
33
- def self.define(**args, &block)
34
- new.define(**args, &block)
33
+ def self.define(...)
34
+ new.define(...)
35
35
  end
36
36
 
37
37
  # Defines helpful Rake tasks for the given namespace.
data/lib/invar/reality.rb CHANGED
@@ -78,8 +78,9 @@ module Invar
78
78
  begin
79
79
  @secrets = Scope.new(load_secrets(locator, decryption_keyfile || DEFAULT_KEY_FILE_NAME))
80
80
  rescue FileLocator::FileNotFoundError
81
+ hint = "Create encrypted secrets.yml in one of these locations: #{ search_paths }"
81
82
  raise MissingSecretsFileError,
82
- "No Invar secrets file found. Create encrypted secrets.yml in one of these locations: #{ search_paths }"
83
+ "No Invar secrets file found. #{ hint }"
83
84
  end
84
85
 
85
86
  freeze
data/lib/invar/scope.rb CHANGED
@@ -26,11 +26,9 @@ module Invar
26
26
  alias [] fetch
27
27
 
28
28
  def method_missing(symbol, *args)
29
- if symbol == :pretend
30
- raise ::Invar::ImmutableRealityError, ::Invar::ImmutableRealityError::PRETEND_MSG
31
- else
32
- super
33
- end
29
+ raise ::Invar::ImmutableRealityError, ::Invar::ImmutableRealityError::PRETEND_MSG if symbol == :pretend
30
+
31
+ super
34
32
  end
35
33
 
36
34
  # Returns a hash representation of this scope and subscopes.
data/lib/invar/test.rb CHANGED
@@ -1,16 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Specifically not calling require 'invar' here to force applications to need to include it themselves,
4
- # preventing the situation where test suites include application dependencies for them and breaking when
3
+ # Specifically not calling require 'invar' in this file to force applications to need to include it themselves,
4
+ # avoiding the situation where test suites include application dependencies for them and breaking when
5
5
  # the app is run without the test suite
6
6
 
7
+ # :nodoc:
7
8
  module Invar
8
9
  # Namespace module containing mixins for parts of the main gem to enable modifications and data control
9
10
  # in automated testing, while remaining immutable in the main gem and real runtime usage.
10
11
  module TestExtension
12
+ # Methods to extend the Reality class
11
13
  module RealityMethods
12
14
  class << self
13
15
  attr_accessor :__after_load_hooks__
16
+
14
17
  RealityMethods.__after_load_hooks__ = []
15
18
  end
16
19
 
data/lib/invar/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Invar
4
4
  # Current version of the gem
5
- VERSION = '0.7.0'
5
+ VERSION = '0.8.0'
6
6
  end
data/lib/invar.rb CHANGED
@@ -18,9 +18,9 @@ module Invar
18
18
  def method_missing(meth)
19
19
  if [:after_load, :clear_hooks].include? meth
20
20
  raise ::Invar::ImmutableRealityError, ::Invar::ImmutableRealityError::HOOK_MSG
21
- else
22
- super
23
21
  end
22
+
23
+ super
24
24
  end
25
25
  end
26
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: invar
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
  - Robin Miller
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-06 00:00:00.000000000 Z
11
+ date: 2023-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-schema
@@ -80,14 +80,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - ">="
82
82
  - !ruby/object:Gem::Version
83
- version: '2.7'
83
+ version: '3.1'
84
84
  required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - ">="
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  requirements: []
90
- rubygems_version: 3.4.10
90
+ rubygems_version: 3.4.18
91
91
  signing_key:
92
92
  specification_version: 4
93
93
  summary: Single source of truth for environmental configuration.