Navigation Menu

Skip to content

Commit

Permalink
Setup bundler. Properly escaped the '&' in the gravatar urls. Bumped …
Browse files Browse the repository at this point in the history
…version to 1.0.0.pre2
  • Loading branch information
mdeering committed Sep 9, 2010
1 parent 6a845fc commit fa98e4a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .gitignore
@@ -1,4 +1,6 @@
.DS_Store
coverage
rdoc
pkg
pkg
.bundle
Gemfile.lock
8 changes: 8 additions & 0 deletions Gemfile
@@ -0,0 +1,8 @@
source :rubygems

group :development do
gem 'activesupport'
gem 'actionpack'
gem 'jeweler'
gem 'rspec'
end
4 changes: 2 additions & 2 deletions ROADMAP.textile
Expand Up @@ -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|
Expand All @@ -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
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
1.0.0.pre1
1.0.0.pre2
4 changes: 2 additions & 2 deletions gravatar_image_tag.gemspec
Expand Up @@ -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"
Expand Down
7 changes: 5 additions & 2 deletions lib/gravatar_image_tag.rb
Expand Up @@ -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

Expand Down Expand Up @@ -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;')}"

This comment has been minimized.

Copy link
@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.

This comment has been minimized.

Copy link
@mdeering

mdeering Feb 1, 2011

Author Owner

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.

This comment has been minimized.

Copy link
@telemachus

telemachus Feb 1, 2011

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

end

end
Expand Down

0 comments on commit fa98e4a

Please sign in to comment.