stack_overflow 0.0.2 → 0.0.3
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/README.rdoc +6 -0
- data/lib/stack_overflow.rb +4 -0
- data/lib/stack_overflow/version.rb +1 -1
- data/spec/stack_overflow_spec.rb +8 -2
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -24,6 +24,12 @@ You can also get a group of users by using
|
|
24
24
|
|
25
25
|
StackOverflow.get_users([#user_id1, #user_id2, etc])
|
26
26
|
|
27
|
+
== Get User's Tags
|
28
|
+
|
29
|
+
API documentation can be found at http://api.stackoverflow.com/1.0/help/method?method=users/{id}/tags
|
30
|
+
|
31
|
+
StackOverflow.get_user_tags(#user_id)
|
32
|
+
|
27
33
|
== Work in progress
|
28
34
|
|
29
35
|
This is a work in progress as I use the API for my application.
|
data/lib/stack_overflow.rb
CHANGED
@@ -18,4 +18,8 @@ class StackOverflow
|
|
18
18
|
result = get("http://api.stackoverflow.com/1.0/users/#{user_id}?key=#{@@API_KEY}")
|
19
19
|
result["users"]
|
20
20
|
end
|
21
|
+
|
22
|
+
def self.get_user_tags(user_id)
|
23
|
+
get("http://api.stackoverflow.com/1.0/users/#{user_id}/tags?key=#{@@API_KEY}")
|
24
|
+
end
|
21
25
|
end
|
data/spec/stack_overflow_spec.rb
CHANGED
@@ -13,7 +13,7 @@ describe StackOverflow do
|
|
13
13
|
it { @user["display_name"].should == "JB"}
|
14
14
|
end
|
15
15
|
|
16
|
-
describe "get
|
16
|
+
describe "get users" do
|
17
17
|
before(:each) do
|
18
18
|
@users = StackOverflow.get_users([60336, 3381])
|
19
19
|
end
|
@@ -22,5 +22,11 @@ describe StackOverflow do
|
|
22
22
|
it { @users.select{|u| u["display_name"] == "Ben Scheirman"}.should_not be_nil }
|
23
23
|
end
|
24
24
|
|
25
|
-
|
25
|
+
describe "get user tags" do
|
26
|
+
before(:each) do
|
27
|
+
@tags = StackOverflow.get_user_tags(60336)
|
28
|
+
end
|
29
|
+
it { @tags.should_not be_nil }
|
30
|
+
it { @tags["tags"].count.should > 0 }
|
31
|
+
end
|
26
32
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 3
|
9
|
+
version: 0.0.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Jonathan Birkholz
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-01-
|
17
|
+
date: 2011-01-13 00:00:00 -06:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|