net 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +3 -3
- data/lib/net/twitter/models/user.rb +3 -2
- data/lib/net/version.rb +1 -1
- data/spec/net/twitter/models/user_spec.rb +4 -4
- 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: 9b053efceeb0e641bd70ad573e3bf0e1878f641c
|
4
|
+
data.tar.gz: b6b8520cb07b0dfba6773e5965b189c54a929051
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9323796a19a43560e2fca3b1264fdfc9f9383bbe726b797a15a84a0658d93b7d929a7aca8ff83f67091f5d9cc35a4f54e8bb0dcb9e80e6e922a1015290c296f2
|
7
|
+
data.tar.gz: 4cc7adbcd3a26fadc51eba3dc3e98be18acb81b812911ec5b02fc7f4ccef8679cde6f8baaa7ef5ebfe3925613e48a608162a8faea8ef1f4a8c2b4ba267b6f9eb
|
data/CHANGELOG.md
CHANGED
@@ -13,3 +13,12 @@ For more information about changelogs, check
|
|
13
13
|
## 0.1.1 - 2014-10-16
|
14
14
|
|
15
15
|
* [FEATURE] Add `Instagram::User` supporting `find_by` and `find_by!`.
|
16
|
+
|
17
|
+
## 0.2.0 - 2014-10-20
|
18
|
+
|
19
|
+
**How to upgrade**
|
20
|
+
|
21
|
+
If your code never calls the `followers_count` method on a `Twitter::User`, then you are good to go.
|
22
|
+
If it does, then replace your calls to `followers_count` with `follower_count` (singular).
|
23
|
+
|
24
|
+
* [ENHANCEMENT] Use the same `follower_count` name both for Twitter and Instagram users
|
data/README.md
CHANGED
@@ -9,7 +9,7 @@ After [configuring your Twitter app](#configuring-your-twitter-app), you can run
|
|
9
9
|
```ruby
|
10
10
|
user = Net::Twitter::User.find_by screen_name: 'fullscreen'
|
11
11
|
user.screen_name #=> "Fullscreen"
|
12
|
-
user.
|
12
|
+
user.follower_count #=> 48_200
|
13
13
|
```
|
14
14
|
After [configuring your Instagram app](#configuring-your-instagram-app), you can run commands like:
|
15
15
|
|
@@ -49,10 +49,10 @@ Use [Net::Twitter::User]() to:
|
|
49
49
|
|
50
50
|
```ruby
|
51
51
|
user = Net::Twitter::User.find_by screen_name: 'fullscreen'
|
52
|
-
user.
|
52
|
+
user.follower_count #=> 48_200
|
53
53
|
|
54
54
|
users = Net::Twitter::User.where screen_name: ['fullscreen', 'brohemian6']
|
55
|
-
users.map(&:
|
55
|
+
users.map(&:follower_count).sort #=> [12, 48_200]
|
56
56
|
```
|
57
57
|
|
58
58
|
*The methods above require a configured Twitter app (see below).*
|
@@ -5,10 +5,11 @@ module Net
|
|
5
5
|
module Twitter
|
6
6
|
module Models
|
7
7
|
class User
|
8
|
-
attr_reader :screen_name, :
|
8
|
+
attr_reader :screen_name, :follower_count
|
9
9
|
|
10
10
|
def initialize(attrs = {})
|
11
11
|
attrs.each{|k, v| instance_variable_set("@#{k}", v) unless v.nil?}
|
12
|
+
@follower_count = attrs['followers_count']
|
12
13
|
end
|
13
14
|
|
14
15
|
# Returns the existing Twitter user matching the provided attributes or
|
@@ -77,4 +78,4 @@ module Net
|
|
77
78
|
end
|
78
79
|
end
|
79
80
|
end
|
80
|
-
end
|
81
|
+
end
|
data/lib/net/version.rb
CHANGED
@@ -14,7 +14,7 @@ describe Net::Twitter::User, :vcr do
|
|
14
14
|
|
15
15
|
it 'returns an object representing that user' do
|
16
16
|
expect(user.screen_name).to eq 'Fullscreen'
|
17
|
-
expect(user.
|
17
|
+
expect(user.follower_count).to be_an Integer
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -37,7 +37,7 @@ describe Net::Twitter::User, :vcr do
|
|
37
37
|
|
38
38
|
it 'returns an object representing that user' do
|
39
39
|
expect(user.screen_name).to eq 'Fullscreen'
|
40
|
-
expect(user.
|
40
|
+
expect(user.follower_count).to be_an Integer
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
@@ -59,7 +59,7 @@ describe Net::Twitter::User, :vcr do
|
|
59
59
|
|
60
60
|
it 'returns an array of objects representing those users' do
|
61
61
|
expect(users.map &:screen_name).to contain_exactly('Fullscreen', 'brohemian6')
|
62
|
-
expect(users.map &:
|
62
|
+
expect(users.map &:follower_count).to all(be_an Integer)
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
@@ -95,4 +95,4 @@ describe Net::Twitter::User, :vcr do
|
|
95
95
|
end
|
96
96
|
end
|
97
97
|
end
|
98
|
-
end
|
98
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Cohen Hoffing
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-10-
|
12
|
+
date: 2014-10-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|