sell_object 0.1.2 → 0.1.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: da85f99159ce4c36f9be708eb2208dcd30e6c45a
4
- data.tar.gz: 2c5d0aab6824b7e617896a1ed173b5530b8d5931
3
+ metadata.gz: e66f41e5be9b9edf6af8dd1aa6db9593b9e57029
4
+ data.tar.gz: d8005a5e92b84d1228e94ff025291489f92016b4
5
5
  SHA512:
6
- metadata.gz: b35b7ab3b4064f943c1f29cd9db34c5cc876e972e1ecddffb3c4735b8495389677478bfbb659523603836c9e57658d1498116bcfe46a4f166cb0a333da0e9d91
7
- data.tar.gz: 8460e203227ef009263dd9cfa93a45e63aa5dff44bb4df5a018ef3e3c4b07d349b5f2389fa99e5ee8cf38bea032acd472fb6ee1d1d033827edb3e1479e34827d
6
+ metadata.gz: fb98d17c1d0624b74b641f84cf7daf431dbb96b17b3ed8ee7c3158697644dc2770ca593502dcf07686feef4453f9b96a86181eab003402fe60247265aca0ae67
7
+ data.tar.gz: 114e737c66420a74851a29ca6c8c9496ef893798e9dbdd38114376aaf1e07b49b5d5de88e8a2bfdc773bc1ed8a15eee7d80a95f0916c1c8b9405848f53b78f80
data/CHANGELOG.md CHANGED
@@ -1,7 +1,3 @@
1
1
  ## v0.1.0
2
2
 
3
- * initial release with shopping engines: ShoppingUOL (Brazil) and Buscape (Brazil)
4
-
5
- ## v0.1.2
6
-
7
- * Using Nokogiri to build all the XMLs
3
+ * initial release with shopping engines: ShoppingUOL (Brazil) and Buscape (Brazil)
@@ -5,8 +5,9 @@ module SellObject
5
5
  end
6
6
 
7
7
  def self.wrap_xml(elements, store_name = nil)
8
- store_name ||= SellObject::Config.store_name
8
+ store_name ||= SellObject::Config.store_name
9
9
  raise ArgumentError, 'No store name found (nil). You have to either pass it as an argument or set it up in SellObject::Config' if store_name.nil?
10
+ store_name = store_name.gsub(/ +/, '_')
10
11
  result = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
11
12
  xml.comment timestamp
12
13
  xml.send(store_name) {
@@ -1,3 +1,3 @@
1
1
  module SellObject
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
data/lib/sell_object.rb CHANGED
@@ -55,7 +55,7 @@ module SellObject
55
55
  end
56
56
 
57
57
  def self.store_name=(name)
58
- @@store_name = name.gsub(/ +/, '_')
58
+ @@store_name = name
59
59
  end
60
60
  end
61
61
  end
@@ -31,6 +31,10 @@ describe SellObject::Buscape do
31
31
  it 'generates the XML with the given store name as root' do
32
32
  expect(remove_xml_noise product.to_buscape('great')).to match /<great><produtos>.*<\/produtos><\/great>/
33
33
  end
34
+
35
+ it 'underscores the given store name' do
36
+ expect(remove_xml_noise product.to_buscape('My Awesome Store')).to match /<My_Awesome_Store><produtos>.*<\/produtos><\/My_Awesome_Store>/
37
+ end
34
38
  end
35
39
  end
36
40
  end
@@ -111,9 +111,9 @@ describe SellObject do
111
111
  expect(subject.store_name).to be_nil
112
112
  end
113
113
 
114
- it 'underscores the given assigned name' do
115
- subject.store_name = 'My Store Name'
116
- expect(subject.store_name).to eq 'My_Store_Name'
114
+ it 'assigns the given store name' do
115
+ subject.store_name = 'My Store'
116
+ expect(subject.store_name).to eq 'My Store'
117
117
  end
118
118
  end
119
119
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sell_object
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Ferraz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-31 00:00:00.000000000 Z
11
+ date: 2014-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler