json_check 0.0.6 → 0.0.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 +4 -4
- data/lib/json_check.rb +13 -3
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23d7bd0145608705dc69dd3e11534d08667b50b8
|
4
|
+
data.tar.gz: 0bbf80443b2dbab4cd3229791216702fe9a1e2a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d87e9be5548d4793b92a2ba2d9da7f22cd6c2723faeacdb5e0bd016f2979f93315a7a87bda0d2f495652eddcb564c8bb1554d0aac0dd389f7f2a1890aac8504f
|
7
|
+
data.tar.gz: b812b9cb4123a0731354fd9b7ff66dd11affb0e8cac78890d5902828f17c112967b96178ea6bebfaeebf1df917e4f4f2f65880232265ed8756bcd97e603a3443
|
data/lib/json_check.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require "json"
|
4
3
|
require "net/http"
|
4
|
+
require "json"
|
5
5
|
require "uri"
|
6
6
|
|
7
7
|
module JSON_check
|
@@ -544,7 +544,17 @@ module JSON_check
|
|
544
544
|
def self.check_url arg, null
|
545
545
|
return true if null && arg.class == NilClass
|
546
546
|
return false unless arg.class == String
|
547
|
-
|
547
|
+
attempt = 0
|
548
|
+
begin
|
549
|
+
Timeout::timeout(2) { return false unless (/^((https?|ftp):\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})(\S*)*\/?$/ === arg.strip) }
|
550
|
+
rescue
|
551
|
+
attempt += 1
|
552
|
+
if attempt <=3
|
553
|
+
retry
|
554
|
+
else
|
555
|
+
return false
|
556
|
+
end
|
557
|
+
end
|
548
558
|
return true
|
549
559
|
end
|
550
560
|
|
@@ -707,4 +717,4 @@ module JSON_check
|
|
707
717
|
return true
|
708
718
|
end
|
709
719
|
|
710
|
-
end
|
720
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Motin Artem
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -72,9 +72,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
72
|
version: '0'
|
73
73
|
requirements: []
|
74
74
|
rubyforge_project:
|
75
|
-
rubygems_version: 2.4.
|
75
|
+
rubygems_version: 2.4.8
|
76
76
|
signing_key:
|
77
77
|
specification_version: 4
|
78
78
|
summary: Gem for check JSON.
|
79
79
|
test_files: []
|
80
|
-
has_rdoc:
|