safe_yaml 0.8.5 → 0.8.6
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 +7 -0
- data/lib/safe_yaml/transform/to_float.rb +1 -1
- data/lib/safe_yaml/version.rb +1 -1
- data/spec/transform/to_float_spec.rb +5 -0
- metadata +7 -9
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: cacc423c7a4bb7bafd942e34978dc51e317bb483
|
4
|
+
data.tar.gz: 540a9ddba02abd5993e1f0901907983b4aea7088
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 348b33b5126f29f523580988749fa8c260a560868d07f2bb1dccd5ea723aaf761aa26a2c19be1a8c102092edf4402b780ffaa49090b6c28f721a7e6fc27e3ab4
|
7
|
+
data.tar.gz: a66a0b50feec1e5db74382340ce36ff1ef909fa27f74f44d702a9e2e131e8285a7700978bc4b8ed6b2e1ab63e960c93fcdce2385bf635c289a9bc14a243b430d
|
@@ -16,7 +16,7 @@ module SafeYAML
|
|
16
16
|
".NAN" => NaN,
|
17
17
|
}.freeze
|
18
18
|
|
19
|
-
MATCHER = /\A[-+]?(?:\d[\d_]*)?\.[\d_]
|
19
|
+
MATCHER = /\A[-+]?(?:\d[\d_]*)?\.[\d_]+(?:[eE][-+][\d]+)?\Z/.freeze
|
20
20
|
|
21
21
|
def transform?(value)
|
22
22
|
return true, Float(value) if MATCHER.match(value)
|
data/lib/safe_yaml/version.rb
CHANGED
@@ -34,4 +34,9 @@ describe SafeYAML::Transform::ToFloat do
|
|
34
34
|
success, result = subject.transform?(".NaN")
|
35
35
|
success.should be_true; result.should be_nan
|
36
36
|
end
|
37
|
+
|
38
|
+
# issue 29
|
39
|
+
it "returns false for the string '.'" do
|
40
|
+
subject.transform?(".").should be_false
|
41
|
+
end
|
37
42
|
end
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: safe_yaml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
5
|
-
prerelease:
|
4
|
+
version: 0.8.6
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Dan Tao
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-17 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: Parse YAML safely, without that pesky arbitrary object deserialization
|
15
14
|
vulnerability
|
@@ -59,27 +58,26 @@ files:
|
|
59
58
|
homepage: http://dtao.github.com/safe_yaml/
|
60
59
|
licenses:
|
61
60
|
- MIT
|
61
|
+
metadata: {}
|
62
62
|
post_install_message:
|
63
63
|
rdoc_options: []
|
64
64
|
require_paths:
|
65
65
|
- lib
|
66
66
|
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
-
none: false
|
68
67
|
requirements:
|
69
|
-
- -
|
68
|
+
- - '>='
|
70
69
|
- !ruby/object:Gem::Version
|
71
70
|
version: 1.8.7
|
72
71
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
72
|
requirements:
|
75
|
-
- -
|
73
|
+
- - '>='
|
76
74
|
- !ruby/object:Gem::Version
|
77
75
|
version: '0'
|
78
76
|
requirements: []
|
79
77
|
rubyforge_project:
|
80
|
-
rubygems_version:
|
78
|
+
rubygems_version: 2.0.0
|
81
79
|
signing_key:
|
82
|
-
specification_version:
|
80
|
+
specification_version: 4
|
83
81
|
summary: SameYAML provides an alternative implementation of YAML.load suitable for
|
84
82
|
accepting user input in Ruby applications.
|
85
83
|
test_files:
|