quotefm 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,13 +9,30 @@ module Quotefm
9
9
  res = HTTParty.get("https://quote.fm/api/user/get/?username="+username.to_s)
10
10
  end
11
11
 
12
- def self.listFollowers username
12
+ def self.listFollowersByUsername username
13
13
  res = HTTParty.get("https://quote.fm/api/user/listFollowers/?username="+username.to_s)
14
14
  end
15
15
 
16
- def self.listFollowings username
16
+ def self.listFollowersByID id
17
+ res = HTTParty.get("https://quote.fm/api/user/listFollowers/?id="+id.to_s)
18
+ end
19
+
20
+ def self.listFollowingsByUsername username
17
21
  res = HTTParty.get("https://quote.fm/api/user/listFollowings/?username="+username.to_s)
18
22
  end
19
23
 
24
+ def self.listFollowingsByID id
25
+ res = HTTParty.get("https://quote.fm/api/user/listFollowings/?id="+id.to_s)
26
+ end
27
+
28
+ #Comatibility to older Version
29
+ def self.listFollowers username
30
+ listFollowersByUsername username
31
+ end
32
+
33
+ def self.listFollowings username
34
+ listFollowingsByUsername username
35
+ end
36
+
20
37
  end
21
38
  end
@@ -1,3 +1,3 @@
1
1
  module Quotefm
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -18,4 +18,5 @@ Gem::Specification.new do |gem|
18
18
  gem.add_dependency "httparty"
19
19
  gem.add_development_dependency "fakeweb", "~> 1.3"
20
20
  gem.add_development_dependency "rspec", "~> 2.9"
21
+ gem.add_development_dependency "gem-release"
21
22
  end
@@ -18,15 +18,39 @@ describe Quotefm::User do
18
18
  response['username'].should == "pwaldhauer"
19
19
  end
20
20
 
21
- it "should get a users followers" do
21
+ it "should get a users followers by username" do
22
22
  stub_uri(:get, "/user/listFollowers/?username=pwaldhauer", "quotefm/user/listFollowers.json")
23
23
  response = Quotefm::User.listFollowers "pwaldhauer"
24
24
  response['totalCount'].should == "464"
25
25
  end
26
26
 
27
- it "should get a users followings" do
27
+ it "should get a users followers by username" do
28
+ stub_uri(:get, "/user/listFollowers/?username=pwaldhauer", "quotefm/user/listFollowers.json")
29
+ response = Quotefm::User.listFollowersByUsername "pwaldhauer"
30
+ response['totalCount'].should == "464"
31
+ end
32
+
33
+ it "should get a users followers by user id" do
34
+ stub_uri(:get, "/user/listFollowers/?id=1", "quotefm/user/listFollowers.json")
35
+ response = Quotefm::User.listFollowersByID 1
36
+ response['totalCount'].should == "464"
37
+ end
38
+
39
+ it "should get a users followings by username (new Syntax)" do
28
40
  stub_uri(:get, "/user/listFollowings/?username=pwaldhauer", "quotefm/user/listFollowings.json")
29
41
  response = Quotefm::User.listFollowings "pwaldhauer"
30
42
  response['totalCount'].should == "141"
31
43
  end
44
+
45
+ it "should get a users followers by username (new Syntax)" do
46
+ stub_uri(:get, "/user/listFollowers/?username=pwaldhauer", "quotefm/user/listFollowers.json")
47
+ response = Quotefm::User.listFollowersByUsername "pwaldhauer"
48
+ response['totalCount'].should == "464"
49
+ end
50
+
51
+ it "should get a users followings by user id" do
52
+ stub_uri(:get, "/user/listFollowings/?id=1", "quotefm/user/listFollowings.json")
53
+ response = Quotefm::User.listFollowingsByID 1
54
+ response['totalCount'].should == "141"
55
+ end
32
56
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quotefm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-01 00:00:00.000000000 Z
12
+ date: 2012-04-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
@@ -59,6 +59,22 @@ dependencies:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: '2.9'
62
+ - !ruby/object:Gem::Dependency
63
+ name: gem-release
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
62
78
  description: Unofficial Wrapper for the Quote.fm REST API
63
79
  email:
64
80
  - moritz.kroeger@googlemail.com