Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Reorganized files to use newgem.

  • Loading branch information...
commit 9e1ae4366cec01ff7209a921b0792b6626a152fa 1 parent c6fc52e
Norman Clarke authored
View
3  .gitignore
@@ -1,4 +1,5 @@
.DS_Store
-*.gem
+package
coverage
test/config.yml
+docs
View
5 History.txt
@@ -0,0 +1,5 @@
+== 1.0.0 2009-01-05
+* 1 major enhancement:
+ * Support for Disqus API added (Matthew Van Horn)
+* 1 minor enhancement:
+ * Reorganized gem to use newgem
View
38 Manifest.txt
@@ -0,0 +1,38 @@
+History.txt
+MIT-LICENSE
+Manifest.txt
+README.rdoc
+Rakefile
+disqus.gemspec
+init.rb
+lib/disqus.rb
+lib/disqus/api.rb
+lib/disqus/author.rb
+lib/disqus/forum.rb
+lib/disqus/post.rb
+lib/disqus/thread.rb
+lib/disqus/version.rb
+lib/disqus/view_helpers.rb
+lib/disqus/widget.rb
+tasks/rcov.rake
+test/api_test.rb
+test/config.yml
+test/config.yml.sample
+test/forum_test.rb
+test/merb_test.rb
+test/post_test.rb
+test/rails_test.rb
+test/responses/bad_api_key.json
+test/responses/create_post.json
+test/responses/get_forum_api_key.json
+test/responses/get_forum_list.json
+test/responses/get_num_posts.json
+test/responses/get_thread_by_url.json
+test/responses/get_thread_list.json
+test/responses/get_thread_posts.json
+test/responses/thread_by_identifier.json
+test/responses/update_thread.json
+test/test_helper.rb
+test/thread_test.rb
+test/view_helpers_test.rb
+test/widget_test.rb
View
4 README.rdoc
@@ -20,11 +20,9 @@ connecting websites and commenters across a thriving discussion community."
=== Get it
-==== Stable release (does not yet include API):
-
gem install disqus
-==== Bleeding Edge (includes API):
+==== Bleeding Edge
gem install norman-disqus --source http://gems.github.com
View
60 Rakefile
@@ -1,43 +1,23 @@
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
+require 'newgem'
+require 'lib/disqus/version'
-desc 'Default: run unit tests.'
-task :default => :test
-
-desc 'Run unit tests.'
-Rake::TestTask.new(:test) do |t|
- t.libs << 'lib'
- t.libs << 'test'
- t.pattern = 'test/**/*_test.rb'
- t.verbose = true
-end
-
-desc "Build gem"
-task :gem do
- sh "gem build disqus.gemspec"
-end
-
-desc "Run rcov"
-task :rcov do
- rm_f "coverage"
- rm_f "coverage.data"
- if PLATFORM =~ /darwin/
- exclude = '--exclude "gems"'
- else
- exclude = '--exclude "rubygems"'
- end
- rcov = "rcov --rails -Ilib:test --sort coverage --text-report #{exclude} --no-validator-links"
- cmd = "#{rcov} #{Dir["test/**/*.rb"].join(" ")}"
- sh cmd
+$hoe = Hoe.new("disqus", Disqus::Version::STRING) do |p|
+ p.rubyforge_name = "disqus"
+ p.author = ['Norman Clarke', 'Matthew Van Horn']
+ p.email = ['norman@randomba.org', 'mattvanhorn@gmail.com']
+ p.summary = "Integrates Disqus commenting system into your Ruby-powered site."
+ p.description = 'Integrates Disqus into your Ruby-powered site. Works with any Ruby website, and has view helpers for Rails and Merb.'
+ p.url = 'http://disqus.rubyforge.org'
+ p.test_globs = ['test/**/*_test.rb']
+ p.extra_deps << ['json']
+ p.extra_dev_deps = [
+ ['newgem', ">= #{::Newgem::VERSION}"],
+ ['mocha']
+ ]
+ p.rsync_args = '-av --delete --ignore-errors'
+ changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
+ p.remote_rdoc_dir = ""
end
-desc 'Generate rdocs.'
-Rake::RDocTask.new(:rdoc) do |rdoc|
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = 'Disqus'
- rdoc.main = "README.rdoc"
- rdoc.options << '--line-numbers' << '--inline-source' << '-c UTF-8'
- rdoc.rdoc_files.include('lib/**/*.rb')
- rdoc.rdoc_files.include('README.rdoc')
-end
+require 'newgem/tasks'
+Dir['tasks/**/*.rake'].each { |t| load t }
View
2  config/website.yml
@@ -0,0 +1,2 @@
+host: compay@rubyforge.org
+remote_dir: /var/www/gforge-projects/disqus
View
90 disqus.gemspec
@@ -1,50 +1,46 @@
+# -*- encoding: utf-8 -*-
+
Gem::Specification.new do |s|
- s.name = "disqus-api"
- s.version = "0.2.0"
- s.date = "2008-12-09"
- s.rubyforge_project = 'disqus'
- s.summary = "Integrates Disqus commenting system into your Ruby-powered site."
- s.email = 'norman@randomba.org'
- s.homepage = 'http://randomba.org'
- s.description = 'Integrates Disqus into your Ruby-powered site. Works with any Ruby website, and has view helpers for Rails and Merb.'
+ s.name = %q{disqus}
+ s.version = "1.0.0"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Norman Clarke", "Matthew Van Horn"]
+ s.cert_chain = ["/Users/norman/.gem/gem-public_cert.pem"]
+ s.date = %q{2009-01-05}
+ s.description = %q{Integrates Disqus into your Ruby-powered site. Works with any Ruby website, and has view helpers for Rails and Merb.}
+ s.email = ["norman@randomba.org", "mattvanhorn@gmail.com"]
+ s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.rdoc"]
+ s.files = ["History.txt", "MIT-LICENSE", "Manifest.txt", "README.rdoc", "Rakefile", "disqus.gemspec", "init.rb", "lib/disqus.rb", "lib/disqus/api.rb", "lib/disqus/author.rb", "lib/disqus/forum.rb", "lib/disqus/post.rb", "lib/disqus/thread.rb", "lib/disqus/version.rb", "lib/disqus/view_helpers.rb", "lib/disqus/widget.rb", "tasks/rcov.rake", "test/api_test.rb", "test/config.yml", "test/config.yml.sample", "test/forum_test.rb", "test/merb_test.rb", "test/post_test.rb", "test/rails_test.rb", "test/responses/bad_api_key.json", "test/responses/create_post.json", "test/responses/get_forum_api_key.json", "test/responses/get_forum_list.json", "test/responses/get_num_posts.json", "test/responses/get_thread_by_url.json", "test/responses/get_thread_list.json", "test/responses/get_thread_posts.json", "test/responses/thread_by_identifier.json", "test/responses/update_thread.json", "test/test_helper.rb", "test/thread_test.rb", "test/view_helpers_test.rb", "test/widget_test.rb"]
s.has_rdoc = true
- s.authors = ['Norman Clarke', 'Matt Van Horn']
- s.files = [
- "MIT-LICENSE",
- "README.rdoc",
- "init.rb",
- "lib/disqus.rb",
- "lib/disqus/api.rb",
- "lib/disqus/author.rb",
- "lib/disqus/forum.rb",
- "lib/disqus/post.rb",
- "lib/disqus/thread.rb",
- "lib/disqus/view_helpers.rb",
- "lib/disqus/widget.rb",
- "Rakefile"
- ]
- s.test_files = [
- "test/test_helper.rb",
- "test/config.yml.sample",
- "test/api_test.rb",
- "test/forum_test.rb",
- "test/merb_test.rb",
- "test/post_test.rb",
- "test/rails_test.rb",
- "test/thread_test.rb",
- "test/view_helpers_test.rb",
- "test/widget_test.rb",
- "test/responses/bad_api_key.json",
- "test/responses/create_post.json",
- "test/responses/get_forum_api_key.json",
- "test/responses/get_forum_list.json",
- "test/responses/get_num_posts.json",
- "test/responses/get_thread_by_url.json",
- "test/responses/get_thread_list.json",
- "test/responses/get_thread_posts.json",
- "test/responses/thread_by_identifier.json",
- "test/responses/update_thread.json"
- ]
- s.rdoc_options = ["--main", "README.rdoc", "--inline-source", "--line-numbers"]
-end
+ s.homepage = %q{http://disqus.rubyforge.org}
+ s.rdoc_options = ["--main", "README.rdoc"]
+ s.require_paths = ["lib"]
+ s.rubyforge_project = %q{disqus}
+ s.rubygems_version = %q{1.3.1}
+ s.signing_key = %q{/Users/norman/.gem/gem-private_key.pem}
+ s.summary = %q{Integrates Disqus commenting system into your Ruby-powered site.}
+ s.test_files = ["test/api_test.rb", "test/forum_test.rb", "test/merb_test.rb", "test/post_test.rb", "test/rails_test.rb", "test/thread_test.rb", "test/view_helpers_test.rb", "test/widget_test.rb"]
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 2
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ s.add_runtime_dependency(%q<json>, [">= 0"])
+ s.add_development_dependency(%q<newgem>, [">= 1.2.3"])
+ s.add_development_dependency(%q<mocha>, [">= 0"])
+ s.add_development_dependency(%q<hoe>, [">= 1.8.0"])
+ else
+ s.add_dependency(%q<json>, [">= 0"])
+ s.add_dependency(%q<newgem>, [">= 1.2.3"])
+ s.add_dependency(%q<mocha>, [">= 0"])
+ s.add_dependency(%q<hoe>, [">= 1.8.0"])
+ end
+ else
+ s.add_dependency(%q<json>, [">= 0"])
+ s.add_dependency(%q<newgem>, [">= 1.2.3"])
+ s.add_dependency(%q<mocha>, [">= 0"])
+ s.add_dependency(%q<hoe>, [">= 1.8.0"])
+ end
+end
View
3  init.rb
@@ -3,4 +3,5 @@
require 'disqus/author'
require 'disqus/forum'
require 'disqus/post'
-require 'disqus/thread'
+require 'disqus/thread'
+require 'disqus/version'
View
10 lib/disqus/author.rb
@@ -1,22 +1,22 @@
module Disqus
-
+
class BaseAuthor
attr_reader :url, :email_hash
end
-
+
class Author < BaseAuthor
attr_reader :id, :username, :display_name, :has_avatar
def initialize(id, username, display_name, url, email_hash, has_avatar)
@id, @username, @display_name, @url, @email_hash, @has_avatar = id, username, display_name, url, email_hash, has_avatar
end
-
+
# Returns the user's <tt>display_name</tt> or <tt>username</tt> if <tt>display_name</tt> is blank.
def name
@display_name.blank? ? @username : @display_name
end
-
+
end
-
+
class AnonymousAuthor < BaseAuthor
attr_reader :name
def initialize(name, url, email_hash)
View
8 lib/disqus/version.rb
@@ -0,0 +1,8 @@
+module Disqus #:nodoc:
+ module Version #:nodoc:
+ MAJOR = 1
+ MINOR = 0
+ TINY = 0
+ STRING = [MAJOR, MINOR, TINY].join('.')
+ end
+end
View
23 tasks/rcov.rake
@@ -0,0 +1,23 @@
+desc "Run RCov"
+task :rcov do
+ run_coverage Dir["test/**/*_test.rb"]
+end
+
+def run_coverage(files)
+ rm_f "coverage"
+ rm_f "coverage.data"
+ if files.length == 0
+ puts "No files were specified for testing"
+ return
+ end
+ files = files.join(" ")
+ if PLATFORM =~ /darwin/
+ exclude = '--exclude "gems/"'
+ else
+ exclude = '--exclude "rubygems"'
+ end
+ rcov = "rcov -Ilib:test --sort coverage --text-report #{exclude} --no-validator-links"
+ cmd = "#{rcov} #{files}"
+ puts cmd
+ sh cmd
+end
View
4 test/api_test.rb
@@ -63,8 +63,8 @@ def test_update_thread
def test_comment_form
c = Disqus::Api::comment_form("myforum", "mythread")
- assert_match /myforum/, c
- assert_match /mythread/, c
+ assert_match(/myforum/, c)
+ assert_match(/mythread/, c)
end
private
Please sign in to comment.
Something went wrong with that request. Please try again.