rake-funnel 0.0.4.pre → 0.0.5.pre

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c5421eb82b05425c0ec2fb547335b696baa93b1
4
- data.tar.gz: efc075719e3703ec0acb7142f9bba7c38ab36dc8
3
+ metadata.gz: 276f461ed75b3b78a82c23de466ed0f8057b6019
4
+ data.tar.gz: ff755cdb17ebc083b62c378823bc0f85211bef92
5
5
  SHA512:
6
- metadata.gz: 01310922f9a669085abc9ea77581045c78bcde0affb9de7546c81dde79b162ee63c328d4be91885f4b178297a80202563ec79bd8508d49528a5243832c619ac7
7
- data.tar.gz: 24cf888b65ba0cd36fa6b801fad51ae702c8cd302a08e19b5d61a118afb188c76f1646cac5c718bfde65e90d2cfd42ac05b149d9f11aa7173a8daf02286fc0fe
6
+ metadata.gz: 08f26a42351dd4c114dd6c0ab367c7af0707d98cfdd5da12f88317f7ef52776dc3725b6624d055a2b6d34aa81ed28185fd9f9d20f8ca2e13e1e78fe03dd4f1f6
7
+ data.tar.gz: fece830b5b3479da6c8b161897529709e125776361074f47ca1f6bed80fa0d45794d22a4609f814f9edc58385c7ebf234d012a270c89bd6e81e335535fd511f6
@@ -52,7 +52,7 @@ module Rake::Funnel::Integration::TeamCity
52
52
  destination = File.join(File.dirname(nunit), 'addins')
53
53
 
54
54
  RakeFileUtils.mkdir_p(destination)
55
- RakeFileUtils.cp(addin_files, destination)
55
+ RakeFileUtils.cp(addin_files, destination, { preserve: true })
56
56
  end
57
57
  end
58
58
  end
@@ -31,7 +31,7 @@ module Rake::Funnel::Tasks
31
31
  dir = File.dirname(target)
32
32
  RakeFileUtils.mkdir_p(dir) unless File.directory?(dir)
33
33
 
34
- RakeFileUtils.cp(source, target)
34
+ RakeFileUtils.cp(source, target, { preserve: true})
35
35
  end
36
36
  end
37
37
 
@@ -53,11 +53,18 @@ module Rake::Funnel::Tasks
53
53
  files.each do |file|
54
54
  zipped_file = get_zipped_path(common_path, file)
55
55
 
56
- zip.add(zipped_file, file)
56
+ entry = zip.add(zipped_file, file)
57
+ set_mtime(entry, file)
57
58
  end
58
59
  end
59
60
  end
60
61
 
62
+ # To work around this bug: https://github.com/rubyzip/rubyzip/issues/176
63
+ def set_mtime(entry, file)
64
+ entry.time = ::Zip::DOSTime.at(File.mtime(file))
65
+ entry.extra.delete('UniversalTime')
66
+ end
67
+
61
68
  def get_zipped_path(common_path, file)
62
69
  file = Pathname.new(file).relative_path_from(Pathname.new(common_path)).to_s unless common_path.nil?
63
70
  file = File.join(zip_root, file) unless zip_root.nil? || zip_root.empty?
@@ -1,5 +1,5 @@
1
1
  module Rake
2
2
  module Funnel
3
- VERSION = '0.0.4.pre'
3
+ VERSION = '0.0.5.pre'
4
4
  end
5
5
  end
@@ -43,7 +43,7 @@ describe Rake::Funnel::Integration::TeamCity::NUnitPlugin do
43
43
  end
44
44
 
45
45
  it 'should copy the addin from TeamCity to NUnit' do
46
- expect(RakeFileUtils).to have_received(:cp).with(addin_dlls, File.join(File.dirname(which), 'addins'))
46
+ expect(RakeFileUtils).to have_received(:cp).with(addin_dlls, File.join(File.dirname(which), 'addins'), { preserve: true })
47
47
  end
48
48
 
49
49
  it 'should report that the addin is installed' do
@@ -91,7 +91,7 @@ describe Rake::Funnel::Tasks::Copy do
91
91
  source
92
92
  .select { |src| !File.directory?(src) }
93
93
  .each do |src|
94
- expect(RakeFileUtils).to have_received(:cp).with(src, File.join(subject.target, no_prefix(src)))
94
+ expect(RakeFileUtils).to have_received(:cp).with(src, File.join(subject.target, no_prefix(src)), { preserve: true })
95
95
  end
96
96
  end
97
97
  end
@@ -58,6 +58,8 @@ describe Rake::Funnel::Tasks::Zip do
58
58
  context 'success' do
59
59
  let(:finder) { double(Finder).as_null_object }
60
60
  let(:zip) { double(::Zip::File).as_null_object }
61
+ let(:mtime) { Time.new(2015, 3, 9) }
62
+ let(:zip_entry) { double(::Zip::Entry).as_null_object }
61
63
 
62
64
  before {
63
65
  allow(finder).to receive(:all_or_default).and_return(source)
@@ -67,6 +69,11 @@ describe Rake::Funnel::Tasks::Zip do
67
69
  allow(::Zip::File).to receive(:open).with(target, ::Zip::File::CREATE).and_yield(zip)
68
70
  }
69
71
 
72
+ before {
73
+ allow(zip).to receive(:add).and_return(zip_entry)
74
+ allow(File).to receive(:mtime).and_return(mtime)
75
+ }
76
+
70
77
  before {
71
78
  Task[subject.name].invoke
72
79
  }
@@ -112,6 +119,10 @@ describe Rake::Funnel::Tasks::Zip do
112
119
  expect(zip).to have_received(:add).with(*file_args)
113
120
  end
114
121
  end
122
+
123
+ it 'should explicitly set the file mtime to work around https://github.com/rubyzip/rubyzip/issues/176' do
124
+ expect(zip_entry).to have_received(:time=).with(mtime).exactly(build_args.length).times
125
+ end
115
126
  end
116
127
  end
117
128
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake-funnel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4.pre
4
+ version: 0.0.5.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Groß