codebase 4.0.7 → 4.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/codebase.rb +1 -1
  2. data/lib/commands/setup.rb +6 -4
  3. metadata +1 -1
@@ -14,7 +14,7 @@ module Codebase
14
14
  class NotConfiguredError < StandardError; end
15
15
  class MustBeInRepositoryError < StandardError; end
16
16
 
17
- VERSION = "4.0.7"
17
+ VERSION = "4.0.8"
18
18
 
19
19
  def run(command, args = [])
20
20
  load_commands
@@ -42,12 +42,14 @@ command "setup" do
42
42
  puts
43
43
 
44
44
  ## Get some details
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
- password = ask("Password: ") { |q| q.echo = false }
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://#{domain}/profile", username, password)
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"]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: codebase
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 4.0.7
5
+ version: 4.0.8
6
6
  platform: ruby
7
7
  authors:
8
8
  - Adam Cooke