motion-yaml 1.5.1 → 1.5.2
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/YAMLKit/libYAMLKit_OSX.a +0 -0
- data/lib/YAMLKit/libYAMLKit_iOS.a +0 -0
- data/lib/project/scanner.rb +16 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02fb72a0ae209f234447deb8200f592c3f48e839
|
4
|
+
data.tar.gz: 56fd3084df351dff849bd356eaed7477d0ce5a3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c27dfb0fc1de58a0195b004278beb7ee4f97bfcd100a6e47aacaa18ac847d278d332ae2ed31979396286d1fa337de9acdcd990744eb2cb116058ce7f9bd94aa
|
7
|
+
data.tar.gz: 3bfb0f3b4cb89e4e4b2dbb74559c84963cd8cb4af065c4c207801ee6c0539338a470acb94f5b36eaa3081b165c65b85ce019632ee4d0cd1891ee7849f165629c
|
Binary file
|
Binary file
|
data/lib/project/scanner.rb
CHANGED
@@ -34,10 +34,10 @@ class YAMLKitScanner
|
|
34
34
|
|\.(nan|NaN|NAN)(?# not a number))$/x
|
35
35
|
|
36
36
|
# http://yaml.org/type/int.html
|
37
|
-
INTEGER = /^(?:[-+]?0b[0-1_]+ (?# base 2)
|
38
|
-
|[-+]?0[0-7_]+ (?# base 8)
|
39
|
-
|[-+]?(?:0|[1-9][0-9_]*) (?# base 10)
|
40
|
-
|[-+]?0x[0-9a-fA-F_]+ (?# base 16))$/x
|
37
|
+
INTEGER = /^(?:[-+]?0b[0-1_,]+ (?# base 2)
|
38
|
+
|[-+]?0[0-7_,]+ (?# base 8)
|
39
|
+
|[-+]?(?:0|[1-9][0-9_,]*) (?# base 10)
|
40
|
+
|[-+]?0x[0-9a-fA-F_,]+ (?# base 16))$/x
|
41
41
|
|
42
42
|
# Tokenize string returning the Ruby object
|
43
43
|
# NOTE: This method will be called from Objective-C.
|
@@ -55,18 +55,24 @@ class YAMLKitScanner
|
|
55
55
|
string = $1
|
56
56
|
end
|
57
57
|
string.to_sym
|
58
|
-
when INTEGER
|
59
|
-
Integer(string.gsub(/_/, ''))
|
60
|
-
when FLOAT
|
61
|
-
Float(string.gsub(/_/, ''))
|
62
|
-
when TIME
|
63
|
-
self.parse_time(string)
|
64
58
|
when /^[-+]?[0-9][0-9_]*(:[0-5]?[0-9])+$/
|
65
59
|
i = 0
|
66
60
|
string.split(':').each_with_index do |n,e|
|
67
61
|
i += (n.to_i * 60 ** (e - 2).abs)
|
68
62
|
end
|
69
63
|
i
|
64
|
+
when /^[-+]?[0-9][0-9_]*(:[0-5]?[0-9])+\.[0-9_]*$/
|
65
|
+
i = 0
|
66
|
+
string.split(':').each_with_index do |n,e|
|
67
|
+
i += (n.to_f * 60 ** (e - 2).abs)
|
68
|
+
end
|
69
|
+
i
|
70
|
+
when INTEGER
|
71
|
+
Integer(string.gsub(/[,_]/, ''))
|
72
|
+
when FLOAT
|
73
|
+
Float(string.gsub(/[,_]/, ''))
|
74
|
+
when TIME
|
75
|
+
self.parse_time(string)
|
70
76
|
when /^(yes|y|true|on)$/i
|
71
77
|
true
|
72
78
|
when /^(no|n|false|off)$/i
|