sbfaulkner-astrovan 0.5.2 → 0.5.3

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/README.rdoc CHANGED
@@ -26,9 +26,11 @@ This is my attempt.
26
26
  deploy 'git://github.com/sbfaulkner/scanty.git'
27
27
  end
28
28
 
29
- == NOTES
29
+ == CHANGES
30
30
 
31
- - no block for deploy implies mkdir && update
31
+ === 0.5.3
32
+
33
+ - handle github private repository urls
32
34
 
33
35
  == TODO
34
36
 
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 5
4
- :patch: 2
4
+ :patch: 3
@@ -1,3 +1,5 @@
1
+ require 'uri'
2
+
1
3
  module Astrovan
2
4
  module Deploy
3
5
  # Deploy an application to the remote servers.
@@ -19,7 +21,8 @@ module Astrovan
19
21
  original_environment = self.environment.dup
20
22
 
21
23
  self.repository = repository
22
- self.application = application = options[:application] || self.application || File.basename(URI.parse(repository).path.split('/').last,".git")
24
+ self.application = application = options[:application] || self.application || File.basename(parse_repository_uri(repository).path.split('/').last,".git")
25
+
23
26
  self.deploy_to = deploy_to = options[:deploy_to] || self.deploy_to || "/u/apps/#{application}"
24
27
  self.shared_path = shared_path = File.join(deploy_to, 'shared')
25
28
  self.shared_repository = shared_repository = File.join(shared_path, "#{application}.git")
@@ -48,5 +51,19 @@ module Astrovan
48
51
  def share(path, options = {})
49
52
  symlink "#{shared_path}/#{path}", options.merge(:to => "#{release_path}/#{path}")
50
53
  end
54
+
55
+ protected
56
+ def parse_repository_uri(uri)
57
+ # [user@]host.xz:/path/to/repo.git/
58
+ # [user@]host.xz:~user/path/to/repo.git/
59
+ # [user@]host.xz:path/to/repo.git
60
+ GIT_REGEXP = %r'^(?:(\w+)@)?((?:\w+.)*\w+):([/~]?[^/].+)$'
61
+
62
+ if uri =~ GIT_REGEXP
63
+ URI::Generic.new(nil, $1, $2, nil, nil, $3, nil, nil, nil)
64
+ else
65
+ URI.parse(uri)
66
+ end
67
+ end
51
68
  end
52
69
  end
@@ -1,5 +1,3 @@
1
- require 'uri'
2
-
3
1
  module Astrovan
4
2
  module Update
5
3
  def update(options = {})
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sbfaulkner-astrovan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - S. Brent Faulkner
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-21 00:00:00 -08:00
12
+ date: 2009-02-22 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15