codebase 4.0.7 → 4.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/codebase.rb +1 -1
- data/lib/commands/setup.rb +6 -4
- metadata +1 -1
data/lib/codebase.rb
CHANGED
data/lib/commands/setup.rb
CHANGED
@@ -42,12 +42,14 @@ command "setup" do
|
|
42
42
|
puts
|
43
43
|
|
44
44
|
## Get some details
|
45
|
-
domain
|
46
|
-
username
|
47
|
-
|
45
|
+
domain = ask("CodebaseHQ domain (e.g. widgetinc.codebasehq.com): ") { |q| q.validate = /\A(\w+).(codebasehq|cbhqdev).(com|local)\z/ }
|
46
|
+
username = ask("Username: ") { |q| q.validate = /[\w\.]+/ }
|
47
|
+
api_user = username.match(/\//) ? username : "#{domain.split('.')[0]}/#{username}"
|
48
|
+
api_domain = 'api3.codebasehq.com'
|
49
|
+
password = ask("Password: ") { |q| q.echo = false }
|
48
50
|
|
49
51
|
## Get the API key and save it...
|
50
|
-
user_properties = api_request("https://#{
|
52
|
+
user_properties = api_request("https://#{api_domain}/profile", api_user, password)
|
51
53
|
|
52
54
|
if user_properties
|
53
55
|
user = JSON.parse(user_properties)["user"]
|