Permalink
Browse files

fixed bug raising error while access to race thru to_hash method; fix…

…ed bug getting avatar styles
  • Loading branch information...
1 parent ac00a7a commit 63bf72a54681144a81148110275858b35c4c2498 @ck3g committed Mar 23, 2013
Showing with 4 additions and 4 deletions.
  1. +1 −1 battlenet_info.gemspec
  2. +2 −2 lib/battlenet_info.rb
  3. +1 −1 spec/battlenet_info_spec.rb
View
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'battlenet_info'
- s.version = '0.2.0'
+ s.version = '0.2.1'
s.date = '2013-03-10'
s.summary = "Battle.Net info"
s.description = "A simple Battle.Net info parser gem"
View
@@ -77,7 +77,7 @@ def league
def portrait_html_style(new_path)
match_data = /<span\s+class=\Wicon-frame\s+\W[\s\t\n]+(?<picture_style>\w+\=[\w\s\W]+portraits[\w\s\W]+90px;)\W>[\t\n\s]+<\/span>/im.match self.profile_content
- match_data[:picture_style].sub('http://media.blizzard.com/sc2/portraits/', new_path)
+ match_data[:picture_style].sub('http://media.blizzard.com/sc2/portraits/', new_path).sub("style\=\"", "")
end
def to_hash
@@ -87,7 +87,7 @@ def to_hash
:server => self.server,
:player_name => self.player_name,
:achievement_points => self.achievement_points,
- :race => self.race,
+ # :race => self.race,
:points => points,
:wins => wins,
:rank => self.rank,
@@ -128,7 +128,7 @@
VCR.use_cassette("kas_profile") do
new_path = 'new/path/to/image/'
- expected = "style=\"background: url('#{new_path}2-90.jpg') -270px 0px no-repeat; width: 90px; height: 90px;"
+ expected = "background: url('#{new_path}2-90.jpg') -270px 0px no-repeat; width: 90px; height: 90px;"
@kas.portrait_html_style(new_path).should eq expected
end
end

0 comments on commit 63bf72a

Please sign in to comment.