twitter_with_auto_pagination 0.6.2 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -18
  3. data/lib/twitter_with_auto_pagination.rb +42 -1
  4. data/lib/twitter_with_auto_pagination/log_subscriber.rb +2 -2
  5. data/lib/twitter_with_auto_pagination/rest/api.rb +31 -0
  6. data/lib/twitter_with_auto_pagination/rest/extension/clusters.rb +43 -0
  7. data/lib/twitter_with_auto_pagination/rest/extension/favoriting.rb +106 -0
  8. data/lib/twitter_with_auto_pagination/rest/extension/friends_and_followers.rb +131 -0
  9. data/lib/twitter_with_auto_pagination/rest/extension/replying.rb +90 -0
  10. data/lib/twitter_with_auto_pagination/rest/extension/unfollowing.rb +29 -0
  11. data/lib/twitter_with_auto_pagination/rest/favorites.rb +20 -0
  12. data/lib/twitter_with_auto_pagination/rest/friends_and_followers.rb +94 -0
  13. data/lib/twitter_with_auto_pagination/rest/search.rb +19 -0
  14. data/lib/twitter_with_auto_pagination/rest/timelines.rb +37 -0
  15. data/lib/twitter_with_auto_pagination/rest/uncategorized.rb +83 -0
  16. data/lib/twitter_with_auto_pagination/rest/users.rb +62 -0
  17. data/lib/twitter_with_auto_pagination/rest/utils.rb +303 -0
  18. data/spec/helper.rb +60 -1
  19. data/spec/twitter_with_auto_pagination/client_spec.rb +150 -0
  20. data/twitter_with_auto_pagination.gemspec +1 -1
  21. metadata +17 -8
  22. data/lib/twitter_with_auto_pagination/client.rb +0 -139
  23. data/lib/twitter_with_auto_pagination/existing_api.rb +0 -127
  24. data/lib/twitter_with_auto_pagination/new_api.rb +0 -337
  25. data/lib/twitter_with_auto_pagination/utils.rb +0 -303
  26. data/spec/twitter_with_auto_pagination_spec.rb +0 -131
@@ -1,131 +0,0 @@
1
- require 'helper'
2
-
3
- describe TwitterWithAutoPagination do
4
- let(:config) {
5
- {
6
- consumer_key: 'CK',
7
- consumer_secret: 'CS',
8
- access_token: 'AT',
9
- access_token_secret: 'ATS',
10
- }
11
- }
12
- let(:client) { TwitterWithAutoPagination::Client.new(config) }
13
-
14
- describe '#initialize' do
15
- let(:default_call_count) { 0 }
16
-
17
- it 'sets call_count to 0' do
18
- expect(client.call_count).to eq(default_call_count)
19
- end
20
-
21
- context 'without params' do
22
- end
23
-
24
- context 'with params' do
25
- end
26
- end
27
-
28
- describe '#logger' do
29
- it 'has logger' do
30
- expect(client.logger).to be_truthy
31
- end
32
- end
33
-
34
- describe '#call_old_method' do
35
- end
36
-
37
- describe '#collect_with_max_id' do
38
- end
39
-
40
- describe '#collect_with_cursor' do
41
- end
42
-
43
- describe '#file_cache_key' do
44
- end
45
-
46
- describe '#namespaced_key' do
47
- end
48
-
49
- describe '#encode_json' do
50
- end
51
-
52
- describe '#decode_json' do
53
- end
54
-
55
- describe '#fetch_cache_or_call_api' do
56
- end
57
-
58
- describe '#user_timeline' do
59
- it 'calls old_user_timeline' do
60
- expect(client).to receive(:old_user_timeline)
61
- client.user_timeline
62
- end
63
-
64
- it 'calls collect_with_max_id' do
65
- expect(client).to receive(:collect_with_max_id)
66
- client.user_timeline
67
- end
68
- end
69
-
70
- describe '#user_photos' do
71
- it 'calls user_timeline' do
72
- expect(client).to receive(:user_timeline)
73
- client.user_photos
74
- end
75
- end
76
-
77
- describe '#friends' do
78
- it 'calls old_friends' do
79
- expect(client).to receive(:old_friends)
80
- client.friends
81
- end
82
-
83
- it 'calls collect_with_cursor' do
84
- expect(client).to receive(:collect_with_cursor)
85
- client.friends
86
- end
87
- end
88
-
89
- describe '#followers' do
90
- it 'calls old_followers' do
91
- expect(client).to receive(:old_followers)
92
- client.followers
93
- end
94
-
95
- it 'calls collect_with_cursor' do
96
- expect(client).to receive(:collect_with_cursor)
97
- client.followers
98
- end
99
- end
100
-
101
- describe '#friend_ids' do
102
- it 'calls old_friend_ids' do
103
- expect(client).to receive(:old_friend_ids)
104
- client.friend_ids
105
- end
106
-
107
- it 'calls collect_with_cursor' do
108
- expect(client).to receive(:collect_with_cursor)
109
- client.friend_ids
110
- end
111
- end
112
-
113
- describe '#follower_ids' do
114
- it 'calls old_follower_ids' do
115
- expect(client).to receive(:old_follower_ids)
116
- client.follower_ids
117
- end
118
-
119
- it 'calls collect_with_cursor' do
120
- expect(client).to receive(:collect_with_cursor)
121
- client.follower_ids
122
- end
123
- end
124
-
125
- describe '#users' do
126
- it 'calls old_users' do
127
- expect(client).to receive(:old_users)
128
- client.users([1, 2, 3])
129
- end
130
- end
131
- end