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 +4 -4
- data/lib/twitter/config.rb +3 -2
- data/lib/twitter/config/version.rb +1 -1
- 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: e0987019fe134c5287b8b5bcb54f37a37f83d00e
|
|
4
|
+
data.tar.gz: e3c49b03ac299f413f1cb4bf220ea37caf6efd58
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2c9a2dba642b2c168e4a37338c42bee828967629fdc7bf0eea35c5e455780ce897336cfabab4cae9cfa22b4ecf2fdaeb902fa356131a886a0b2f370d9b169cdb
|
|
7
|
+
data.tar.gz: 9803ac97918af9127375327457181a4f5556e454ad02f57fad674be76915f59cae125ab014391e96ccc5ea117551e0cdb55f8184b8e0020ddb22cd54d71c013f
|
data/lib/twitter/config.rb
CHANGED
|
@@ -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
|
-
|
|
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'],
|
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.
|
|
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-
|
|
11
|
+
date: 2017-01-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: twitter
|