wowget 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/wowget.rb +1 -1
- data/lib/wowget/item.rb +2 -0
- data/spec/item_spec.rb +9 -2
- metadata +2 -2
data/lib/wowget.rb
CHANGED
data/lib/wowget/item.rb
CHANGED
@@ -19,6 +19,7 @@ module Wowget
|
|
19
19
|
attr_accessor :buy_price
|
20
20
|
attr_accessor :sell_price
|
21
21
|
attr_accessor :recipe_id
|
22
|
+
attr_accessor :soulbound
|
22
23
|
attr_accessor :error
|
23
24
|
|
24
25
|
QUALITIES = ['Poor', 'Common', 'Uncommon', 'Rare', 'Epic', 'Legendary', 'Artifact', 'Heirloom']
|
@@ -257,6 +258,7 @@ module Wowget
|
|
257
258
|
self.inventory_slot_id = item_xml.css('wowhead item inventorySlot').attribute('id').content.to_i
|
258
259
|
self.buy_price = item_equip_json['buyprice'].to_i
|
259
260
|
self.sell_price = item_equip_json['sellprice'].to_i
|
261
|
+
self.soulbound = item_xml.css('wowhead item htmlTooltip').inner_text.match('Binds when picked up') ? true : false
|
260
262
|
|
261
263
|
if item_xml.css('wowhead item createdBy').length == 1
|
262
264
|
self.recipe_id = item_xml.css('wowhead item createdBy spell').attribute('id').content.to_i
|
data/spec/item_spec.rb
CHANGED
@@ -78,11 +78,18 @@ describe Wowget::Item do
|
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
81
|
+
describe "With a Bind on Pickup item" do
|
82
|
+
item = Wowget::Item.find(52078)
|
83
|
+
it "should be soulbound" do
|
84
|
+
item.soulbound.should == true
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
81
88
|
describe "With a recipe" do
|
82
|
-
item = Wowget::Item.find(
|
89
|
+
item = Wowget::Item.find(55060)
|
83
90
|
|
84
91
|
it "should have a recipe spell to create this item" do
|
85
|
-
item.recipe_id.should ==
|
92
|
+
item.recipe_id.should == 76445
|
86
93
|
end
|
87
94
|
end
|
88
95
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: wowget
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.3.
|
5
|
+
version: 0.3.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Ben Darlow
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-07-
|
13
|
+
date: 2011-07-14 00:00:00 +01:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|