capistrano-scm-local 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "capistrano-scm-local"
7
- gem.version = '0.1.1'
7
+ gem.version = '0.1.2'
8
8
  gem.authors = ["Boris Gorbylev"]
9
9
  gem.email = ["ekho@ekho.name"]
10
10
  gem.description = %q{Capistrano extension for deploying form local directory}
@@ -6,11 +6,13 @@ require 'zlib'
6
6
  require 'archive/tar/minitar'
7
7
  include Archive::Tar
8
8
  require 'tmpdir'
9
+ require 'fileutils'
9
10
 
10
11
  class Capistrano::Local < Capistrano::SCM
11
12
  module DefaultStrategy
12
13
  def check
13
- test! " [ -d #{repo_url} ] "
14
+ puts repo_url
15
+ test! " [ -e #{repo_url} ] "
14
16
  end
15
17
 
16
18
  def release
@@ -23,7 +25,7 @@ class Capistrano::Local < Capistrano::SCM
23
25
 
24
26
  module ArchiveStrategy
25
27
  def check
26
- test! " [ -d #{repo_url} ] "
28
+ test! " [ -e #{repo_url} ] "
27
29
  end
28
30
 
29
31
  def release
@@ -32,8 +34,12 @@ class Capistrano::Local < Capistrano::SCM
32
34
  run_locally do
33
35
  archive = fetch(:tmp_dir, Dir::tmpdir()) + '/' + fetch(:application, 'distr') + "-#{release_timestamp}.tar.gz"
34
36
  unless File.exists?(archive)
35
- Dir.chdir(repo_url) do
36
- Minitar.pack('.', Zlib::GzipWriter.new(File.open(archive, 'wb')))
37
+ if File.directory?(repo_url) || !File.fnmatch('*.tar.gz', repo_url)
38
+ Dir.chdir(repo_url) do
39
+ Minitar.pack('.', Zlib::GzipWriter.new(File.open(archive, 'wb')))
40
+ end
41
+ else
42
+ FileUtils.cp(repo_url, archive)
37
43
  end
38
44
  end
39
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-scm-local
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: