motion-yaml 1.4.5 → 1.4.6

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: a35fc6ffaa4660bd9a6fa222f0b86533c8f391cd
4
- data.tar.gz: 7cac25fcf56acb3572d4b01ca50d89c6dc60b320
3
+ metadata.gz: 85a71212a012ab0f2d3c9fbc2213c1854238a416
4
+ data.tar.gz: 77054707517eca66a0c79363f0913ff3e52b40e0
5
5
  SHA512:
6
- metadata.gz: 841421479b540d00742d15157026a4b8f657f27af3968486f9d7de4e3c8842da491d4d4d7574dc05d179d02a81b45ceb5f61d6c867b50a7591f412e5e9b8caed
7
- data.tar.gz: c825b72ea5ef654a8881521173990241b47e1ad118255a76f32835087a9b03f92732f5e28c1f51b58ee5ca9c5ccc3b7429cbbef0ee46da47daaaa4cf6596eefa
6
+ metadata.gz: 69ceb11e351750fc50f453c6473a99d944e30d0716a354b2f1a23b9797f14cb40a16d9670d6e3668ae2ea8711ce20b369ff3358e7021f6d31abe8ebc84f05abb
7
+ data.tar.gz: e19c0154477ad9cc9722e1a6d3cca2b46a5334ec0041265934e15b713efb105581700edf3bf70bcbd41cee5135dfc3401f538c41ae846aa85f9ce1d943c659f8
Binary file
Binary file
@@ -0,0 +1,68 @@
1
+ # Copyright (c) 2013, HipByte SPRL and Contributors
2
+ # All rights reserved.
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without
5
+ # modification, are permitted provided that the following conditions are met:
6
+ #
7
+ # 1. Redistributions of source code must retain the above copyright notice,
8
+ # this list of conditions and the following disclaimer.
9
+ # 2. Redistributions in binary form must reproduce the above copyright notice,
10
+ # this list of conditions and the following disclaimer in the documentation
11
+ # and/or other materials provided with the distribution.
12
+ #
13
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
14
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
17
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
+ # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
23
+ # POSSIBILITY OF SUCH DAMAGE.
24
+
25
+ class YAMLKitScanner
26
+ # http://yaml.org/type/float.html
27
+ FLOAT = /^(?:[-+]?([0-9][0-9_,]*)?\.[0-9]*([eE][-+][0-9]+)?(?# base 10)
28
+ |[-+]?[0-9][0-9_,]*(:[0-5]?[0-9])+\.[0-9_]*(?# base 60)
29
+ |[-+]?\.(inf|Inf|INF)(?# infinity)
30
+ |\.(nan|NaN|NAN)(?# not a number))$/x
31
+
32
+ # http://yaml.org/type/int.html
33
+ INTEGER = /^(?:[-+]?0b[0-1_]+ (?# base 2)
34
+ |[-+]?0[0-7_]+ (?# base 8)
35
+ |[-+]?(?:0|[1-9][0-9_]*) (?# base 10)
36
+ |[-+]?0x[0-9a-fA-F_]+ (?# base 16))$/x
37
+
38
+ # Tokenize string returning the Ruby object
39
+ # NOTE: This method will be called from Objective-C.
40
+ def self.tokenize(string)
41
+ return nil if string.empty?
42
+
43
+ case string
44
+ when /^\+?\.inf$/i
45
+ Float::INFINITY
46
+ when /^-\.inf$/i
47
+ -Float::INFINITY
48
+ when /^\.nan$/i
49
+ Float::NAN
50
+ when /^:(.*)/
51
+ string = $1
52
+ if string =~ /^["'](.+)["']$/
53
+ string = $1
54
+ end
55
+ string.to_sym
56
+ when INTEGER
57
+ Integer(string.gsub(/_/, ''))
58
+ when FLOAT
59
+ Float(string.gsub(/_/, ''))
60
+ when /^(yes|y|true|on)$/i
61
+ true
62
+ when /^(no|n|false|off)$/i
63
+ false
64
+ else
65
+ nil
66
+ end
67
+ end
68
+ end
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.4.5
4
+ version: 1.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurent Sansonetti
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-07-07 00:00:00.000000000 Z
12
+ date: 2015-07-09 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: motion-yaml provides methods to access "YAML Ain't Markup Language" for
15
15
  RubyMotion projects.
@@ -29,6 +29,7 @@ files:
29
29
  - lib/YAMLKit/libYAMLKit_OSX.a
30
30
  - lib/YAMLKit/libYAMLKit_iOS.a
31
31
  - lib/motion-yaml.rb
32
+ - lib/project/scanner.rb
32
33
  - lib/project/yaml.rb
33
34
  homepage: https://github.com/HipByte/motion-yaml
34
35
  licenses: