stackconnect 0.1.3 → 0.1.4
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.
- checksums.yaml +4 -4
- data/lib/stackconnect.rb +4 -2
- data/spec/stack_spec.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be54d68d1c8f725ec41dbdc45c4f340aa78e53e4
|
4
|
+
data.tar.gz: 90d1dbcebf33ef18af2ce4c383378f618870a865
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 500346923384c801629564f4f85e14db0eb2721ddb40d7d53c32ec16cf3c0bd9b9316bd39cfa16ae7ab557d9c86815d32828debb0b13c3a2c58cd267dbe6ef90
|
7
|
+
data.tar.gz: 14d28ed3140629f401768f791b4a60ca35dcbcedb1da10296965c76de2bc79d2f4867f02339fe1f2aee4caac6574c2c1060800a3767e0797a80ad6fb6584878d
|
data/lib/stackconnect.rb
CHANGED
@@ -5,11 +5,12 @@ require 'uri'
|
|
5
5
|
class StackConnect
|
6
6
|
attr_accessor :api, :site, :uri
|
7
7
|
|
8
|
-
@@VERSION = "0.1.
|
8
|
+
@@VERSION = "0.1.4"
|
9
9
|
@@api = 'http://api.stackexchange.com/'
|
10
10
|
@@site = 'stackoverflow'
|
11
11
|
@@api_v = '/2.2/'
|
12
12
|
@@uri = URI(@@api)
|
13
|
+
@@earliest_date = 1230793200
|
13
14
|
|
14
15
|
def retrieve_users(page)
|
15
16
|
args = {:sort=> 'reputation', :page=>page, :pagesize=> 100, :order=>'desc'}
|
@@ -28,7 +29,8 @@ class StackConnect
|
|
28
29
|
end
|
29
30
|
|
30
31
|
def retrieve_tags(from_date)
|
31
|
-
|
32
|
+
raise "Date is too early, must be after January 1, 2009" if from_date < @@earliest_date
|
33
|
+
args = { :fromdate => from_date, :sort=>'popular', :order=>'desc'}
|
32
34
|
form_query(@@api_v + 'tags', args)
|
33
35
|
end
|
34
36
|
|
data/spec/stack_spec.rb
CHANGED
@@ -20,6 +20,11 @@ describe StackConnect do
|
|
20
20
|
@connect.retrieve_tags(date).should be_a(Hash)
|
21
21
|
end
|
22
22
|
|
23
|
+
it "should raise date error" do
|
24
|
+
date = 1230793200
|
25
|
+
lambda {@connect.retrieve_tags(date)}.should raise_error
|
26
|
+
end
|
27
|
+
|
23
28
|
it "retrieve hot questions returns json object" do
|
24
29
|
date = Date.today.to_time.to_i
|
25
30
|
@connect.retrieve_hot_questions(date, 1).should be_a(Hash)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stackconnect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- amirtcheva
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|