frise 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/CI.yml +14 -4
- data/.gitignore +1 -1
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +71 -0
- data/LICENSE.txt +1 -1
- data/README.md +2 -2
- data/frise.gemspec +1 -1
- data/lib/frise/validator.rb +10 -1
- data/lib/frise/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1faacd4d96a4fcdaaa2133b658a422a1c5e232d33592d99429dc57f2e540162b
|
4
|
+
data.tar.gz: 2e36a6db49fb71cff79c0a60c255703f41bf08d7e2779c86b4530cc813082cac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72b08fa1c24a177b8c8fe1086e2eb7782faa1b9b08346080cec5b609577704375e31631d8bfc1c962c7c7d6f81f9b0af38d6aefe2350c117ac6c7a425479cf3e
|
7
|
+
data.tar.gz: 4115d96508ceeebbf472bc845285334c47b70ec3318e567442fbea3720f41dafabfc6b92910f9212eeb3b5473f60488b69c89f57cc1339f63f0b10aa6dc33570
|
data/.github/workflows/CI.yml
CHANGED
@@ -9,10 +9,15 @@ jobs:
|
|
9
9
|
strategy:
|
10
10
|
fail-fast: false
|
11
11
|
matrix:
|
12
|
-
ruby:
|
12
|
+
ruby:
|
13
|
+
- '2.6'
|
14
|
+
- '2.7'
|
15
|
+
- '3.0'
|
16
|
+
- '3.1'
|
17
|
+
- '3.2'
|
13
18
|
|
14
19
|
steps:
|
15
|
-
- uses: actions/checkout@
|
20
|
+
- uses: actions/checkout@v3
|
16
21
|
- name: Set up Ruby
|
17
22
|
uses: ruby/setup-ruby@v1
|
18
23
|
with:
|
@@ -24,8 +29,10 @@ jobs:
|
|
24
29
|
run: bundle exec rake
|
25
30
|
- name: Coveralls Parallel
|
26
31
|
uses: coverallsapp/github-action@master
|
32
|
+
env:
|
33
|
+
# We're concatenating the run ID with the run attempt so that each run has a different ID for Coveralls.
|
34
|
+
COVERALLS_SERVICE_JOB_ID: '${{ github.run_id }} ${{ github.run_attempt }}'
|
27
35
|
with:
|
28
|
-
github-token: ${{ secrets.github_token }}
|
29
36
|
flag-name: ${{ matrix.ruby }}
|
30
37
|
parallel: true
|
31
38
|
|
@@ -35,6 +42,9 @@ jobs:
|
|
35
42
|
steps:
|
36
43
|
- name: Coveralls Finished
|
37
44
|
uses: coverallsapp/github-action@master
|
45
|
+
env:
|
46
|
+
# We're concatenating the run ID with the run attempt so that each run has a different ID for Coveralls.
|
47
|
+
COVERALLS_SERVICE_JOB_ID: '${{ github.run_id }} ${{ github.run_attempt }}'
|
38
48
|
with:
|
39
|
-
github-token: ${{ secrets.github_token }}
|
40
49
|
parallel-finished: true
|
50
|
+
carryforward: '2.6,2.7,3.0,3.1,3.2'
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
frise (0.6.1.pre)
|
5
|
+
liquid (~> 5.3.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
ast (2.4.2)
|
11
|
+
diff-lcs (1.5.0)
|
12
|
+
docile (1.4.0)
|
13
|
+
liquid (5.3.0)
|
14
|
+
parallel (1.23.0)
|
15
|
+
parser (3.2.2.3)
|
16
|
+
ast (~> 2.4.1)
|
17
|
+
racc
|
18
|
+
racc (1.7.0)
|
19
|
+
rainbow (3.1.1)
|
20
|
+
rake (13.0.6)
|
21
|
+
regexp_parser (2.8.1)
|
22
|
+
rexml (3.2.5)
|
23
|
+
rspec (3.12.0)
|
24
|
+
rspec-core (~> 3.12.0)
|
25
|
+
rspec-expectations (~> 3.12.0)
|
26
|
+
rspec-mocks (~> 3.12.0)
|
27
|
+
rspec-core (3.12.2)
|
28
|
+
rspec-support (~> 3.12.0)
|
29
|
+
rspec-expectations (3.12.3)
|
30
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
31
|
+
rspec-support (~> 3.12.0)
|
32
|
+
rspec-mocks (3.12.5)
|
33
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
34
|
+
rspec-support (~> 3.12.0)
|
35
|
+
rspec-support (3.12.0)
|
36
|
+
rubocop (1.10.0)
|
37
|
+
parallel (~> 1.10)
|
38
|
+
parser (>= 3.0.0.0)
|
39
|
+
rainbow (>= 2.2.2, < 4.0)
|
40
|
+
regexp_parser (>= 1.8, < 3.0)
|
41
|
+
rexml
|
42
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
43
|
+
ruby-progressbar (~> 1.7)
|
44
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
45
|
+
rubocop-ast (1.29.0)
|
46
|
+
parser (>= 3.2.1.0)
|
47
|
+
ruby-progressbar (1.13.0)
|
48
|
+
simplecov (0.22.0)
|
49
|
+
docile (~> 1.1)
|
50
|
+
simplecov-html (~> 0.11)
|
51
|
+
simplecov_json_formatter (~> 0.1)
|
52
|
+
simplecov-html (0.12.3)
|
53
|
+
simplecov-lcov (0.8.0)
|
54
|
+
simplecov_json_formatter (0.1.4)
|
55
|
+
unicode-display_width (2.4.2)
|
56
|
+
|
57
|
+
PLATFORMS
|
58
|
+
arm64-darwin-22
|
59
|
+
x86_64-linux
|
60
|
+
|
61
|
+
DEPENDENCIES
|
62
|
+
bundler (~> 2.0)
|
63
|
+
frise!
|
64
|
+
rake (~> 13.0)
|
65
|
+
rspec (~> 3.9)
|
66
|
+
rubocop (~> 1.10.0)
|
67
|
+
simplecov (~> 0.18)
|
68
|
+
simplecov-lcov (= 0.8.0)
|
69
|
+
|
70
|
+
BUNDLED WITH
|
71
|
+
2.4.12
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Frise
|
2
|
-
[![Build Status](https://
|
3
|
-
[![Coverage Status](https://coveralls.io/repos/github/
|
2
|
+
[![Build Status](https://github.com/adzerk/frise/actions/workflows/CI.yml/badge.svg?branch=master)](https://github.com/adzerk/frise/actions/workflows/CI.yml)
|
3
|
+
[![Coverage Status](https://coveralls.io/repos/github/adzerk/frise/badge.svg?branch=master)](https://coveralls.io/github/adzerk/frise?branch=master)
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/frise.svg)](https://badge.fury.io/rb/frise)
|
5
5
|
|
6
6
|
Frise is a library for loading configuration files as native Ruby structures. Besides reading and
|
data/frise.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
26
26
|
spec.add_development_dependency 'rake', '~> 13.0'
|
27
27
|
spec.add_development_dependency 'rspec', '~> 3.9'
|
28
|
-
spec.add_development_dependency 'rubocop', '~> 1.10'
|
28
|
+
spec.add_development_dependency 'rubocop', '~> 1.10.0'
|
29
29
|
spec.add_development_dependency 'simplecov', '~> 0.18'
|
30
30
|
spec.add_development_dependency 'simplecov-lcov', '0.8.0'
|
31
31
|
spec.metadata['rubygems_mfa_required'] = 'true'
|
data/lib/frise/validator.rb
CHANGED
@@ -36,7 +36,7 @@ module Frise
|
|
36
36
|
def get_full_schema(schema)
|
37
37
|
case schema
|
38
38
|
when Hash
|
39
|
-
default_type = schema[:enum] || schema[:one_of] ? 'Object' : 'Hash'
|
39
|
+
default_type = schema[:enum] || schema[:one_of] || schema.key?(:constant) ? 'Object' : 'Hash'
|
40
40
|
{ type: default_type }.merge(schema)
|
41
41
|
when Symbol then { type: 'Object', validate: schema }
|
42
42
|
when Array
|
@@ -114,6 +114,14 @@ module Frise
|
|
114
114
|
true
|
115
115
|
end
|
116
116
|
|
117
|
+
def validate_constant(full_schema, obj, path)
|
118
|
+
if full_schema.key?(:constant) && full_schema[:constant] != obj
|
119
|
+
add_validation_error(path, "invalid value #{obj.inspect}. " \
|
120
|
+
"The only accepted value is #{full_schema[:constant]}")
|
121
|
+
end
|
122
|
+
true
|
123
|
+
end
|
124
|
+
|
117
125
|
def validate_spec_keys(full_schema, obj, path, processed_keys)
|
118
126
|
full_schema.each do |spec_key, spec_value|
|
119
127
|
next if spec_key.is_a?(Symbol)
|
@@ -149,6 +157,7 @@ module Frise
|
|
149
157
|
return unless validate_custom(full_schema, obj, path)
|
150
158
|
return unless validate_enum(full_schema, obj, path)
|
151
159
|
return unless validate_one_of(full_schema, obj, path)
|
160
|
+
return unless validate_constant(full_schema, obj, path)
|
152
161
|
|
153
162
|
processed_keys = Set.new
|
154
163
|
return unless validate_spec_keys(full_schema, obj, path, processed_keys)
|
data/lib/frise/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: frise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Velocidi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 1.10.0
|
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:
|
82
|
+
version: 1.10.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: simplecov
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -121,6 +121,7 @@ files:
|
|
121
121
|
- ".rubocop.yml"
|
122
122
|
- CHANGELOG.md
|
123
123
|
- Gemfile
|
124
|
+
- Gemfile.lock
|
124
125
|
- LICENSE.txt
|
125
126
|
- README.md
|
126
127
|
- Rakefile
|
@@ -154,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
155
|
- !ruby/object:Gem::Version
|
155
156
|
version: '0'
|
156
157
|
requirements: []
|
157
|
-
rubygems_version: 3.
|
158
|
+
rubygems_version: 3.4.12
|
158
159
|
signing_key:
|
159
160
|
specification_version: 4
|
160
161
|
summary: Ruby config library with schema validation, default values and templating
|