governor_comments 0.2.6 → 0.2.7

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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ./
3
3
  specs:
4
- governor_comments (0.2.6)
4
+ governor_comments (0.2.7)
5
5
  governor (>= 0.5.0)
6
6
  rails (~> 3.0.5)
7
7
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.6
1
+ 0.2.7
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{governor_comments}
8
- s.version = "0.2.6"
8
+ s.version = "0.2.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Liam Morley"]
12
- s.date = %q{2011-06-20}
12
+ s.date = %q{2011-06-21}
13
13
  s.description = %q{Comments plugin for the Rails 3-based Governor blogging system.}
14
14
  s.email = %q{liam@carpeliam.com}
15
15
  s.extra_rdoc_files = [
@@ -1,6 +1,6 @@
1
1
  module GovernorComments
2
2
  module Comment
3
- require 'md5'
3
+ require 'digest/md5'
4
4
  def self.included(base)
5
5
  base.belongs_to :commenter, :polymorphic => true
6
6
  if defined?(Rakismet)
@@ -31,7 +31,7 @@ module GovernorComments
31
31
 
32
32
  def gravatar_url(size = 48, default = "http://github.com/images/gravatars/gravatar-#{size}.png")
33
33
  if commenter.respond_to? :email
34
- hash = MD5::md5 commenter.email.downcase
34
+ hash = Digest::MD5.hexdigest commenter.email.downcase
35
35
  "http://www.gravatar.com/avatar/#{hash}?s=#{size}&r=pg&d=#{CGI::escape(default)}"
36
36
  else
37
37
  default
@@ -1,14 +1,20 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Comment do
4
- before do
5
- @bad_guest = Guest.new
6
- @bad_guest.should be_invalid
7
- @good_guest = Guest.new(:name => 'name', :email => 'email@address.com')
8
- @good_guest.should be_valid
9
- end
10
4
  it "is invalid if the commenter is invalid" do
11
- Comment.new(:content => 'some content', :commenter => @bad_guest).should be_invalid
12
- Comment.new(:content => 'some content', :commenter => @good_guest).should be_valid
5
+ bad_guest = Guest.new
6
+ bad_guest.should be_invalid
7
+ good_guest = Guest.new(:name => 'name', :email => 'email@address.com')
8
+ good_guest.should be_valid
9
+
10
+ Comment.new(:content => 'some content', :commenter => bad_guest).should be_invalid
11
+ Comment.new(:content => 'some content', :commenter => good_guest).should be_valid
12
+ end
13
+
14
+ it "has a working gravatar url" do
15
+ # pulled off github
16
+ dhh_gravatar = 'http://www.gravatar.com/avatar/ed9635566b34ade32274f510f0f9a6d2?s=140&r=pg&d=https%3A%2F%2Fa248.e.akamai.net%2Fassets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png'
17
+ comment = Comment.new(:content => "I like ruby, yes", :commenter => Guest.new(:name => 'dhh', :email => 'david@loudthinking.com'))
18
+ comment.gravatar_url(140, 'https://a248.e.akamai.net/assets.github.com/images/gravatars/gravatar-140.png').should == dhh_gravatar
13
19
  end
14
20
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- governor_comments (0.2.6)
4
+ governor_comments (0.2.7)
5
5
  governor (>= 0.5.0)
6
6
  rails (~> 3.0.5)
7
7
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: governor_comments
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 6
10
- version: 0.2.6
9
+ - 7
10
+ version: 0.2.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Liam Morley
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-06-20 00:00:00 -04:00
18
+ date: 2011-06-21 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency