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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 936c43b38462cae57221b9992994d3e8e767f5cd
4
- data.tar.gz: ea789f7e15df8dd201fcaac9bb74f80a3f5982fe
3
+ metadata.gz: 9b053efceeb0e641bd70ad573e3bf0e1878f641c
4
+ data.tar.gz: b6b8520cb07b0dfba6773e5965b189c54a929051
5
5
  SHA512:
6
- metadata.gz: 9780280470cdcf98a13c1d3c2cf384a0dd6f1ea3e913224d851ba682a67dd118549fe619987eeaec92852976def7695ecf7e94a88530594b3a0cca8a7f710986
7
- data.tar.gz: 1c7d9f4a06aa83f4bac0a5f189feed5023a9f50d79ba7b6162a853e027af81ab1d516493e974588a030e8e506117e3f22e78e10aa7f0996c8df9eea7158c7259
6
+ metadata.gz: 9323796a19a43560e2fca3b1264fdfc9f9383bbe726b797a15a84a0658d93b7d929a7aca8ff83f67091f5d9cc35a4f54e8bb0dcb9e80e6e922a1015290c296f2
7
+ data.tar.gz: 4cc7adbcd3a26fadc51eba3dc3e98be18acb81b812911ec5b02fc7f4ccef8679cde6f8baaa7ef5ebfe3925613e48a608162a8faea8ef1f4a8c2b4ba267b6f9eb
@@ -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.followers_count #=> 48_200
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.followers_count #=> 48_200
52
+ user.follower_count #=> 48_200
53
53
 
54
54
  users = Net::Twitter::User.where screen_name: ['fullscreen', 'brohemian6']
55
- users.map(&:followers_count).sort #=> [12, 48_200]
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, :followers_count
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
@@ -1,3 +1,3 @@
1
1
  module Net
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -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.followers_count).to be_an Integer
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.followers_count).to be_an Integer
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 &:followers_count).to all(be_an Integer)
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.1.1
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-16 00:00:00.000000000 Z
12
+ date: 2014-10-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport