invar 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 +4 -4
- data/.rubocop.yml +0 -12
- data/.ruby-version +1 -1
- data/Gemfile +10 -5
- data/RELEASE_NOTES.md +28 -0
- data/invar.gemspec +1 -1
- data/lib/invar/errors.rb +6 -4
- data/lib/invar/rake/tasks.rb +2 -2
- data/lib/invar/reality.rb +2 -1
- data/lib/invar/scope.rb +3 -5
- data/lib/invar/test.rb +5 -2
- data/lib/invar/version.rb +1 -1
- data/lib/invar.rb +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4826c528fc5940bcc955a1fc762abc2b4800a30eb4ce5b34af0ea313dd990ab
|
4
|
+
data.tar.gz: f463ed247adc47ea89d7b6965cd427d21a98de125271b262541eb0703a792d62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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-
|
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 '
|
10
|
-
gem '
|
11
|
+
gem 'rubocop', '~> 1.56'
|
12
|
+
gem 'rubocop-performance', '~> 1.19'
|
11
13
|
gem 'yard', '~> 0.9'
|
12
14
|
end
|
13
15
|
|
14
|
-
|
15
|
-
|
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 = '>=
|
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
|
-
|
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
|
data/lib/invar/rake/tasks.rb
CHANGED
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.
|
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
|
-
|
31
|
-
|
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'
|
4
|
-
#
|
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
data/lib/invar.rb
CHANGED
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.
|
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-
|
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: '
|
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.
|
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.
|