gravtastic 1.7.0 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ require 'spec/rake/spectask'
5
5
  require 'date'
6
6
 
7
7
  GEM = "gravtastic"
8
- GEM_VERSION = "1.7.0"
8
+ GEM_VERSION = "1.7.1"
9
9
  AUTHOR = "Chris Lloyd"
10
10
  EMAIL = "christopher.lloyd@gmail.com"
11
11
  HOMEPAGE = "http://github.com/chrislloyd/gravtastic"
data/lib/gravtastic.rb CHANGED
@@ -59,8 +59,8 @@ module Gravtastic
59
59
  #
60
60
  # has_gravatar :defaults => { :rating => 'R18' }
61
61
  #
62
- def has_gravatar(options={:on => :email})
63
- @gravatar_source = options[:on]
62
+ def has_gravatar(options={})
63
+ @gravatar_source = options[:on] || :email
64
64
  options[:defaults] ||= {}
65
65
  @gravatar_defaults = {:rating => 'PG', :secure => false}.merge(options[:defaults])
66
66
  end
@@ -46,6 +46,11 @@ describe "Gravtastic::Model" do
46
46
  @klass.gravatar_defaults.should == { :rating => 'PG', :secure => false }
47
47
  end
48
48
 
49
+ it "sets .gravatar_source to :email by default, even when :defaults are supplied" do
50
+ @klass.has_gravatar :defaults => { :secure => true }
51
+ @klass.gravatar_source.should == :email
52
+ end
53
+
49
54
  it "keeps either :rating or :secure if only the other is passed as a default" do
50
55
  @klass.has_gravatar :defaults => { :secure => true }
51
56
  @klass.gravatar_defaults.should == { :rating => 'PG', :secure => true }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gravtastic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Lloyd