pkgforge 0.12.1 → 0.12.3

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: 6617d08519939b487ec5b43a6aefea8e37838afb
4
- data.tar.gz: 8a1638bf3c7baa881d70f1c1c4c2252cd7d054ab
3
+ metadata.gz: f40db06d4d05929bc5fa525b72b81c5ad582569e
4
+ data.tar.gz: 38fadcfe258962b73be99158ef5e7c89abe4998e
5
5
  SHA512:
6
- metadata.gz: 9cf6dc09a7adc2689f2dba2b753081736f3364b4fb50da29a146f59f422edb48380d5551cbdbc767e95aca856c7d1801c419702f5a124957ac5cad01afe37f38
7
- data.tar.gz: 631b0d622c4e038bcd55b948d2d138382248839b06a8261e28b9669a6bca047b82568cc65996f6000b7e59f706bb388385f179ab193b966e0c623e477f5dcac0
6
+ metadata.gz: 15fa4ea795861b42c5b7cfe66a549015e560c1e9a6438f4fa24515fa04c80dc7aaf4bc09db16dd75cd4269745d91179e1940445d2d159118ee3c655b466d2222
7
+ data.tar.gz: b21def107cb435e2e41ebc6522d8011fd255bf187be4faf62894fff728fd284f0693a77d98b5631b2bd96f6cfece52ea2b32cf2e7d5acf5aa9c04dfe54ad8dc6
@@ -21,13 +21,21 @@ module PkgForge
21
21
 
22
22
  private
23
23
 
24
+ Contract String, String => nil
25
+ def expose_artifact(artifact_name, artifact_source)
26
+ FileUtils.mkdir_p 'pkg'
27
+ dest = File.join('pkg', artifact_name)
28
+ FileUtils.cp artifact_source, dest
29
+ FileUtils.chmod 0o0644, dest
30
+ nil
31
+ end
32
+
24
33
  Contract None => nil
25
34
  def file_prepare_package
26
35
  raise('File package type requires "path" setting') unless package[:path]
27
36
  @upload_path = File.join(tmpdir(:release), package[:path])
28
37
  @upload_name = package[:name] || name
29
- FileUtils.cp package[:path], File.join('pkg', @upload_name)
30
- nil
38
+ expose_artifact @upload_name, @upload_path
31
39
  end
32
40
 
33
41
  Contract None => nil
@@ -35,7 +43,7 @@ module PkgForge
35
43
  @upload_path = tmpfile(:tarball)
36
44
  @upload_name = "#{name}.tar.gz"
37
45
  make_tarball!
38
- copy_tarball!
46
+ expose_artifact "#{name}-#{git_hash}.tar.gz", tmpfile(:tarball)
39
47
  end
40
48
 
41
49
  Contract None => nil
@@ -50,15 +58,6 @@ module PkgForge
50
58
  def git_hash
51
59
  `git rev-parse --short HEAD`.rstrip
52
60
  end
53
-
54
- Contract None => nil
55
- def copy_tarball!
56
- FileUtils.mkdir_p 'pkg'
57
- pkg_file = "pkg/#{name}-#{git_hash}.tar.gz"
58
- FileUtils.cp tmpfile(:tarball), pkg_file
59
- FileUtils.chmod 0o0644, pkg_file
60
- nil
61
- end
62
61
  end
63
62
 
64
63
  module DSL
@@ -1,5 +1,5 @@
1
1
  ##
2
2
  # Declare version number
3
3
  module PkgForge
4
- VERSION = '0.12.1'.freeze
4
+ VERSION = '0.12.3'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pkgforge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.1
4
+ version: 0.12.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Les Aker