domrobot 0.1.1 → 0.1.2

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: 3bbd0b38d119b13aabac919f3154128a7f724f85
4
- data.tar.gz: 07c5988794c9fb91efaa9d99dc3595c319349e7b
3
+ metadata.gz: e36814b47094bd18379f21ba6a32e6e15b717b67
4
+ data.tar.gz: f2aec385092d7864ea53db22daadb0972c9c5c38
5
5
  SHA512:
6
- metadata.gz: 3d309924c0937587c3fc27f732343c8e586e14134e955000cf563a66de60ac2b6abb453c18e4318c6c105dc5939c6981733b77a233736c074915ecf47bf36cca
7
- data.tar.gz: 216d9e5152c25b32a5b5f08550d7a3cc8833bf4e889c722ce998d7df5a40d453be5117b30a9f57551a09cd4ae0f982e4e9c9172e3248f8a9df9f9da115332ff9
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
- config.general.username = options["username"] if options["username"]
14
- config.general.password = options["password"] if options["password"]
15
- config.general.server = options["server"] if options["server"]
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
@@ -1,3 +1,3 @@
1
1
  module Domrobot
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: domrobot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathias Kaufmann