codebase 4.0.5 → 4.0.6
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.
- data/lib/codebase.rb +2 -2
- data/lib/codebase/command.rb +11 -3
- metadata +5 -7
data/lib/codebase.rb
CHANGED
@@ -14,7 +14,7 @@ module Codebase
|
|
14
14
|
class NotConfiguredError < StandardError; end
|
15
15
|
class MustBeInRepositoryError < StandardError; end
|
16
16
|
|
17
|
-
VERSION = "4.0.
|
17
|
+
VERSION = "4.0.6"
|
18
18
|
|
19
19
|
def run(command, args = [])
|
20
20
|
load_commands
|
@@ -118,7 +118,7 @@ Codebase.command "help" do |command|
|
|
118
118
|
end
|
119
119
|
end
|
120
120
|
else
|
121
|
-
puts "Command Not Found. Check '
|
121
|
+
puts "Command Not Found. Check 'cb help' for a full list of commands available to you."
|
122
122
|
end
|
123
123
|
end
|
124
124
|
end
|
data/lib/codebase/command.rb
CHANGED
@@ -30,12 +30,20 @@ module Codebase
|
|
30
30
|
domain && username && apikey
|
31
31
|
end
|
32
32
|
|
33
|
+
def new_username?
|
34
|
+
git_config_variable(:username).match(/(.+)\/(.+)/)
|
35
|
+
end
|
36
|
+
|
33
37
|
def domain
|
34
|
-
@domain ||= git_config_variable(:domain)
|
38
|
+
@domain ||= new_username? ? "#{new_username?[1]}.codebasehq.com" : git_config_variable(:domain)
|
35
39
|
end
|
36
40
|
|
37
41
|
def username
|
38
|
-
@username ||= git_config_variable(:username)
|
42
|
+
@username ||= new_username? ? new_username?[2] : git_config_variable(:username)
|
43
|
+
end
|
44
|
+
|
45
|
+
def api_username
|
46
|
+
@api_username = "#{domain.split('.').first}/#{username}"
|
39
47
|
end
|
40
48
|
|
41
49
|
def apikey
|
@@ -119,7 +127,7 @@ module Codebase
|
|
119
127
|
end
|
120
128
|
|
121
129
|
def api(path, data = nil)
|
122
|
-
api_request("http
|
130
|
+
api_request("http://api3.codebasehq.com/#{path}", api_username, apikey, data)
|
123
131
|
end
|
124
132
|
|
125
133
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codebase
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 51
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 4
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 4.0.
|
9
|
+
- 6
|
10
|
+
version: 4.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Adam Cooke
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-05-
|
19
|
-
default_executable:
|
18
|
+
date: 2011-05-17 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: highline
|
@@ -85,7 +84,6 @@ files:
|
|
85
84
|
- lib/commands/clone.rb
|
86
85
|
- lib/commands/keys.rb
|
87
86
|
- lib/commands/setup.rb
|
88
|
-
has_rdoc: false
|
89
87
|
homepage: http://www.codebasehq.com
|
90
88
|
licenses: []
|
91
89
|
|
@@ -115,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
113
|
requirements: []
|
116
114
|
|
117
115
|
rubyforge_project:
|
118
|
-
rubygems_version: 1.
|
116
|
+
rubygems_version: 1.7.2
|
119
117
|
signing_key:
|
120
118
|
specification_version: 3
|
121
119
|
summary: Gem companion for your Codebase account. Including interactive cloning, key management and more
|