yaml_structure_checker 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +18 -8
- data/exe/yaml_structure_checker +1 -1
- data/lib/yaml_structure_checker/checker.rb +3 -3
- data/lib/yaml_structure_checker/converter.rb +1 -1
- data/lib/yaml_structure_checker/errors.rb +1 -1
- data/lib/yaml_structure_checker/loader.rb +5 -5
- data/lib/yaml_structure_checker/runner.rb +1 -1
- data/lib/yaml_structure_checker/version.rb +2 -2
- data/sig/yaml_structure_checker.rbs +1 -1
- data/yaml_structure_checker.gemspec +39 -0
- data/yaml_structure_checker.png +0 -0
- metadata +9 -8
- data/LICENSE.txt +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c38cb26e3b2a6f824f9389805104bcddd59bc303d9293d687a9263eebf5f7ff
|
4
|
+
data.tar.gz: c0d8317b0de539c992d4e7a2819fff410ee490576002451285f59e5adcbc8e52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7af40b7d4a6bb86a6323e56afc2bd1f2b1d7c8fafd02c919de3764f761687ce6fc1b6368b7c6381ec2af31f9bb91fd0a949994acd2d771bd461d2ff91fc343f7
|
7
|
+
data.tar.gz: 2e5d869036f22461cc4367f7b676768823d0d65209e8d6d47ef52f47c907e48bcede840a3112ff307b2a277c0c77ba23964e3276e311e37c792242d6be19f4c2
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,13 @@
|
|
1
|
-
|
1
|
+
![thumbnail](yaml_structure_checker.png)
|
2
|
+
|
3
|
+
# YAML structure checker
|
2
4
|
|
3
5
|
This Gem can detect that the keys in the yaml file do not match for each environment.
|
4
6
|
|
5
7
|
This prevents cases where errors occur only in the production environment.
|
6
8
|
|
9
|
+
It works powerfully in Rails, but of course it can be used in other applications as well.
|
10
|
+
|
7
11
|
The following is an example
|
8
12
|
|
9
13
|
```yaml
|
@@ -72,7 +76,7 @@ $ gem install yaml_structure_checker
|
|
72
76
|
|
73
77
|
Add the configuration file `config/yaml_structure_checker.yml`.
|
74
78
|
|
75
|
-
|
79
|
+
YAML structure checker loads `config/yaml_structure_checker.yml` by default.
|
76
80
|
|
77
81
|
An example follows
|
78
82
|
|
@@ -101,13 +105,13 @@ skip_paths:
|
|
101
105
|
|
102
106
|
### Check yaml files
|
103
107
|
|
104
|
-
Run the `yaml_structure_checker` command to check your
|
108
|
+
Run the `yaml_structure_checker` command to check your YAML files.
|
105
109
|
|
106
110
|
```bash
|
107
111
|
$ bundle exec yaml_structure_checker
|
108
112
|
|
109
113
|
#################################
|
110
|
-
#
|
114
|
+
# YAML Structure Check #
|
111
115
|
#################################
|
112
116
|
|
113
117
|
Exclude paths:
|
@@ -127,7 +131,7 @@ Result: OK
|
|
127
131
|
Result: OK
|
128
132
|
|
129
133
|
#################################
|
130
|
-
#
|
134
|
+
# YAML Structure Check Result #
|
131
135
|
#################################
|
132
136
|
|
133
137
|
NG paths:
|
@@ -167,7 +171,7 @@ jobs:
|
|
167
171
|
- uses: actions/checkout@v2
|
168
172
|
- name: Bundle install
|
169
173
|
run: bundle install --path=vendor/bundle --jobs 4 --retry 3
|
170
|
-
- name:
|
174
|
+
- name: YAML structure checker
|
171
175
|
run: bundle exec yaml_structure_checker
|
172
176
|
```
|
173
177
|
|
@@ -177,9 +181,15 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
177
181
|
|
178
182
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
179
183
|
|
184
|
+
Also, you can use Docker.
|
185
|
+
|
186
|
+
```bash
|
187
|
+
docker-compose run --rm app /bin/bash
|
188
|
+
```
|
189
|
+
|
180
190
|
## Contributing
|
181
191
|
|
182
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
192
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/yosipy/yaml_structure_checker. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/yosipy/yaml_structure_checker/blob/master/CODE_OF_CONDUCT.md).
|
183
193
|
|
184
194
|
## License
|
185
195
|
|
@@ -187,4 +197,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
187
197
|
|
188
198
|
## Code of Conduct
|
189
199
|
|
190
|
-
Everyone interacting in the
|
200
|
+
Everyone interacting in the YAMLStructureChecker project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/yosipy/yaml_structure_checker/blob/master/CODE_OF_CONDUCT.md).
|
data/exe/yaml_structure_checker
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module YAMLStructureChecker
|
2
2
|
class Checker
|
3
3
|
attr_accessor :ok_count,
|
4
4
|
:ng_count,
|
@@ -110,14 +110,14 @@ module YamlStructureChecker
|
|
110
110
|
|
111
111
|
def print_start_title
|
112
112
|
puts "#################################"
|
113
|
-
puts "#
|
113
|
+
puts "# YAML Structure Check #"
|
114
114
|
puts "#################################"
|
115
115
|
puts "\n"
|
116
116
|
end
|
117
117
|
|
118
118
|
def print_result_title
|
119
119
|
puts "#################################"
|
120
|
-
puts "#
|
120
|
+
puts "# YAML Structure Check Result #"
|
121
121
|
puts "#################################"
|
122
122
|
puts "\n"
|
123
123
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'yaml'
|
2
2
|
|
3
|
-
module
|
3
|
+
module YAMLStructureChecker
|
4
4
|
class Loader
|
5
5
|
attr_accessor :include_patterns,
|
6
6
|
:exclude_patterns,
|
@@ -12,7 +12,7 @@ module YamlStructureChecker
|
|
12
12
|
begin
|
13
13
|
Loader.yaml_safe_load_file(settings_path)
|
14
14
|
rescue => e
|
15
|
-
puts "Not found
|
15
|
+
puts "Not found YAMLStructureChecker's settings file."
|
16
16
|
raise e
|
17
17
|
end
|
18
18
|
|
@@ -25,7 +25,7 @@ module YamlStructureChecker
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def self.yaml_load_file(path)
|
28
|
-
if
|
28
|
+
if Psych::VERSION > '4.0.0'
|
29
29
|
YAML.load_file(path, aliases: true)
|
30
30
|
else
|
31
31
|
YAML.load_file(path)
|
@@ -33,7 +33,7 @@ module YamlStructureChecker
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def self.yaml_safe_load_file(path)
|
36
|
-
if
|
36
|
+
if Psych::VERSION > '4.0.0'
|
37
37
|
YAML.safe_load_file(path)
|
38
38
|
else
|
39
39
|
YAML.load_file(path)
|
@@ -69,7 +69,7 @@ module YamlStructureChecker
|
|
69
69
|
def exist_files?(paths)
|
70
70
|
paths.each do |path|
|
71
71
|
unless File.exist?(path)
|
72
|
-
raise
|
72
|
+
raise YAMLStructureChecker::Errors::LoaderError, "Not found '#{path}'"
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/yaml_structure_checker/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "yaml_structure_checker"
|
7
|
+
spec.version = YAMLStructureChecker::VERSION
|
8
|
+
spec.authors = ["yosipy"]
|
9
|
+
spec.email = ["yosi.contact@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = "YAML structure checker in ruby"
|
12
|
+
spec.description = "This Gem can detect that the keys in the yaml file do not match for each environment. This prevents cases where errors occur only in the production environment."
|
13
|
+
spec.homepage = "https://github.com/yosipy/yaml_structure_checker"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.required_ruby_version = ">= 2.6.0"
|
16
|
+
|
17
|
+
# spec.metadata["allowed_push_host"] = ""
|
18
|
+
|
19
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
20
|
+
spec.metadata["source_code_uri"] = "https://github.com/yosipy/yaml_structure_checker"
|
21
|
+
spec.metadata["changelog_uri"] = "https://github.com/yosipy/yaml_structure_checker/blob/main/CHANGELOG.md"
|
22
|
+
|
23
|
+
# Specify which files should be added to the gem when it is released.
|
24
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
25
|
+
spec.files = Dir.chdir(__dir__) do
|
26
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
27
|
+
(File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor])
|
28
|
+
end
|
29
|
+
end
|
30
|
+
spec.bindir = "exe"
|
31
|
+
spec.executables = %w[yaml_structure_checker]
|
32
|
+
spec.require_paths = ["lib"]
|
33
|
+
|
34
|
+
# Uncomment to register a new dependency of your gem
|
35
|
+
# spec.add_dependency "example-gem", "~> 1.0"
|
36
|
+
|
37
|
+
# For more information and examples about making a new gem, check out our
|
38
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
39
|
+
end
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yaml_structure_checker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yosipy
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: This Gem can detect that the keys in the yaml file do not match for each
|
14
14
|
environment. This prevents cases where errors occur only in the production environment.
|
@@ -26,7 +26,6 @@ files:
|
|
26
26
|
- Gemfile
|
27
27
|
- Gemfile.lock
|
28
28
|
- LICENSE
|
29
|
-
- LICENSE.txt
|
30
29
|
- README.md
|
31
30
|
- Rakefile
|
32
31
|
- docker-compose.yml
|
@@ -39,6 +38,8 @@ files:
|
|
39
38
|
- lib/yaml_structure_checker/runner.rb
|
40
39
|
- lib/yaml_structure_checker/version.rb
|
41
40
|
- sig/yaml_structure_checker.rbs
|
41
|
+
- yaml_structure_checker.gemspec
|
42
|
+
- yaml_structure_checker.png
|
42
43
|
homepage: https://github.com/yosipy/yaml_structure_checker
|
43
44
|
licenses:
|
44
45
|
- MIT
|
@@ -46,7 +47,7 @@ metadata:
|
|
46
47
|
homepage_uri: https://github.com/yosipy/yaml_structure_checker
|
47
48
|
source_code_uri: https://github.com/yosipy/yaml_structure_checker
|
48
49
|
changelog_uri: https://github.com/yosipy/yaml_structure_checker/blob/main/CHANGELOG.md
|
49
|
-
post_install_message:
|
50
|
+
post_install_message:
|
50
51
|
rdoc_options: []
|
51
52
|
require_paths:
|
52
53
|
- lib
|
@@ -61,8 +62,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
62
|
- !ruby/object:Gem::Version
|
62
63
|
version: '0'
|
63
64
|
requirements: []
|
64
|
-
rubygems_version: 3.
|
65
|
-
signing_key:
|
65
|
+
rubygems_version: 3.1.4
|
66
|
+
signing_key:
|
66
67
|
specification_version: 4
|
67
|
-
summary:
|
68
|
+
summary: YAML structure checker in ruby
|
68
69
|
test_files: []
|
data/LICENSE.txt
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2023 TODO: Write your name
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|