dockly 3.0.3 → 3.0.4

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
- YmNhMzRkODVhZjJjNTY2YmEyZmNlMmFkZTI0OTk0ZDcwZDIyYjVhOQ==
4
+ ODhhMjA1MzAwZGY2ZmVkYzJiYjUxZjk3ZmM1MDM0OTI2MWY5NGJlMA==
5
5
  data.tar.gz: !binary |-
6
- MTNhMWM1ZjUzOGI0NTNhYTM0NWEwODYzZjVmOGJjYzQwMjU0ODg5YQ==
6
+ YjU3NzRlOTE4ZmY3ZDAyOGI0YjI0ZDM4OWY3YTJlZjI2ZGY3ZWFmNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZGQ2ZjVlM2M3OGQ4NzU1ZTIwNzM4MDQ4YmM5MjUxZDBhYzJiZmQwYjczN2E1
10
- M2FmMDQ4NDZlYjk4ODJkN2Q5NjJkOWNlZWZmYzc2MmZmNzliZjE1NzM2ZGEx
11
- Y2ZkNjAzNzllYTc1NmYxNWMyYTEwNjUwZDE4OTU4YmNkY2Y0NmI=
9
+ ZTBjY2M0ODFlNzU5NDlmNTU0M2UwZjgzZmRiODcyMGVjNzJhNGZhZWM2NjA3
10
+ MDkwNTNiNGVmZTJhMWIwOGJlNTQwZjJiYzkxM2Y5ZTQxYzM2NjBiNmFhMDc5
11
+ MTIyNjU5NDZlZmVhMmU0NzQ3NGJiYTg5Y2ExZTI4M2Q2ZTc4ZGM=
12
12
  data.tar.gz: !binary |-
13
- MjEyOTM0OWE2NjY1NmFhYmY0M2Y2MmFiZDgxZTFlOTJhZTY2ODYzYzYyNDcz
14
- YTdiNzQ3OGI1ODNjMmZmNDVkYzQ4OWZkZjE5YTEzMmIxZGYzNGYyYzM5MmNj
15
- ZDhmZDViMGQ2MWNlNmMyZDk4NTA4Y2I4NmUyNzliMjJlNjBjNjI=
13
+ NTgxN2ZjYWYzMjg4YTI1MmE4OGRlODZmZTQ2MTFlZTdhNmVjNWM0MzYyYzE2
14
+ MDcxMzU3N2U5ZGFhZDUxNjI5NDQ2OTI3YTQxNmE0YmIzZGU1NTNhZmQyYTU2
15
+ N2I3YTdjZjQyOGRiNTJhZDI2ZGM1MDQ1ZWQxZWNmMmYzOGUyY2Q=
data/lib/dockly.rb CHANGED
@@ -5,6 +5,7 @@ require 'foreman/cli_fix'
5
5
  require 'foreman/export/base_fix'
6
6
  require 'rugged'
7
7
  require 'aws-sdk'
8
+ require 'open3'
8
9
 
9
10
  module Dockly
10
11
  LOAD_FILE = 'dockly.rb'
@@ -25,14 +25,18 @@ module Dockly::Util::Git
25
25
  end
26
26
 
27
27
  def archive(oid, prefix, output)
28
- Gem::Package::TarWriter.new(output) do |tar|
29
- ls_files(oid).each do |blob|
30
- name, mode = blob.values_at(:name, :filemode)
31
- prefixed = File.join(prefix, name)
32
- tar.add_file(prefixed, mode) do |tar_out|
33
- tar_out.write(File.read(name))
34
- end
35
- end
28
+ prefix = prefix.dup
29
+ unless prefix[-1] == '/'; prefix << '/'; end
30
+
31
+ cmd = ['git','archive',"--prefix=#{prefix}",'--output=/dev/stdout',oid]
32
+ Open3.popen3(*cmd) do |stdin, stdout, stderr, wait_thr|
33
+ stdin.close
34
+
35
+ output.write(stdout.read)
36
+ process_status = wait_thr.value
37
+ exit_status = process_status.exitstatus
38
+
39
+ raise "#{cmd.join(' ')} exitted non-zero: #{exit_status}" unless exit_status.zero?
36
40
  end
37
41
  end
38
42
  end
@@ -1,7 +1,7 @@
1
1
  module Dockly
2
2
  MAJOR = 3
3
3
  MINOR = 0
4
- PATCH = 3
4
+ PATCH = 4
5
5
  RELEASE = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, PATCH, RELEASE].compact.join('.')
@@ -28,10 +28,22 @@ describe Dockly::Util::Git do
28
28
  it 'archives the current directory into the given IO' do
29
29
  subject.archive(subject.sha, prefix, io)
30
30
  reader.each do |entry|
31
- expect(entry.full_name).to start_with(prefix)
32
- orig = entry.full_name.gsub(/\A#{prefix}\//, '')
33
- expect(File.exist?(orig)).to be_true
34
- expect(entry.read).to eq(File.read(orig)) if orig.end_with?('.rb')
31
+ if entry.full_name == 'pax_global_header'
32
+ expect(entry.header.typeflag).to eq('g')
33
+ else
34
+ expect(entry.full_name).to start_with(prefix)
35
+ orig = entry.full_name.gsub(/\A#{prefix}/, '.')
36
+ expect(File.exist?(orig)).to be_true
37
+ expect(entry.read).to eq(File.read(orig)) if orig.end_with?('.rb')
38
+ end
39
+ end
40
+ end
41
+
42
+ context 'with a really long prefix' do
43
+ let(:prefix) { '/' + ('a' * 255) }
44
+ it 'exhibits the tar extended headers' do
45
+ subject.archive(subject.sha, prefix, io)
46
+ expect(io.string.include?("path=#{prefix}")).to be true
35
47
  end
36
48
  end
37
49
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dockly
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swipely, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-27 00:00:00.000000000 Z
11
+ date: 2015-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp