diff --git a/disqus.gemspec b/disqus.gemspec index d713b67..3a5d773 100644 --- a/disqus.gemspec +++ b/disqus.gemspec @@ -1,3 +1,5 @@ +require 'lib/disqus/version' + spec = Gem::Specification.new do |s| s.name = "disqus" @@ -8,7 +10,6 @@ spec = Gem::Specification.new do |s| s.summary = "Integrates Disqus commenting system into your Ruby-powered site." s.description = 'Integrates Disqus into your Ruby-powered site. Works with any Ruby website, and has view helpers for Rails and Merb.' s.homepage = 'http://github.com/norman/disqus' - s.has_rdoc = true s.platform = Gem::Platform::RUBY s.files = Dir["lib/**/*.rb", "lib/**/*.rake", "*.rdoc", "LICENSE", "Rakefile", "test/**/*.*"] diff --git a/lib/disqus.rb b/lib/disqus.rb index df1053d..a42990a 100644 --- a/lib/disqus.rb +++ b/lib/disqus.rb @@ -1,4 +1,4 @@ -%w[api author forum post thread version view_helpers widget].each do |file| +%w[api author forum post thread view_helpers widget].each do |file| require File.join(File.dirname(__FILE__), "disqus", file) end @@ -49,4 +49,4 @@ def self.defaults @defaults end -end \ No newline at end of file +end diff --git a/lib/disqus/view_helpers.rb b/lib/disqus/view_helpers.rb index 2fffbcf..9dbf693 100644 --- a/lib/disqus/view_helpers.rb +++ b/lib/disqus/view_helpers.rb @@ -1,9 +1,9 @@ # Shortcuts to access the widgets as simple functions as opposed to using # their full qualified names. -%w[combo comment_counts popular_threads recent_comments thread top_commenters].each do |method| +%w[combo comment_counts popular_threads recent_comments thread top_commenters sso_login sso_logout].each do |method| eval(<<-EOM) def disqus_#{method}(options = {}) Disqus::Widget.#{method}(options) end EOM -end \ No newline at end of file +end diff --git a/lib/disqus/widget.rb b/lib/disqus/widget.rb index b7ba778..a6583b5 100644 --- a/lib/disqus/widget.rb +++ b/lib/disqus/widget.rb @@ -1,3 +1,6 @@ +require 'base64' +require 'openssl' + module Disqus # Disqus Widget generator. @@ -21,6 +24,9 @@ class Widget RECENT = ROOT_PATH + 'recent_comments_widget.js?num_items=%d&avatar_size=%d' POPULAR = ROOT_PATH + 'popular_threads_widget.js?num_items=%d' TOP = ROOT_PATH + 'top_commenters_widget.js?num_items=%d&avatar_size=%d&orientation=%s' + + DIGEST = OpenSSL::Digest::Digest.new('sha1') + class << self # Show the main Disqus thread widget. @@ -34,6 +40,7 @@ def thread(opts = {}) if opts[:developer] s << '' end + s << '
' s << '' s << '