norman-disqus-api 0.2.0
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/MIT-LICENSE +20 -0
- data/README.rdoc +118 -0
- data/Rakefile +43 -0
- data/init.rb +6 -0
- data/lib/disqus.rb +70 -0
- data/lib/disqus/api.rb +264 -0
- data/lib/disqus/author.rb +27 -0
- data/lib/disqus/forum.rb +126 -0
- data/lib/disqus/post.rb +51 -0
- data/lib/disqus/thread.rb +73 -0
- data/lib/disqus/view_helpers.rb +45 -0
- data/lib/disqus/widget.rb +181 -0
- data/test/api_test.rb +80 -0
- data/test/config.yml.sample +3 -0
- data/test/forum_test.rb +70 -0
- data/test/merb_test.rb +15 -0
- data/test/post_test.rb +18 -0
- data/test/rails_test.rb +18 -0
- data/test/responses/bad_api_key.json +1 -0
- data/test/responses/create_post.json +23 -0
- data/test/responses/get_forum_api_key.json +1 -0
- data/test/responses/get_forum_list.json +12 -0
- data/test/responses/get_num_posts.json +11 -0
- data/test/responses/get_thread_by_url.json +18 -0
- data/test/responses/get_thread_list.json +16 -0
- data/test/responses/get_thread_posts.json +37 -0
- data/test/responses/thread_by_identifier.json +17 -0
- data/test/responses/update_thread.json +5 -0
- data/test/test_helper.rb +32 -0
- data/test/thread_test.rb +28 -0
- data/test/view_helpers_test.rb +37 -0
- data/test/widget_test.rb +58 -0
- metadata +87 -0
data/test/widget_test.rb
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'disqus'
|
3
|
+
|
4
|
+
class DisqusWidgetTest < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
Disqus::defaults[:account] = "tests"
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_thread
|
11
|
+
assert Disqus::Widget::thread
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_comment_counts
|
15
|
+
assert Disqus::Widget::comment_counts
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_combo
|
19
|
+
assert Disqus::Widget::combo
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_recent_comments
|
23
|
+
assert Disqus::Widget::recent_comments
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_popular_threads
|
27
|
+
assert Disqus::Widget::popular_threads
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_top_commenters
|
31
|
+
assert Disqus::Widget::top_commenters
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_invalid_default_tab
|
35
|
+
assert_raises ArgumentError do
|
36
|
+
Disqus::Widget::combo(:default_tab => "test")
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_invalid_color
|
41
|
+
assert_raises ArgumentError do
|
42
|
+
Disqus::Widget::combo(:color => "test")
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_invalid_num_items
|
47
|
+
assert_raises ArgumentError do
|
48
|
+
Disqus::Widget::combo(:num_items => 100)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_invalid_avatar_size
|
53
|
+
assert_raises ArgumentError do
|
54
|
+
Disqus::Widget::top_commenters(:avatar_size => 100)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
metadata
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: norman-disqus-api
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Norman Clarke
|
8
|
+
- Matt Van Horn
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2008-12-09 00:00:00 -08:00
|
14
|
+
default_executable:
|
15
|
+
dependencies: []
|
16
|
+
|
17
|
+
description: Integrates Disqus into your Ruby-powered site. Works with any Ruby website, and has view helpers for Rails and Merb.
|
18
|
+
email: norman@randomba.org
|
19
|
+
executables: []
|
20
|
+
|
21
|
+
extensions: []
|
22
|
+
|
23
|
+
extra_rdoc_files: []
|
24
|
+
|
25
|
+
files:
|
26
|
+
- MIT-LICENSE
|
27
|
+
- README.rdoc
|
28
|
+
- init.rb
|
29
|
+
- lib/disqus.rb
|
30
|
+
- lib/disqus/api.rb
|
31
|
+
- lib/disqus/author.rb
|
32
|
+
- lib/disqus/forum.rb
|
33
|
+
- lib/disqus/post.rb
|
34
|
+
- lib/disqus/thread.rb
|
35
|
+
- lib/disqus/view_helpers.rb
|
36
|
+
- lib/disqus/widget.rb
|
37
|
+
- Rakefile
|
38
|
+
has_rdoc: true
|
39
|
+
homepage: http://randomba.org
|
40
|
+
post_install_message:
|
41
|
+
rdoc_options:
|
42
|
+
- --main
|
43
|
+
- README.rdoc
|
44
|
+
- --inline-source
|
45
|
+
- --line-numbers
|
46
|
+
require_paths:
|
47
|
+
- lib
|
48
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: "0"
|
53
|
+
version:
|
54
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: "0"
|
59
|
+
version:
|
60
|
+
requirements: []
|
61
|
+
|
62
|
+
rubyforge_project: disqus
|
63
|
+
rubygems_version: 1.2.0
|
64
|
+
signing_key:
|
65
|
+
specification_version: 2
|
66
|
+
summary: Integrates Disqus commenting system into your Ruby-powered site.
|
67
|
+
test_files:
|
68
|
+
- test/test_helper.rb
|
69
|
+
- test/config.yml.sample
|
70
|
+
- test/api_test.rb
|
71
|
+
- test/forum_test.rb
|
72
|
+
- test/merb_test.rb
|
73
|
+
- test/post_test.rb
|
74
|
+
- test/rails_test.rb
|
75
|
+
- test/thread_test.rb
|
76
|
+
- test/view_helpers_test.rb
|
77
|
+
- test/widget_test.rb
|
78
|
+
- test/responses/bad_api_key.json
|
79
|
+
- test/responses/create_post.json
|
80
|
+
- test/responses/get_forum_api_key.json
|
81
|
+
- test/responses/get_forum_list.json
|
82
|
+
- test/responses/get_num_posts.json
|
83
|
+
- test/responses/get_thread_by_url.json
|
84
|
+
- test/responses/get_thread_list.json
|
85
|
+
- test/responses/get_thread_posts.json
|
86
|
+
- test/responses/thread_by_identifier.json
|
87
|
+
- test/responses/update_thread.json
|