roger 1.4.5 → 1.4.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff392fddffc0c128c0f1c2ed637a0fb34cfa056d
|
4
|
+
data.tar.gz: 8732e488d0ad390ebcf49aba40bf6a654446b6bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9c61357b6b2497f66e4f01ae627ed8ea20cc8cbe96f9a71db15ac15737019da9fecdd9e606723cdff76443b78f4328f1c3ac5dee3fafeca7ab4c3294b0b365d
|
7
|
+
data.tar.gz: 73320c598c51c6585c7cc82d5ab84f23446adea024371a67e42c7e26ca6f89fb8001d05b3ba97861c1450b8ed646ba7cf5c3b25ab78a29856f5dcc7554389eb6
|
data/CHANGELOG.md
CHANGED
@@ -7,12 +7,19 @@ module Roger::Release::Finalizers
|
|
7
7
|
#
|
8
8
|
class Dir < Base
|
9
9
|
# @option options :prefix Prefix to put before the version (default = "html")
|
10
|
-
def call(release,
|
11
|
-
options = {
|
12
|
-
|
10
|
+
def call(release, call_options = {})
|
11
|
+
options = {
|
12
|
+
prefix: "html",
|
13
|
+
target_path: release.target_path
|
14
|
+
}.update(@options)
|
15
|
+
options.update(call_options) if call_options
|
13
16
|
|
14
|
-
name = [
|
15
|
-
|
17
|
+
name = [options[:prefix], release.scm.version].join("-")
|
18
|
+
|
19
|
+
target_dir = Pathname.new(options[:target_path])
|
20
|
+
FileUtils.mkdir_p(target_dir) unless target_dir.exist?
|
21
|
+
|
22
|
+
target_path = target_dir + name
|
16
23
|
|
17
24
|
release.log(self, "Finalizing release to #{target_path}")
|
18
25
|
|
@@ -16,8 +16,10 @@ module Roger::Release::Finalizers
|
|
16
16
|
|
17
17
|
options.update(call_options) if call_options
|
18
18
|
|
19
|
+
target_path = ensure_target_path(options[:target_path])
|
20
|
+
|
19
21
|
name = [options[:prefix], release.scm.version].join("-") + ".zip"
|
20
|
-
zip_path =
|
22
|
+
zip_path = target_path + name
|
21
23
|
|
22
24
|
release.log(self, "Finalizing release to #{zip_path}")
|
23
25
|
|
@@ -32,6 +34,12 @@ module Roger::Release::Finalizers
|
|
32
34
|
|
33
35
|
protected
|
34
36
|
|
37
|
+
def ensure_target_path(path)
|
38
|
+
target_path = Pathname.new(path)
|
39
|
+
FileUtils.mkdir_p(target_path) unless target_path.exist?
|
40
|
+
target_path
|
41
|
+
end
|
42
|
+
|
35
43
|
def cleanup_existing_zip(release, path)
|
36
44
|
return unless File.exist?(path)
|
37
45
|
|
data/lib/roger/version.rb
CHANGED
@@ -39,5 +39,32 @@ module Roger
|
|
39
39
|
|
40
40
|
assert_not_same original_ctime, File.ctime(dir)
|
41
41
|
end
|
42
|
+
|
43
|
+
def test_target_path
|
44
|
+
finalizer = Roger::Release::Finalizers::Dir.new
|
45
|
+
dir = @release.project.construct.directory("rel")
|
46
|
+
|
47
|
+
finalizer.call(@release, target_path: dir)
|
48
|
+
|
49
|
+
assert File.exist?(dir + "html-1.0.0")
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_target_path_with_string
|
53
|
+
finalizer = Roger::Release::Finalizers::Dir.new
|
54
|
+
dir = @release.project.construct.directory("rel")
|
55
|
+
|
56
|
+
finalizer.call(@release, target_path: dir.to_s)
|
57
|
+
|
58
|
+
assert File.exist?(dir + "html-1.0.0")
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_target_path_will_be_created_if_nonexistent
|
62
|
+
finalizer = Roger::Release::Finalizers::Dir.new
|
63
|
+
dir = @release.target_path + "rel"
|
64
|
+
|
65
|
+
finalizer.call(@release, target_path: dir)
|
66
|
+
|
67
|
+
assert File.exist?(dir + "html-1.0.0")
|
68
|
+
end
|
42
69
|
end
|
43
70
|
end
|
@@ -57,5 +57,14 @@ module Roger
|
|
57
57
|
|
58
58
|
assert File.exist?(dir + "html-1.0.0.zip")
|
59
59
|
end
|
60
|
+
|
61
|
+
def test_target_path_will_be_created_if_nonexistent
|
62
|
+
finalizer = Roger::Release::Finalizers::Zip.new
|
63
|
+
dir = @release.build_path + "downloads"
|
64
|
+
|
65
|
+
finalizer.call(@release, target_path: dir)
|
66
|
+
|
67
|
+
assert File.exist?(dir + "html-1.0.0.zip")
|
68
|
+
end
|
60
69
|
end
|
61
70
|
end
|