pkgforge 0.15.1 → 0.16.0
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/.circle-ruby +1 -1
- data/lib/pkgforge/components/package.rb +16 -21
- data/lib/pkgforge/components/upload.rb +27 -9
- data/lib/pkgforge/version.rb +1 -1
- data/pkgforge.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3474d4ccac1d2bfecd1de96fedf6cae21b5fb43f
|
4
|
+
data.tar.gz: 65a3c719b1f44a9bade4d7e44bffb79f48404904
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6eff41349e20da6169bcd29177391ec29c1ffb536a0fcf98b5c4625edc0f8da0187a9311c0fec4dedce0ba8c80e342f23c2595f3a64b3131a5654367e93fb6e9
|
7
|
+
data.tar.gz: 2be4289e4d53a8abe039a6ea3961611699076e1aba042492177f76a65d4e112f1e6bd5d1f0d254cd27d1da5e460f5fc64373cd7ac5d2fe34d78f08ff25b47d47
|
data/.circle-ruby
CHANGED
@@ -15,38 +15,33 @@ module PkgForge
|
|
15
15
|
def package!
|
16
16
|
add_license!
|
17
17
|
type_method = "#{package[:type]}_prepare_package"
|
18
|
-
|
19
|
-
raise("Unknown package type: #{package[:type]}")
|
18
|
+
method_found = respond_to?(type_method, true)
|
19
|
+
raise("Unknown package type: #{package[:type]}") unless method_found
|
20
|
+
send(type_method)
|
21
|
+
expose_artifacts!
|
20
22
|
end
|
21
23
|
|
22
24
|
private
|
23
25
|
|
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
|
-
|
33
26
|
Contract None => nil
|
34
27
|
def file_prepare_package
|
35
|
-
|
36
|
-
raise('File package type requires
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
28
|
+
artifacts = package[:artifacts] || [package[:artifact]].compact
|
29
|
+
raise('File package type requires artifacts list') if artifacts.empty?
|
30
|
+
artifacts.each do |x|
|
31
|
+
x[:source] = File.join(tmpdir(:release), x[:source])
|
32
|
+
add_artifact(x)
|
33
|
+
end
|
34
|
+
nil
|
42
35
|
end
|
43
36
|
|
44
37
|
Contract None => nil
|
45
38
|
def tarball_prepare_package
|
46
|
-
|
47
|
-
|
39
|
+
add_artifact(
|
40
|
+
source: tmpfile(:tarball),
|
41
|
+
name: "#{name}.tar.gz",
|
42
|
+
long_name: "#{name}-#{git_hash}.tar.gz"
|
43
|
+
)
|
48
44
|
make_tarball!
|
49
|
-
expose_artifact "#{name}-#{git_hash}.tar.gz", tmpfile(:tarball)
|
50
45
|
end
|
51
46
|
|
52
47
|
Contract None => nil
|
@@ -4,25 +4,43 @@ module PkgForge
|
|
4
4
|
class Forge
|
5
5
|
Contract None => nil
|
6
6
|
def push!
|
7
|
-
|
7
|
+
upload_artifacts!
|
8
8
|
end
|
9
9
|
|
10
10
|
private
|
11
11
|
|
12
|
+
Contract HashOf[Symbol => String] => nil
|
13
|
+
def add_artifact(params)
|
14
|
+
state[:artifacts] ||= []
|
15
|
+
state[:artifacts] << params
|
16
|
+
nil
|
17
|
+
end
|
18
|
+
|
19
|
+
Contract None => nil
|
20
|
+
def expose_artifacts!
|
21
|
+
FileUtils.mkdir_p 'pkg'
|
22
|
+
return unless state[:artifacts]
|
23
|
+
state[:artifacts].each do |artifact|
|
24
|
+
dest = File.join('pkg', artifact[:long_name] || artifact[:name])
|
25
|
+
FileUtils.cp artifact[:source], dest
|
26
|
+
FileUtils.chmod 0o0644, dest
|
27
|
+
end
|
28
|
+
nil
|
29
|
+
end
|
30
|
+
|
12
31
|
Contract None => String
|
13
32
|
def version
|
14
33
|
@version ||= `git describe --abbrev=0 --tags`.rstrip
|
15
34
|
end
|
16
35
|
|
17
36
|
Contract None => nil
|
18
|
-
def
|
19
|
-
|
20
|
-
|
21
|
-
'--authfile', '.github',
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
]
|
37
|
+
def upload_artifacts!
|
38
|
+
return unless state[:artifacts]
|
39
|
+
state[:artifacts].each do |artifact|
|
40
|
+
run_local ['targit', '--authfile', '.github', '--create',
|
41
|
+
'--name', artifact[:name],
|
42
|
+
"#{org}/#{name}", version, artifact[:source]]
|
43
|
+
end
|
26
44
|
nil
|
27
45
|
end
|
28
46
|
end
|
data/lib/pkgforge/version.rb
CHANGED
data/pkgforge.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.add_dependency 'contracts', '~> 0.14.0'
|
22
22
|
s.add_dependency 'cymbal', '~> 1.0.0'
|
23
23
|
|
24
|
-
s.add_development_dependency 'rubocop', '~> 0.
|
24
|
+
s.add_development_dependency 'rubocop', '~> 0.48.0'
|
25
25
|
s.add_development_dependency 'rake', '~> 12.0.0'
|
26
26
|
s.add_development_dependency 'codecov', '~> 0.1.1'
|
27
27
|
s.add_development_dependency 'rspec', '~> 3.5.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pkgforge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Les Aker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mercenary
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.48.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
68
|
+
version: 0.48.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|