foraneus 0.0.3 → 0.0.4
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 +8 -8
- data/lib/foraneus.rb +6 -0
- data/lib/foraneus/converters/noop.rb +15 -0
- data/spec/lib/foraneus/converters/noop_converter_spec.rb +20 -0
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmI3NjNiNTIwZDUwZDVjMWFlM2U5Yjg0NmJjMDk3Yzc5MzEyZWE1Yg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OGNhNWM1OTQ5YTlmZjI2NjUwNWY2OWZlMzc3ZThkODdlYjFlMDcwYg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MzU5NjRmMGIwODlhNmQzMTBkYWFjMmMyMzJjM2NhYjQxOGY4MWQxOTc1NDk3
|
10
|
+
ZWU0NGNmODJhODNlODk4ZDBhMmI4NzkxNGRmZWQ4YmRhZTIzMmQwYTc0MDY0
|
11
|
+
YTQwYjYzNGE5NGFiMDcyOWQ1MGVhYWQ3M2Q1MmUyM2I3M2UwYmU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZWQzN2ZlYmQ1MmQyMjlmZThjYzIxYjMyODMzNjczZjdmNGM3MzM1MTE3Mzll
|
14
|
+
ZmZjNzE3OTA2MzQ5ZTE1OWFhNzliNzRiOTk1ZGYzNGFkNTZmYTA4YWY4OTBh
|
15
|
+
OTIyM2ZjZTJjOTg4NGIyM2JiZjViOWI5YjIxNzNkMWRkYTFhMGM=
|
data/lib/foraneus.rb
CHANGED
@@ -3,6 +3,7 @@ require_relative 'foraneus/converters/date'
|
|
3
3
|
require_relative 'foraneus/converters/decimal'
|
4
4
|
require_relative 'foraneus/converters/float'
|
5
5
|
require_relative 'foraneus/converters/integer'
|
6
|
+
require_relative 'foraneus/converters/noop'
|
6
7
|
require_relative 'foraneus/converters/string'
|
7
8
|
require_relative 'foraneus/errors'
|
8
9
|
|
@@ -46,6 +47,11 @@ class Foraneus
|
|
46
47
|
field(name, converter)
|
47
48
|
end
|
48
49
|
|
50
|
+
def self.noop(name)
|
51
|
+
converter = Foraneus::Converters::Noop.new
|
52
|
+
field(name, converter)
|
53
|
+
end
|
54
|
+
|
49
55
|
def self.string(name)
|
50
56
|
converter = Foraneus::Converters::String.new
|
51
57
|
field(name, converter)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Foraneus::Converters::Noop do
|
4
|
+
|
5
|
+
describe '#parse' do
|
6
|
+
it 'returns the given object' do
|
7
|
+
o = Object.new
|
8
|
+
|
9
|
+
subject.parse(o).should be(o)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
describe '#raw' do
|
14
|
+
it 'returns the given object' do
|
15
|
+
o = Object.new
|
16
|
+
|
17
|
+
subject.raw(o).should be(o)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foraneus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gianfranco Zas
|
@@ -35,6 +35,7 @@ files:
|
|
35
35
|
- lib/foraneus/converters/boolean.rb
|
36
36
|
- lib/foraneus/converters/string.rb
|
37
37
|
- lib/foraneus/converters/float.rb
|
38
|
+
- lib/foraneus/converters/noop.rb
|
38
39
|
- lib/foraneus/converters/decimal.rb
|
39
40
|
- lib/foraneus/converters/date.rb
|
40
41
|
- lib/foraneus/converters/integer.rb
|
@@ -42,6 +43,7 @@ files:
|
|
42
43
|
- COPYING.LESSER
|
43
44
|
- README.md
|
44
45
|
- spec/lib/foraneus_spec.rb
|
46
|
+
- spec/lib/foraneus/converters/noop_converter_spec.rb
|
45
47
|
- spec/lib/foraneus/converters/decimal_converter_spec.rb
|
46
48
|
- spec/lib/foraneus/converters/date_converter_spec.rb
|
47
49
|
- spec/lib/foraneus/converters/integer_converter_spec.rb
|
@@ -75,6 +77,7 @@ specification_version: 4
|
|
75
77
|
summary: Validates and transform external data.
|
76
78
|
test_files:
|
77
79
|
- spec/lib/foraneus_spec.rb
|
80
|
+
- spec/lib/foraneus/converters/noop_converter_spec.rb
|
78
81
|
- spec/lib/foraneus/converters/decimal_converter_spec.rb
|
79
82
|
- spec/lib/foraneus/converters/date_converter_spec.rb
|
80
83
|
- spec/lib/foraneus/converters/integer_converter_spec.rb
|