saxy 0.2.2 → 0.2.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 99471526e90dc20f81d3a7679901d55f8066939a
4
- data.tar.gz: 8f2a8805186cf00ed9496c66c45f1e377bbb5beb
3
+ metadata.gz: 923e7d1c218d9e304ee18fb87f6f2a1a9d06d384
4
+ data.tar.gz: 79b769b7699aee8503635fdfdc10b09afb9665a2
5
5
  SHA512:
6
- metadata.gz: 3af8c376d74eebcbd7ed3e94c89b69096caca4233ae5468e62f2b78ad3c43ccc4a4b66745151a439530faea6cf8841264cd045d05ff28d75f85ecece77cc4565
7
- data.tar.gz: 37ddc5c4186622f13af8a487cfc059e36c84cd8764d8bab4685450ea7c7d26c259932da67bb77ab861c3c07c10e6ece0e192c8e9e11f6f1bfbc1f166cb35a5f1
6
+ metadata.gz: edc331020d4c82df9b1d84656699b1060a6a9ee2324032a4a792208b1a991dadfc23c1668db1f2719c30afe967dd2f57f06bf2eafc61e410808a62bcbef44f8d
7
+ data.tar.gz: e140b6138c76e6fa602f4ce4a5a284b0b0213235057ea78da5202871bd85fce1e0df0441010eea5b1aee915c188b8520885a66fa9aa518c595e65a5d61ee502d
data/.travis.yml CHANGED
@@ -4,5 +4,11 @@ rvm:
4
4
  - 2.0.0
5
5
  - 1.9.3
6
6
  - 1.9.2
7
- - 1.8.7
8
- - ree
7
+ matrix:
8
+ include:
9
+ - rvm: 1.8.7
10
+ gemfile: gemfiles/1.8
11
+ - rvm: ree
12
+ gemfile: gemfiles/1.8
13
+
14
+
data/README.md CHANGED
@@ -50,7 +50,7 @@ Tag attributes become object attributes and attributes' name are underscored.
50
50
 
51
51
  Saxy.parse("filename.xml", "product").each do |product|
52
52
  puts product.name
53
- puts product.images.thumb_size
53
+ puts product.images.thumb_size.contents
54
54
  puts "#{product.images.thumb_size.width}x#{product.images.thumb_size.height}"
55
55
  end
56
56
 
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "activesupport", "< 4.0.0"
4
+ gem "saxy", :path => "../"
5
+ gemspec :path => "../"
6
+
data/lib/saxy/element.rb CHANGED
@@ -29,6 +29,7 @@ module Saxy
29
29
  value = value.first if value.size == 1
30
30
  object.send("#{name}=", value)
31
31
  end
32
+ object.contents = value
32
33
  object
33
34
  else
34
35
  value
data/lib/saxy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Saxy
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -27,6 +27,15 @@ describe Saxy::Element do
27
27
  object.bar.should == 2
28
28
  end
29
29
 
30
+ it "should dump as object with value when attributes and contents are set" do
31
+ element.set_attribute("foo", "bar")
32
+ element.append_value("value")
33
+ object = element.as_object
34
+
35
+ object.foo.should == "bar"
36
+ object.contents.should == "value"
37
+ end
38
+
30
39
  it "should add attributes under underscored names" do
31
40
  element.set_attribute("FooBar", "baz")
32
41
  element.as_object.foo_bar.should == "baz"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michał Szajbe
@@ -69,6 +69,7 @@ files:
69
69
  - LICENSE
70
70
  - README.md
71
71
  - Rakefile
72
+ - gemfiles/gemfile-1.8
72
73
  - lib/saxy.rb
73
74
  - lib/saxy/element.rb
74
75
  - lib/saxy/ostruct.rb