pump 0.3.0 → 0.4.0
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.
- data/lib/pump/version.rb +1 -1
- data/lib/pump/xml/dsl.rb +8 -0
- data/lib/pump/xml.rb +1 -1
- data/spec/pump/xml/dsl_spec.rb +20 -0
- metadata +2 -2
data/lib/pump/version.rb
CHANGED
data/lib/pump/xml/dsl.rb
CHANGED
@@ -26,6 +26,14 @@ module Pump
|
|
26
26
|
with_type('integer', name, options)
|
27
27
|
end
|
28
28
|
|
29
|
+
def float(name, options={})
|
30
|
+
with_type('float', name, options)
|
31
|
+
end
|
32
|
+
|
33
|
+
def boolean(name, options={})
|
34
|
+
with_type('boolean', name, options)
|
35
|
+
end
|
36
|
+
|
29
37
|
def date(name, options={})
|
30
38
|
with_type('date', name, options)
|
31
39
|
end
|
data/lib/pump/xml.rb
CHANGED
data/spec/pump/xml/dsl_spec.rb
CHANGED
@@ -53,6 +53,26 @@ describe Pump::Xml::Dsl do
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
+
context "with float" do
|
57
|
+
subject { Pump::Xml::Dsl.new { float :name } }
|
58
|
+
its(:config) { should eql([{:name => :name, :attributes => {:type => 'float'}, :xmlsafe => true}]) }
|
59
|
+
|
60
|
+
context "with attributes and options" do
|
61
|
+
subject { Pump::Xml::Dsl.new { float :name, :attributes => {:a => 'b'}, :options => false } }
|
62
|
+
its(:config) { should eql([{:name => :name, :attributes => {:type => 'float', :a => 'b'}, :options => false, :xmlsafe => true}]) }
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
context "with boolean" do
|
67
|
+
subject { Pump::Xml::Dsl.new { boolean :name } }
|
68
|
+
its(:config) { should eql([{:name => :name, :attributes => {:type => 'boolean'}, :xmlsafe => true}]) }
|
69
|
+
|
70
|
+
context "with attributes and options" do
|
71
|
+
subject { Pump::Xml::Dsl.new { boolean :name, :attributes => {:a => 'b'}, :options => false } }
|
72
|
+
its(:config) { should eql([{:name => :name, :attributes => {:type => 'boolean', :a => 'b'}, :options => false, :xmlsafe => true}]) }
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
56
76
|
context "with date" do
|
57
77
|
subject { Pump::Xml::Dsl.new { date :at } }
|
58
78
|
its(:config) { should eql([{:at => :at, :attributes => {:type => 'date'}, :xmlsafe => true}]) }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pump
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|