json_mend 0.1.5 → 0.1.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07b66923caace350f973a9c1882ccd7cb4736ea1b317d9c2697eda656c47bb24
4
- data.tar.gz: 1c62073a703652ad995f5ed919efb137ee4757115e8c3910a9afde15efb4d04b
3
+ metadata.gz: e52539860bdf2bf56f8a621ccb622547649cb178a3ff61deb3b345cc3704fb73
4
+ data.tar.gz: 4575c06664dfb59e559a883d0a9bac575250c074e9fde3a7a767a63d0f4a649c
5
5
  SHA512:
6
- metadata.gz: 4ffff33143278489424877d85a2a3b08a4bf6dd8db6688dc274025ac7bbd7fe12adbbbb1cfb14ccec4c4f4bfef6133b93238a6f76388663165a79d58dbedb297
7
- data.tar.gz: 83846b660a4fd41e5fe8e626366901890b27051fa9fd63a1b550ea2a49480b38b7354db8b347ef47d853f81a3d1ad9cca19e5114fc0be409507fe127d1299c09
6
+ metadata.gz: f88a854314da8e06e38dc85656a006d31c92daa08e016cf6f2a04ba1f560b2b182e15fdc7d786a2970d2a41ed70ef3275a40dc7770501db994ec645429272083
7
+ data.tar.gz: 6ea1af49216aebe97b7947b775d792f82b2de2feae72e08d5435bee797e108d060df6cb23f5d1939c0375e10ffc497d703c58979ca431cd06dc3bd201ff56309
data/.rubocop.yml CHANGED
@@ -38,6 +38,9 @@ Style/ArgumentsForwarding:
38
38
  Style/SymbolArray:
39
39
  EnforcedStyle: percent
40
40
 
41
+ RSpec/NestedGroups:
42
+ Max: 4
43
+
41
44
  Layout/LineLength:
42
45
  Max: 120
43
46
  AllowedPatterns: ['^ *# '] # allow longer comments
data/Rakefile CHANGED
@@ -2,11 +2,14 @@
2
2
 
3
3
  require 'bundler/gem_tasks'
4
4
  require 'rspec/core/rake_task'
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
5
  require 'rubocop/rake_task'
9
6
 
7
+ RSpec::Core::RakeTask.new(:spec)
10
8
  RuboCop::RakeTask.new
11
9
 
12
- task default: %i[rubocop spec]
10
+ desc 'Validate RBS files'
11
+ task :rbs_validate do
12
+ sh 'bundle exec rbs -I sig -r json -r strscan validate'
13
+ end
14
+
15
+ task default: %i[rbs_validate rubocop spec]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JsonMend
4
- VERSION = '0.1.5'
4
+ VERSION = '0.1.7'
5
5
  end
data/lib/json_mend.rb CHANGED
@@ -16,7 +16,11 @@ module JsonMend
16
16
  def repair(json_string, return_objects: false)
17
17
  # First, attempt to parse the string with the standard library.
18
18
  repaired_json = begin
19
- JSON.parse(json_string)
19
+ JSON.parse(
20
+ json_string,
21
+ allow_trailing_comma: true,
22
+ allow_control_characters: true
23
+ )
20
24
  rescue JSON::ParserError
21
25
  parser = Parser.new(json_string)
22
26
  parser.parse
data/sig/json_mend.rbs CHANGED
@@ -1,7 +1,7 @@
1
1
  module JsonMend
2
2
  VERSION: String
3
3
 
4
- type _JSONValue = String | Integer | Float | bool | nil | Array[_JSONValue] | Hash[String, _JSONValue]
4
+ type json_value = String | Integer | Float | bool | nil | Array[json_value] | Hash[String, json_value]
5
5
 
6
- def self.repair: (String, ?return_objects: bool) -> String | _JSONValue | nil
6
+ def self.repair: (String, ?return_objects: bool) -> (String | json_value | nil)
7
7
  end
data/sig/manifest.yaml ADDED
@@ -0,0 +1,3 @@
1
+ dependencies:
2
+ - name: json
3
+ - name: strscan
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_mend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleksii Vasyliev
@@ -59,6 +59,7 @@ files:
59
59
  - lib/json_mend/parser.rb
60
60
  - lib/json_mend/version.rb
61
61
  - sig/json_mend.rbs
62
+ - sig/manifest.yaml
62
63
  homepage: https://github.com/le0pard/json_mend
63
64
  licenses:
64
65
  - MIT