gravtastic 2.1.1 → 2.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -2
- data/lib/gravtastic.rb +2 -2
- data/spec/gravtastic_spec.rb +6 -2
- data/spec/spec_helper.rb +0 -3
- metadata +1 -1
data/README.md
CHANGED
@@ -104,8 +104,9 @@ Fork the project, submit a pull request and I'll get to it straight away. Or you
|
|
104
104
|
## Thanks
|
105
105
|
|
106
106
|
* [Xavier Shay](http://rhnh.net) and others for [Enki](http://enkiblog.com) (the reason this was originally written)
|
107
|
-
* [Matthew Moore](http://www.matthewpaulmoore.com
|
108
|
-
* [Vincent Charles](http://vincentcharles.com
|
107
|
+
* [Matthew Moore](http://www.matthewpaulmoore.com)
|
108
|
+
* [Vincent Charles](http://vincentcharles.com)
|
109
|
+
* [Paul Farnell](http://litmusapp.com/blog)
|
109
110
|
|
110
111
|
## License
|
111
112
|
|
data/lib/gravtastic.rb
CHANGED
@@ -71,8 +71,8 @@ module Gravtastic
|
|
71
71
|
|
72
72
|
def url_params_from_hash(hash)
|
73
73
|
'?' + hash.map do |key, val|
|
74
|
-
[self.class.gravatar_options
|
75
|
-
end.sort.join('&')
|
74
|
+
[self.class.gravatar_options[key.to_sym] || key.to_s, CGI::escape(val.to_s) ].join('=')
|
75
|
+
end.sort.join('&')
|
76
76
|
end
|
77
77
|
|
78
78
|
def gravatar_hostname(secure)
|
data/spec/gravtastic_spec.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/spec_helper'
|
2
|
-
require 'gravtastic'
|
2
|
+
require File.dirname(__FILE__) + '/../lib/gravtastic'
|
3
3
|
|
4
4
|
describe Gravtastic do
|
5
5
|
|
@@ -65,9 +65,13 @@ describe Gravtastic do
|
|
65
65
|
@user.gravatar_url(:rating => 'R').should == 'http://gravatar.com/avatar/b58996c504c5638798eb6b511e6f49af.png?r=R'
|
66
66
|
end
|
67
67
|
|
68
|
+
it "abides to some new fancy feature" do
|
69
|
+
@user.gravatar_url(:extreme => true).should == 'http://gravatar.com/avatar/b58996c504c5638798eb6b511e6f49af.png?extreme=true&r=PG'
|
70
|
+
end
|
71
|
+
|
68
72
|
it "makes a URL from the defaults" do
|
69
73
|
stub(@user.class).gravatar_defaults{ {:size => 20, :rating => 'R18', :secure => true, :filetype => :png} }
|
70
|
-
@user.gravatar_url.should == 'https://secure.gravatar.com/avatar/b58996c504c5638798eb6b511e6f49af.png?r=R18&s=20'
|
74
|
+
@user.gravatar_url.should == 'https://secure.gravatar.com/avatar/b58996c504c5638798eb6b511e6f49af.png?r=R18&s=20'
|
71
75
|
end
|
72
76
|
|
73
77
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,9 +1,6 @@
|
|
1
1
|
$TESTING=true
|
2
2
|
$:.push File.join(File.dirname(__FILE__), '..', 'lib')
|
3
3
|
|
4
|
-
require 'rubygems'
|
5
|
-
require 'spec'
|
6
|
-
|
7
4
|
def reload_gravtastic!
|
8
5
|
Object.class_eval { remove_const :Gravtastic } if defined? Gravtastic
|
9
6
|
require File.join(File.dirname(__FILE__),'../lib/gravtastic')
|