factor 0.0.83 → 0.0.84
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cli/command.rb +4 -3
- data/lib/client/client.rb +1 -2
- metadata +1 -1
data/lib/cli/command.rb
CHANGED
@@ -8,26 +8,27 @@ require 'rest_client'
|
|
8
8
|
module Factor
|
9
9
|
module CLI
|
10
10
|
class Command < Thor
|
11
|
-
|
11
|
+
|
12
12
|
|
13
13
|
|
14
14
|
no_tasks do
|
15
15
|
|
16
16
|
def initialize(*vals)
|
17
|
+
@config_file_dir = File.expand_path("~/.factor")
|
17
18
|
@client = Factor::Client::Client.new
|
18
19
|
@client.login_token(get_config[:token])
|
19
20
|
super(*vals)
|
20
21
|
end
|
21
22
|
|
22
23
|
def save_config(config)
|
23
|
-
File.open(
|
24
|
+
File.open(@config_file_dir,'w') do |file|
|
24
25
|
YAML::dump(config,file)
|
25
26
|
end
|
26
27
|
@client.login_token(get_config[:token])
|
27
28
|
end
|
28
29
|
|
29
30
|
def get_config
|
30
|
-
File.exists?(
|
31
|
+
File.exists?(@config_file_dir) ? YAML::load_file(@config_file_dir) : {}
|
31
32
|
end
|
32
33
|
end
|
33
34
|
end
|
data/lib/client/client.rb
CHANGED