json_checker 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c1eda9d2c67208e7ba50526054b2332efc1168a
4
- data.tar.gz: 7077d4f7c8035a28fe209ced104c74b5c2d912fc
3
+ metadata.gz: 5d2f8126ee3aa2b4f617dd46c8c1c003cf206482
4
+ data.tar.gz: 0d9d0b8b3d97cab82ec8500c82591e117501f50a
5
5
  SHA512:
6
- metadata.gz: e6a8f0ec83310635b57be3b3f0bd4d003914d39a01bf11710daf10dbea089cf9fecedfabc9119a1517ad62b386d19c5f97c29a921cb2cd7c4e74e58aa2a0f157
7
- data.tar.gz: 6fb8fd9dce3ab9996d6f3a9302a84a504eb1739e842ca2f57524e635086bf316c9851257b918ff16b47c3b056504bb7e8a65537d887cfdcbbcce67c49b3ed1bb
6
+ metadata.gz: cdca01ea2f04f456c45c57dbb361d42fed8cb3efa108f784c1a7bfb956a7404eafcdf4d2c43d1f6244cf946b5ad5e9757de85e1ef9b4969575966d85ce342187
7
+ data.tar.gz: ec96cad002b57bfdceb6e8f6517e515b4bd00a474eafe5bdef5cfb65b5302a2c37d134fe73b1717a5ae2df82f10a234a5606a497cf8f9c70d82d7cdadcf0c70c
@@ -1,6 +1,8 @@
1
+ require 'fileutils'
2
+
1
3
  module JsonChecker
2
4
  class HTMLOutput
3
-
5
+
4
6
  def self.add_validation_item(title, values)
5
7
 
6
8
  if title.nil? || values.nil? || !values.is_a?(Array)
@@ -32,7 +34,7 @@ module JsonChecker
32
34
  def self.generate_output(output_path)
33
35
  htmlOutput = HTMLOutput.new()
34
36
  output = "<html>" + htmlOutput.add_style() + "<body>"
35
- @reportItems.each do |item|
37
+ @reportItems.each do |item|
36
38
  output << item
37
39
  end
38
40
  output << "</body></html>"
@@ -45,12 +47,12 @@ module JsonChecker
45
47
  @reportItems = Array.new()
46
48
  end
47
49
  @reportItems << item
48
- end
50
+ end
49
51
 
50
52
  def add_style()
51
53
  return "
52
54
  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
53
- <style>
55
+ <style>
54
56
  .addition { background: #eaffea; }
55
57
  .remotion { background: #ffecec; }
56
58
  .diff { outline: 1px solid #eff0d6; margin: 5px; padding-top: 5px; padding-bottom: 5px; }
@@ -66,19 +68,20 @@ module JsonChecker
66
68
  end
67
69
 
68
70
  def save_to_file(report, output_path)
69
-
71
+
70
72
  path = "output.html"
71
-
73
+
72
74
  unless output_path.nil?
73
75
  path = output_path
74
76
  end
75
-
77
+
76
78
  if report.nil?
77
79
  puts "[ERROR] Invalid report"
78
80
  else
81
+ FileUtils.mkdir_p(File.dirname(path))
79
82
  File.write(path, report)
80
83
  end
81
84
  end
82
85
 
83
86
  end
84
- end
87
+ end
@@ -1,3 +1,3 @@
1
1
  module JsonChecker
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  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.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cícero Duarte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-20 00:00:00.000000000 Z
11
+ date: 2017-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler