form_stalker 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/form_stalker/data/check_logic.rb +10 -13
- data/lib/form_stalker/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d96318616918fc4c3cf5c6760c6f57f51584dc0
|
4
|
+
data.tar.gz: 81404c17b4881c0febe23dbcca08eb6f93350021
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84e8abd04e8648bd8f03b054d4d84b925c060bdbfa28846976700699b9457086da41824e1300fbe62a0f4948057428829d765709402b008030cc679592af42ec
|
7
|
+
data.tar.gz: 807927350b715b584440ed5be4ace08943191195ee4a76e9fb8e8dc420a9febaa65d8b70ab827eceaacfe54c803b876734e24ce2f0cdfeafbaa3012c6788cef0
|
@@ -24,26 +24,23 @@ module FormStalker
|
|
24
24
|
protected ####################### PROTECTED ##############################
|
25
25
|
|
26
26
|
def js_to_json(js_object)
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
json_converted_keys = convert_keys(js_object)
|
28
|
+
|
29
|
+
convert_values(json_converted_keys)
|
30
30
|
end
|
31
31
|
|
32
32
|
private ######################### PRIVATE ################################
|
33
33
|
|
34
|
-
def
|
35
|
-
js_object
|
36
|
-
.split(/(,)(?=(?:[^']|'[^']*')*$)/)
|
37
|
-
.reject { |string| string == ',' }
|
34
|
+
def convert_keys(js_object)
|
35
|
+
js_object.gsub(/([a-zA-Z]+):/, '"\1":')
|
38
36
|
end
|
39
37
|
|
40
|
-
def
|
41
|
-
|
42
|
-
|
43
|
-
.gsub('{', '{"')
|
44
|
-
.gsub(':', '":')
|
38
|
+
def convert_values(js_object)
|
39
|
+
js_object.gsub(/'(.*?(?<!\\))'/) do |match|
|
40
|
+
value = match.gsub(/^'/, '').gsub(/'$/, '')
|
45
41
|
|
46
|
-
|
42
|
+
"\"#{value}\""
|
43
|
+
end
|
47
44
|
end
|
48
45
|
end
|
49
46
|
end
|
data/lib/form_stalker/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: form_stalker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- StreetBees Dev Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: vcr
|