Skip to content

Commit

Permalink
Add versionomy to gem dependencies. Fix context_helper to continue to…
Browse files Browse the repository at this point in the history
… work with ruby 1.8.
  • Loading branch information
lance committed Jan 30, 2012
1 parent dfd130b commit b16161c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions awestruct.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Gem::Specification.new do |s|
s.has_rdoc = true

s.add_dependency 'hpricot'
s.add_dependency 'versionomy', '= 0.4.1'
s.add_dependency 'haml', '<= 3.1.0'
s.add_dependency 'sass', '<= 3.1.0'
s.add_dependency 'hashery', '= 1.4.0'
Expand Down
8 changes: 7 additions & 1 deletion lib/awestruct/context_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ def fully_qualify_urls(base_url, text)
img['src'] = fix_url( base_url, img['src'] )
end
# Hpricot::Doc#to_s output encoding is not necessarily the same as the encoding of text
return doc.to_s.tap{|d| d.force_encoding(text.encoding) if d.encoding != text.encoding }
if RUBY_VERSION.start_with? '1.8'
doc.to_s
else
doc.to_s.tap do |d|
d.force_encoding(text.encoding) if d.encoding != text.encoding
end
end
end

def fix_url(base_url, url)
Expand Down

0 comments on commit b16161c

Please sign in to comment.