motion-yaml 1.5.1 → 1.5.2

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: c82e597938f1f2a457efdeb88073b11928729a57
4
- data.tar.gz: eb9d45b754596ba5f3b44baa216350a6f4abb0e7
3
+ metadata.gz: 02fb72a0ae209f234447deb8200f592c3f48e839
4
+ data.tar.gz: 56fd3084df351dff849bd356eaed7477d0ce5a3c
5
5
  SHA512:
6
- metadata.gz: b6d0978c4704a4d4422eb9d6e978e98991f395bf846404a9a8e2e557509e59afba64c20e32b0afd429ea6f77fecd9712468cf13982b6045553d369ba38ea2a85
7
- data.tar.gz: 9000183b5778e36d4d052a268e4b0efe73aa225736df9e0b589a19125844a294a019a95952a95c9c1718be40a33c2371f4a8607825681e1a47539c6f0dc85218
6
+ metadata.gz: 1c27dfb0fc1de58a0195b004278beb7ee4f97bfcd100a6e47aacaa18ac847d278d332ae2ed31979396286d1fa337de9acdcd990744eb2cb116058ce7f9bd94aa
7
+ data.tar.gz: 3bfb0f3b4cb89e4e4b2dbb74559c84963cd8cb4af065c4c207801ee6c0539338a470acb94f5b36eaa3081b165c65b85ce019632ee4d0cd1891ee7849f165629c
Binary file
Binary file
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-yaml
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurent Sansonetti