twitter_with_auto_pagination 0.8.7 → 0.8.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 56a94b64a5ad2a5729d3c2ad616201f1e067b130
4
- data.tar.gz: 238b267742d48a7e1f0c7221b55f10efcae83c5c
3
+ metadata.gz: 6d767009c6d195d95d8ef07d1f7dae2d2c7ebe23
4
+ data.tar.gz: 8a6b624c9ec6ad652aa8613ca8f99f24e20ce368
5
5
  SHA512:
6
- metadata.gz: fa63ca46d23ccebd336e048626050d29b3d75c1c8a31c8b504bd36fadfc8aab35cddeb10309b1d3eaa93980f39ec5d3c277fce924034c1eec05bf60d29c63831
7
- data.tar.gz: 71f61eb0a34de144ed119914cf4e0bb39d486070647e02dce56ffa9797d95af3a952ddc7a03cfbeb2cf57a48df45745a2f0e4317e74f0f0f0455fca0cabfa991
6
+ metadata.gz: 0511c5f3a28c8a2d70a5372bac83c11ee54667928726e4eded3c762a3efc5c31c7bc6d0fc08a75275f0456997342ad37a48079f6960d70b78ca881564220d068
7
+ data.tar.gz: aa4a35b82774fc8e74c5ea619e68a815ccfdd2700680c686d1bd46042600da9f3a5897371a2a714585f222fa23faeb37f35f321fc4bf8fa59bdb1affdf0456de
@@ -73,15 +73,12 @@ module TwitterWithAutoPagination
73
73
  end
74
74
  end
75
75
 
76
- def close_friends(*args)
77
- options = {uniq: false}.merge(args.extract_options!)
78
- min_max = {
79
- min: options.has_key?(:min) ? options.delete(:min) : 0,
80
- max: options.has_key?(:max) ? options.delete(:max) : 1000
81
- }
76
+ def close_friends(user, uniq: false, min: 0, max: 1000, limit: 30)
77
+ options = {uniq: uniq, min: min, max: max}
78
+ min_max = {min: min, max: max}
82
79
 
83
80
  instrument(__method__, nil, options) do
84
- replying, replied, favoriting = _retrieve_replying_replied_and_favoriting(*args, options)
81
+ replying, replied, favoriting = _retrieve_replying_replied_and_favoriting(user, options)
85
82
 
86
83
  users = replying + replied + favoriting
87
84
  return [] if users.empty?
@@ -97,7 +94,7 @@ module TwitterWithAutoPagination
97
94
  u[:replied_score] = replied_score[u.id]
98
95
  u[:favoriting_score] = favoriting_score[u.id]
99
96
  u
100
- end
97
+ end.slice(0, limit)
101
98
  end
102
99
  end
103
100
  end
@@ -22,5 +22,5 @@ Gem::Specification.new do |spec|
22
22
  spec.required_ruby_version = '>= 2.3'
23
23
  spec.summary = spec.description
24
24
  spec.test_files = Dir.glob('spec/**/*')
25
- spec.version = '0.8.7'
25
+ spec.version = '0.8.8'
26
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter_with_auto_pagination
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.7
4
+ version: 0.8.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shinohara Teruki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-12 00:00:00.000000000 Z
11
+ date: 2016-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: twitter