stack_overflow 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -30,6 +30,18 @@ API documentation can be found at http://api.stackoverflow.com/1.1/usage/methods
30
30
 
31
31
  StackOverflow.get_user_tags(#user_id)
32
32
 
33
+ == Get User's Questions
34
+
35
+ API documentation can be found at http://api.stackoverflow.com/1.1/usage/methods/questions
36
+
37
+ StackOverflow.get_user_questions(#user_id)
38
+
39
+ == Get User's Answers
40
+
41
+ API documentation can be found at http://api.stackoverflow.com/1.1/usage/methods/answers
42
+
43
+ StackOverflow.get_user_answers(#user_id)
44
+
33
45
  == Get Tags
34
46
 
35
47
  API documentation can be found at http://api.stackoverflow.com/1.1/usage/methods/tags
Binary file
@@ -1,3 +1,3 @@
1
1
  module StackOverflow
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -19,6 +19,17 @@ class StackOverflow
19
19
  result = get(@@URL + "users/#{user_id}?key=#{@@API_KEY}")
20
20
  result["users"]
21
21
  end
22
+
23
+ def self.get_user_questions(user_id)
24
+ result = get(@@URL + "users/#{user_id}/questions?key=#{@@API_KEY}")
25
+ result["questions"]
26
+ end
27
+
28
+
29
+ def self.get_user_answers(user_id)
30
+ result = get(@@URL + "users/#{user_id}/answers?key=#{@@API_KEY}")
31
+ result["answers"]
32
+ end
22
33
 
23
34
  def self.get_user_tags(user_id)
24
35
  get(@@URL + "users/#{user_id}/tags?key=#{@@API_KEY}")
@@ -46,4 +46,20 @@ describe StackOverflow do
46
46
  it { @tags_synonyms["tag_synonyms"].count.should > 0 }
47
47
  end
48
48
 
49
+ describe "get users answers" do
50
+ before(:each) do
51
+ @answers = StackOverflow.get_user_answers(363881)
52
+ end
53
+ it { @answers.should_not be_nil }
54
+ it { @answers.count.should > 0 }
55
+ end
56
+
57
+ describe "get users questions" do
58
+ before(:each) do
59
+ @questions = StackOverflow.get_user_questions(363881)
60
+ end
61
+ it { @questions.should_not be_nil }
62
+ it { @questions.count.should > 0 }
63
+ end
64
+
49
65
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 5
9
- version: 0.0.5
8
+ - 6
9
+ version: 0.0.6
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-02-15 00:00:00 -06:00
17
+ date: 2011-03-29 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency