json_checker 0.1.0 → 0.1.1
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 +8 -8
- data/.coveralls.yml +1 -0
- data/README.md +4 -5
- data/bin/json_checker +7 -0
- data/json_checker.gemspec +3 -2
- data/lib/json_checker/html_output.rb +10 -4
- data/lib/json_checker/json_comparator.rb +0 -1
- data/lib/json_checker/version.rb +1 -1
- data/lib/json_checker.rb +8 -5
- metadata +21 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NmU2YjE3NTcxMTE3Y2U1Y2ViYWE1MGM0ZmZhMGE0MTZjZGRlYWI3Nw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NTA0ZTdmY2JkODI0OWRkYzkwYzc2NDU4NjMxOGZlNDZiMWZhMmEwMg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZGVlZWQwOTAxMzg4ZTY3ZmEzNjk1NDM2NDdmOTcwMjhhODgwMmYwMjBlZGI5
|
10
|
+
NTA3ZjdkNTc5Y2FjYjViZjEzNDYzMGI2YzQ4YmU0MmVhNjRiMWQ0MmZiZjBi
|
11
|
+
ZjJlNWVmZjI4ODJlMTdmYjUxZTAyMmIzMjA2ZTYwN2JjZjRlMWI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGFlOWQwNmYwNGExOGEzMzE0NWUwMWNlOGQ3YjY4MjQ0MWQ0OWIzMmVlMjg5
|
14
|
+
MzI1Y2IxNDk1ZjVjZWJlMzlmNTZjMDMwOGNjOTJkMGYwMWQwMGQ2MzRjN2Y0
|
15
|
+
NDYxNzVlOTkwOWZkNGNjNTNjMzAwYTU5MjU5YzVlMzhmNGRjMzY=
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: travis-ci
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# JsonChecker
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
[](https://raw.githubusercontent.com/hyperium/hyper/master/LICENSE)
|
4
|
+
[](https://travis-ci.org/ciceroduarte/json_checker)
|
5
|
+
[](https://coveralls.io/github/ciceroduarte/json_checker?branch=master)
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -37,5 +37,4 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/cicero
|
|
37
37
|
|
38
38
|
## License
|
39
39
|
|
40
|
-
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
-
|
40
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/bin/json_checker
ADDED
data/json_checker.gemspec
CHANGED
@@ -16,12 +16,13 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
17
17
|
f.match(%r{^(test|spec|features)/})
|
18
18
|
end
|
19
|
-
spec.
|
20
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.executables = ["json_checker"]
|
21
20
|
spec.require_paths = ["lib"]
|
22
21
|
|
23
22
|
spec.add_development_dependency "bundler", "~> 1.14"
|
24
23
|
spec.add_development_dependency "rake", "~> 10.0"
|
25
24
|
spec.add_development_dependency "rspec", "~> 3.0"
|
26
25
|
spec.add_development_dependency "diffy", "3.1.0"
|
26
|
+
spec.add_development_dependency "coveralls"
|
27
|
+
|
27
28
|
end
|
@@ -2,6 +2,11 @@ module JsonChecker
|
|
2
2
|
class HTMLOutput
|
3
3
|
|
4
4
|
def self.add_validation_item(title, values)
|
5
|
+
|
6
|
+
if title.nil? || values.nil? || !values.is_a?(Array)
|
7
|
+
return
|
8
|
+
end
|
9
|
+
|
5
10
|
item = "<h2>#{title}</h2>"
|
6
11
|
item << "<div class=\"validation\" style=\"overflow-x:auto;\">
|
7
12
|
<table><tr><th>Status</th><th>Key</th><th>Expected</th><th>Value</th></tr>"
|
@@ -20,6 +25,11 @@ module JsonChecker
|
|
20
25
|
end
|
21
26
|
|
22
27
|
def self.add_comparation_item(title, json)
|
28
|
+
|
29
|
+
if title.nil? || json.nil?
|
30
|
+
return
|
31
|
+
end
|
32
|
+
|
23
33
|
item = "<h2>#{title}</h2>" + "<div class=\"diff\">" + json + "</div>"
|
24
34
|
if @reportItems.nil?
|
25
35
|
@reportItems = Array.new()
|
@@ -27,10 +37,6 @@ module JsonChecker
|
|
27
37
|
@reportItems << item
|
28
38
|
end
|
29
39
|
|
30
|
-
def self.testandoHTML()
|
31
|
-
puts @reportItems
|
32
|
-
end
|
33
|
-
|
34
40
|
def self.generate_output()
|
35
41
|
htmlOutput = HTMLOutput.new()
|
36
42
|
output = "<html>" + htmlOutput.add_style() + "<body>"
|
data/lib/json_checker/version.rb
CHANGED
data/lib/json_checker.rb
CHANGED
@@ -3,10 +3,13 @@ require 'json_checker/json_fetcher'
|
|
3
3
|
require 'json_checker/json_validator'
|
4
4
|
|
5
5
|
module JsonChecker
|
6
|
+
class Checker
|
7
|
+
def run()
|
8
|
+
jsonConfig = JSONFetcher.json_from_path('json-config.json')
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
10
|
+
unless jsonConfig.nil?
|
11
|
+
JSONValidator.validate_with_config(jsonConfig)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
12
15
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_checker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cícero Duarte
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,13 +66,29 @@ dependencies:
|
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 3.1.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: coveralls
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
description:
|
70
84
|
email:
|
71
85
|
- ciceroduarte1@gmail.com
|
72
|
-
executables:
|
86
|
+
executables:
|
87
|
+
- json_checker
|
73
88
|
extensions: []
|
74
89
|
extra_rdoc_files: []
|
75
90
|
files:
|
91
|
+
- .coveralls.yml
|
76
92
|
- .gitignore
|
77
93
|
- .rspec
|
78
94
|
- .travis.yml
|
@@ -83,6 +99,7 @@ files:
|
|
83
99
|
- README.md
|
84
100
|
- Rakefile
|
85
101
|
- bin/console
|
102
|
+
- bin/json_checker
|
86
103
|
- bin/setup
|
87
104
|
- json-config.json
|
88
105
|
- json_checker.gemspec
|