Permalink
Browse files

Setup bundler. Properly escaped the '&' in the gravatar urls. Bumped …

…version to 1.0.0.pre2
  • Loading branch information...
1 parent 6a845fc commit fa98e4aa8070c700f5e43de155e40b1928b0c6bd @mdeering committed Sep 9, 2010
Showing with 21 additions and 8 deletions.
  1. +3 −1 .gitignore
  2. +8 −0 Gemfile
  3. +2 −2 ROADMAP.textile
  4. +1 −1 VERSION
  5. +2 −2 gravatar_image_tag.gemspec
  6. +5 −2 lib/gravatar_image_tag.rb
View
4 .gitignore
@@ -1,4 +1,6 @@
.DS_Store
coverage
rdoc
-pkg
+pkg
+.bundle
+Gemfile.lock
View
8 Gemfile
@@ -0,0 +1,8 @@
+source :rubygems
+
+group :development do
+ gem 'activesupport'
+ gem 'actionpack'
+ gem 'jeweler'
+ gem 'rspec'
+end
View
4 ROADMAP.textile
@@ -10,7 +10,7 @@ end</pre>
h1. 1.0.0
-* Block Configuration DSL support
+* -Block Configuration DSL support-
<pre># config/initializers/gravatar_image_tag.rb
GravatarImageTag.configure do |config|
@@ -30,4 +30,4 @@ h1. 0.1.0
h1. 0.0.1
-* -package things up into a gem hosted over at gemcutter.- "Hosted on Gemcutter now(Gravatar Image Tag Ruby Gem)":http://gemcutter.org/gems/gravatar_image_tag
+* -package things up into a gem.- "Hosted on Gemcutter now(Gravatar Image Tag Ruby Gem)":http://rubygems.org/gems/gravatar_image_tag
View
2 VERSION
@@ -1 +1 @@
-1.0.0.pre1
+1.0.0.pre2
View
4 gravatar_image_tag.gemspec
@@ -5,11 +5,11 @@
Gem::Specification.new do |s|
s.name = %q{gravatar_image_tag}
- s.version = "1.0.0.pre1"
+ s.version = "1.0.0.pre2"
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
s.authors = ["Michael Deering"]
- s.date = %q{2010-07-11}
+ s.date = %q{2010-09-08}
s.email = %q{mdeering@mdeering.com}
s.extra_rdoc_files = [
"README.textile"
View
7 lib/gravatar_image_tag.rb
@@ -4,8 +4,11 @@ class << self
attr_accessor :configuration
end
+ def self.configuration
+ @configuration ||= Configuration.new
+ end
+
def self.configure
- self.configuration ||= Configuration.new
yield(configuration)
end
@@ -86,7 +89,7 @@ def self.gravatar_id(email, filetype = nil)
def self.url_params(gravatar_params)
return nil if gravatar_params.keys.size == 0
- "?#{gravatar_params.map { |key, value| "#{key}=#{URI.escape(value.is_a?(String) ? value : value.to_s, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}"}.join('&')}"
+ "?#{gravatar_params.map { |key, value| "#{key}=#{URI.escape(value.is_a?(String) ? value : value.to_s, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}"}.join('&amp;')}"
@telemachus
telemachus Feb 1, 2011

I think that this commit introduced a bug.

Using 1.0.0.pre1, I get source strings like this:

http://gravatar.com/avatar/8bdb05510e492a858b6a5e09ced37f5e?default=identicon&amp;size=40

Works great. But using 1.0.0.pre2, I now get source strings like this:

http://gravatar.com/avatar/69e774f5bdcdde486bfd8a13a4ad63b7?default=identicon&amp;amp;size=40

I'm guessing that the &amp;amp; is a result of this commit, but I may be confused.

@mdeering
mdeering Feb 1, 2011

Are you are on Rails 3? Do you need to call html_safe on the string, does that solve your problem?

I will create an issue if this is what is going on and do the call automatically to html_safe if Rails 3 (or the method on the string) is detected.

@telemachus
telemachus Feb 1, 2011

Yup, Rails 3, and .html_safe solves the problem. Thanks for the quick response.

end
end

0 comments on commit fa98e4a

Please sign in to comment.