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 +4 -4
- data/lib/rake/funnel/integration/teamcity/nunit_plugin.rb +1 -1
- data/lib/rake/funnel/tasks/copy.rb +1 -1
- data/lib/rake/funnel/tasks/zip.rb +8 -1
- data/lib/rake/funnel/version.rb +1 -1
- data/spec/rake/funnel/integration/teamcity/nunit_plugin_spec.rb +1 -1
- data/spec/rake/funnel/tasks/copy_spec.rb +1 -1
- data/spec/rake/funnel/tasks/zip_spec.rb +11 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 276f461ed75b3b78a82c23de466ed0f8057b6019
|
4
|
+
data.tar.gz: ff755cdb17ebc083b62c378823bc0f85211bef92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
@@ -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?
|
data/lib/rake/funnel/version.rb
CHANGED
@@ -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
|