capistrano-scm-local 0.1.20 → 0.1.21

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjZkZGM5ODM2MDAwMTY0OGU5MDJmZjk5NjBkZTFkMjhiOTA1OTQxYg==
4
+ NGRmNTY3NzdhM2NlMDczMTRjYjYxOWViMDUyZTI1Y2Q0MGJhY2NmMg==
5
5
  data.tar.gz: !binary |-
6
- MDJhNjhlZmJhMDEyZjlkMWE3ZWY2YzVmZmQzZGM2MjQ1MGM2MzNlZQ==
6
+ YTRlNzhjY2NmMTU2YjQ1MmY0ZmFjYWQ3MzMwMDg1ZTc5YTQ4ZDFkYQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZmFjNTdhOGIyZDgxODIzZTg2MjU0NDVlNjI1OGQ2MGI1NTlkYzI0ZGY0MGRh
10
- OGM0MzlhZTlkNjg1YzUwYzIxYWQyYzYxMDA5NjAxMDM4MmFkZjlhYzk5YjU3
11
- MDhlNmJlMjkzN2Y3MjBiZGJiZTdiNGEwZGY3ZTA5YjEyYzJkNjE=
9
+ NWNiMzg5MDJiMDc1ZGE0MzY2YThkNDBjYzA0YzMxYTdkMWQxMmU2Yzk3MDdm
10
+ OTk1OTI3MGEyMzcyOTRiMzQwOWY1MWFkYzhkNTYzYzYwZjAzZDE0YmVmN2Q2
11
+ ZTg5YTRmYjZkMWE0Mjg1NGM4MDg0NmRjMzY4ZmE1MTI0ODIzM2E=
12
12
  data.tar.gz: !binary |-
13
- Yzk3MGE1ZGI1NjU1OWZiMmMwNjgwMmEwNGQ1YTE4Mzg0ZjQ0ODA3ZmEyNTVi
14
- OThiODQ0NjZlM2M3OTVmNWZjNzU3NTEwMzk5ODA1MTY2MTQ1ZTQ1MDA1NWYw
15
- ZWRmMDQzN2EyMDZjN2QzNGMwMWYyYjkxYzZiZjZjZDk4ZjM4MTA=
13
+ NWFlODUyYjk3NWRlOTZhYjdiNTRjMGM4NmRmZDRlZGQ1NjZjZDAyMGQ0OTRl
14
+ YTg3YWZkMTU4NTc4NWRiMzU0ZmU0ZDJjNGY2ZmE2MTg0YTlhMDRjNTgyNDU2
15
+ NzRjMTQ1NjUzMGQwODZkNzAyNDAxZDRlMGZlNDA4MmJiYTUxZWY=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.20
1
+ 0.1.21
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: capistrano-scm-local 0.1.20 ruby lib
5
+ # stub: capistrano-scm-local 0.1.21 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "capistrano-scm-local"
9
- s.version = "0.1.20"
9
+ s.version = "0.1.21"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Boris Gorbylev"]
14
- s.date = "2015-03-02"
14
+ s.date = "2015-03-03"
15
15
  s.description = "Capistrano extension for deploying form local directory"
16
16
  s.email = "ekho@ekho.name"
17
17
  s.extra_rdoc_files = [
@@ -32,9 +32,21 @@ class Capistrano::Local < Capistrano::SCM
32
32
 
33
33
  def release
34
34
  archive = ''
35
+
36
+ compression_flag = fetch(:scm_local_archive_compression_flag, 'z');
37
+ case compression_flag
38
+ when 'z'
39
+ archive_extension = '.tar.gz'
40
+ when 'j'
41
+ archive_extension = '.tar.bz'
42
+ else
43
+ archive_extension = '.tar'
44
+ compression_flag = ''
45
+ end
46
+
35
47
  # preparing archive
36
48
  run_locally do
37
- archive = fetch(:tmp_dir, Dir::tmpdir()) + '/capistrano/' + fetch(:application, 'distr') + "-#{fetch(:current_revision, 'UNKNOWN').strip}.tar.gz"
49
+ archive = fetch(:tmp_dir, Dir::tmpdir()) + '/capistrano/' + fetch(:application, 'distr') + "-#{fetch(:current_revision, 'UNKNOWN').strip}#{archive_extension}"
38
50
  debug "Archiving #{repo_url} to #{archive}"
39
51
  execute :mkdir, '-p', File.dirname(archive)
40
52
 
@@ -43,11 +55,11 @@ class Capistrano::Local < Capistrano::SCM
43
55
  end
44
56
 
45
57
  unless File.exists?(archive)
46
- if File.directory?(repo_url) || !File.fnmatch('*.tar.gz', repo_url)
58
+ if File.directory?(repo_url) || !File.fnmatch("*#{archive_extension}", repo_url)
47
59
  within repo_url do
48
- execute :tar, 'czf', archive, '-C', repo_url, '.'
60
+ execute :tar, "c#{compression_flag}f", archive, '-C', repo_url, '.'
49
61
  end
50
- execute :tar, 'tzf', archive unless fetch(:scm_local_skip_tar_check, false)
62
+ execute :tar, "t#{compression_flag}f", archive unless fetch(:scm_local_skip_tar_check, false)
51
63
  else
52
64
  execute :cp, repo_url, archive
53
65
  end
@@ -59,7 +71,7 @@ class Capistrano::Local < Capistrano::SCM
59
71
  debug "Uploading #{archive} to #{host}:#{release_path}"
60
72
  upload! archive, releases_path, verbose: false
61
73
  remote_archive = File.join(releases_path, File.basename(archive))
62
- execute :tar, 'xzf', remote_archive, '-C', release_path
74
+ execute :tar, "x#{compression_flag}f", remote_archive, '-C', release_path
63
75
  execute :rm, '-f', remote_archive
64
76
  end
65
77
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-scm-local
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20
4
+ version: 0.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boris Gorbylev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-02 00:00:00.000000000 Z
11
+ date: 2015-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shoulda