twitter-config 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6d02e34ceaf755ed2fa848aef5898b789c922d17
4
- data.tar.gz: 598829062733210f289d5d7a53d92e1c3ee5f167
3
+ metadata.gz: e0987019fe134c5287b8b5bcb54f37a37f83d00e
4
+ data.tar.gz: e3c49b03ac299f413f1cb4bf220ea37caf6efd58
5
5
  SHA512:
6
- metadata.gz: dcea65429403ae9e987af44fb9b92b4a361312efda80d6ea4926a310b16703b625a69276507e01d166c6f3534bd7c9fb7700d817db4aa7d2c1366339e49f7f01
7
- data.tar.gz: b94f3894dca1648ea47f12d1f3e11b203d97dd2649b66c4d633e7bb914e4af6a6d4bd83f30a9daacd778def3438bc95ee8659b4d2cac9c2ff6d9094556e56dc0
6
+ metadata.gz: 2c9a2dba642b2c168e4a37338c42bee828967629fdc7bf0eea35c5e455780ce897336cfabab4cae9cfa22b4ecf2fdaeb902fa356131a886a0b2f370d9b169cdb
7
+ data.tar.gz: 9803ac97918af9127375327457181a4f5556e454ad02f57fad674be76915f59cae125ab014391e96ccc5ea117551e0cdb55f8184b8e0020ddb22cd54d71c013f
@@ -15,18 +15,19 @@ module Twitter::Config
15
15
  def self.for_user(username, options = {})
16
16
  path = options[:path] || "#{ENV['HOME']}/.trc"
17
17
  config_data = YAML.load_file path
18
- user_config = {}
18
+ user_config = nil
19
19
 
20
20
  # we want to be able to handle two different formats - the simple one
21
21
  # with just a list of usernames, and the more complicated .trc format
22
22
  # that has the app ids in it etc
23
23
  if config_data['profiles'].nil?
24
24
  user_config = config_data[username]
25
- else
25
+ elsif !config_data['profiles'][username].nil?
26
26
  user_config = config_data['profiles'][username].values.first
27
27
  end
28
28
 
29
29
  raise "no config found for #{username} in file #{path}" if user_config.nil?
30
+
30
31
  return {
31
32
  :consumer_key => user_config['consumer_key'],
32
33
  :consumer_secret => user_config['consumer_secret'],
@@ -1,5 +1,5 @@
1
1
  module Twitter
2
2
  module Config
3
- VERSION = "1.0.3"
3
+ VERSION = "1.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Reed
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-03 00:00:00.000000000 Z
11
+ date: 2017-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: twitter