roger 1.4.4 → 1.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/roger/release/finalizers/zip.rb +8 -6
- data/lib/roger/version.rb +1 -1
- data/test/unit/release/finalizers/zip_test.rb +18 -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: c24e57e95788bdd88359a7e8d02a380a4a75f3e4
|
4
|
+
data.tar.gz: a367cd14e6f5d835e006f4447fd981ab2b4d3bb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15a711d5f391dcc2a6f080526323e831fc15cc5687a353a73d55f9fce227fa2632efb999b334fd16b7c376c34fa62190b37ce544008c49458ce220dfe5d57720
|
7
|
+
data.tar.gz: 78ef19b99cdf2d2c84b96f119a86f05a2305979cff5f243ab8a2d9141b635c1ac67d425c6904d5ae2a9d7faf00b072460b8d82d561096dd600f95c0902d1f593
|
data/CHANGELOG.md
CHANGED
@@ -4,18 +4,20 @@ module Roger::Release::Finalizers
|
|
4
4
|
class Zip < Base
|
5
5
|
attr_reader :release
|
6
6
|
|
7
|
-
# @option options :prefix Prefix to put before the version (default = "html")
|
8
|
-
# @option options :zip The zip command
|
9
|
-
|
7
|
+
# @option options [String] :prefix Prefix to put before the version (default = "html")
|
8
|
+
# @option options [String] :zip The zip command
|
9
|
+
# @option options [String, Pathname] :target_path (release.target_path) The path to zip to
|
10
|
+
def call(release, call_options = {})
|
10
11
|
options = {
|
11
12
|
zip: "zip",
|
12
|
-
prefix: "html"
|
13
|
+
prefix: "html",
|
14
|
+
target_path: release.target_path
|
13
15
|
}.update(@options)
|
14
16
|
|
15
|
-
options.update(
|
17
|
+
options.update(call_options) if call_options
|
16
18
|
|
17
19
|
name = [options[:prefix], release.scm.version].join("-") + ".zip"
|
18
|
-
zip_path =
|
20
|
+
zip_path = Pathname.new(options[:target_path]) + name
|
19
21
|
|
20
22
|
release.log(self, "Finalizing release to #{zip_path}")
|
21
23
|
|
data/lib/roger/version.rb
CHANGED
@@ -39,5 +39,23 @@ module Roger
|
|
39
39
|
|
40
40
|
assert_not_same original_ctime, File.ctime(zip)
|
41
41
|
end
|
42
|
+
|
43
|
+
def test_target_path
|
44
|
+
finalizer = Roger::Release::Finalizers::Zip.new
|
45
|
+
dir = @release.project.construct.directory("downloads")
|
46
|
+
|
47
|
+
finalizer.call(@release, target_path: dir)
|
48
|
+
|
49
|
+
assert File.exist?(dir + "html-1.0.0.zip")
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_target_path_with_string
|
53
|
+
finalizer = Roger::Release::Finalizers::Zip.new
|
54
|
+
dir = @release.project.construct.directory("downloads")
|
55
|
+
|
56
|
+
finalizer.call(@release, target_path: dir.to_s)
|
57
|
+
|
58
|
+
assert File.exist?(dir + "html-1.0.0.zip")
|
59
|
+
end
|
42
60
|
end
|
43
61
|
end
|