domrobot 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/domrobot/cli.rb +14 -3
- data/lib/domrobot/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e36814b47094bd18379f21ba6a32e6e15b717b67
|
4
|
+
data.tar.gz: f2aec385092d7864ea53db22daadb0972c9c5c38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d96b3e0707140e4dd7eb6e28384d9f6fa98406cb534fcc6c1cec56605e184a81d274da1448ba2fa580a2176148bf0c2a027f7cb34256583f61002e5306061958
|
7
|
+
data.tar.gz: 70947105c2f1eafd724fbc13111289788e0fd2d43153c9db26ba7fbd803bd9950e62041fd36ea3a8acc0307dcafcd1a561ef978b2d677268496472477ab86bb9
|
data/lib/domrobot/cli.rb
CHANGED
@@ -7,12 +7,23 @@ module Domrobot
|
|
7
7
|
method_option :username, type: :string
|
8
8
|
method_option :password, type: :string
|
9
9
|
method_option :server, type: :string
|
10
|
+
method_option :uri, type: :string
|
10
11
|
def configure file=nil
|
11
12
|
config = file and Config.load file
|
12
13
|
config ||= Config
|
13
|
-
|
14
|
-
|
15
|
-
|
14
|
+
if options["uri"]
|
15
|
+
uri ||= URI URI.escape options["uri"]
|
16
|
+
@username ||= URI.unescape uri.user if uri.user
|
17
|
+
@password ||= URI.unescape uri.password if uri.password
|
18
|
+
@server ||= URI.unescape uri.host if uri.host
|
19
|
+
else
|
20
|
+
@username ||= options["username"]
|
21
|
+
@password ||= options["password"]
|
22
|
+
@server ||= options["server"]
|
23
|
+
end
|
24
|
+
config.general.username = @username if @username
|
25
|
+
config.general.password = @password if @password
|
26
|
+
config.general.server = @server if @server
|
16
27
|
if file
|
17
28
|
config.save(file)
|
18
29
|
else
|
data/lib/domrobot/version.rb
CHANGED