stackconnect 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3808e3fb5adadcd2176ed5b77b0535fb830af165
4
- data.tar.gz: bbfe091756e14e3450daaf833aa760d36ccbff51
3
+ metadata.gz: 584521866f19a44852be42c2b887bc195a1a6b4c
4
+ data.tar.gz: 62ac6e796de6db00704ddbdea97346ca9a909f8c
5
5
  SHA512:
6
- metadata.gz: 5b71a71ca9921fd9232c758e08d485bc2b7a0380f381537bbe38bdf2e9f522173e52e2dc2b98f0318e1bda9e529aa7388d0462af142a12533c629f5da4ea75bd
7
- data.tar.gz: 251951d397c7704e9f0395a625b8f9ee444693e6c4e05435e389330832daaa4294a0501f8f0f67f2f9315f0e268b604e5108501bfea14d6fb51b233e0f89c570
6
+ metadata.gz: 8a7b8cd77e17362026ecf66d7ef953382bdf89c164ddbb5ce6cb95d98e5cc588ea5f755a467fd3500d99da127d6cc74ff77aa42e10f7c41a27df82fc748f5bef
7
+ data.tar.gz: 8ac1331b3d950d7e76fb822baeb2d30873b31b666ec3aff5d7f7cf0689e1bb897dc4b45a933c91ea4208eca096a757ed54573aca42ba3e5d48da114db3998bdc
data/lib/stackconnect.rb CHANGED
@@ -5,7 +5,7 @@ require 'uri'
5
5
  class StackConnect
6
6
  attr_accessor :api, :site, :uri
7
7
 
8
- @@VERSION = "0.0.1"
8
+ @@VERSION = "0.0.2"
9
9
  @@api = 'http://api.stackexchange.com/'
10
10
  @@site = 'stackoverflow'
11
11
  @@uri = URI(@@api)
@@ -17,6 +17,12 @@ class StackConnect
17
17
  count = data["total"]
18
18
  end
19
19
 
20
+ def retrieve_most_popular_tags
21
+ @@uri.path = '/2.1/tags'
22
+ @@uri.query = ({ :order=>'desc', :sort=>'popular', :site=>@@site}).to_query
23
+ data = JSON.parse(@@uri.open.read)
24
+ end
25
+
20
26
  def self.return_version
21
27
  @@VERSION
22
28
  end
data/spec/stack_spec.rb CHANGED
@@ -6,10 +6,14 @@ describe StackConnect do
6
6
  puts @connect.api
7
7
  end
8
8
 
9
- it "should return an integer " do
9
+ it "retrieve questions should return an integer " do
10
10
  date = Date.today.to_time.to_i
11
- puts @connect.retrieve_total_questions(date).to_i.should be_a(Fixnum)
11
+ @connect.retrieve_total_questions(date).to_i.should be_a(Fixnum)
12
12
  end
13
+
14
+ it "retrieve popular tags should return array" do
15
+ @connect.retrieve_most_popular_tags.should be_a(Hash)
16
+ end
13
17
  end
14
18
 
15
19
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stackconnect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - amirtcheva