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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71c9b3950e936986c13b7b0bb6d501e6af89798a
4
- data.tar.gz: 662bd16b382d736d2e12a77260cff80a3780727d
3
+ metadata.gz: c24e57e95788bdd88359a7e8d02a380a4a75f3e4
4
+ data.tar.gz: a367cd14e6f5d835e006f4447fd981ab2b4d3bb7
5
5
  SHA512:
6
- metadata.gz: 00f5c881659dae454ca220610c9404e7ff0c7ea60e4d5c48bcdf8893c294c202e81c0305e2d150cec78b0a94f6db42c9d820aa7fab01edbcb687a08bf6f05e4c
7
- data.tar.gz: 959afa511846e3ef71b2cf9650694255b9b625309192d2e0f77b4ccebf37bb9a5cf7b78404b7648de23fcea8855594b576f32e911b683280acb85a4e918461ba
6
+ metadata.gz: 15a711d5f391dcc2a6f080526323e831fc15cc5687a353a73d55f9fce227fa2632efb999b334fd16b7c376c34fa62190b37ce544008c49458ce220dfe5d57720
7
+ data.tar.gz: 78ef19b99cdf2d2c84b96f119a86f05a2305979cff5f243ab8a2d9141b635c1ac67d425c6904d5ae2a9d7faf00b072460b8d82d561096dd600f95c0902d1f593
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## Version 1.4.5
4
+ * Allow setting target_path in zip finalizer
5
+
3
6
  ## Version 1.4.4
4
7
  * Let MockProject require Project so it always works
5
8
 
@@ -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
- def call(release, options = {})
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(options) if options
17
+ options.update(call_options) if call_options
16
18
 
17
19
  name = [options[:prefix], release.scm.version].join("-") + ".zip"
18
- zip_path = release.target_path + name
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
@@ -1,4 +1,4 @@
1
1
  # Roger main namespace
2
2
  module Roger
3
- VERSION = "1.4.4"
3
+ VERSION = "1.4.5"
4
4
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flurin Egger