go4rake 1.5.7 → 1.5.9
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/lib/go4rake/new.rb +7 -5
- metadata +5 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 67375aa5b83f6c4ec2964f2f6b7796b195fe8982373a9eb3d5ae5a152e54529b
|
|
4
|
+
data.tar.gz: 2283278586d58964f093d02aef8118942d408075ec725d598d929c3ea22ef4e8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ade36e9a6a6188351510e1d600819eaf6401ea03ccd94d01f5fd4aaafbe7dad3d00cdc3d1d1de27d45cb33495df0202b33075f30d33c2a30eaffc6b3f972e055
|
|
7
|
+
data.tar.gz: 8af309645dfdf88d816adf6a3644a05e08a7714088f4d29ce3dd60c0e9436ebeebd04bd7dce9b510f20413dcfa0e1f1580a41a6a7175a3eabac40dc3aa052a64
|
data/lib/go4rake/new.rb
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require 'rake/tasklib'
|
|
4
4
|
require 'yaml'
|
|
5
|
+
require 'fileutils'
|
|
5
6
|
require 'zip/filesystem'
|
|
6
7
|
|
|
7
8
|
# Rake tasks to cross-compile Go project and ZIP the binaries:
|
|
@@ -15,9 +16,10 @@ require 'zip/filesystem'
|
|
|
15
16
|
#
|
|
16
17
|
# Offline copies of README and example config are also included in this gem.
|
|
17
18
|
#
|
|
18
|
-
class Go4Rake <
|
|
19
|
+
class Go4Rake < Rake::TaskLib
|
|
19
20
|
# Load configuration file and initialize Rake tasks for cross-compiling Go programs.
|
|
20
21
|
def initialize(yml = 'go4rake.yml')
|
|
22
|
+
super()
|
|
21
23
|
begin
|
|
22
24
|
@yaml_file = yml
|
|
23
25
|
@config = YAML.load_file(@yaml_file)
|
|
@@ -98,7 +100,7 @@ class Go4Rake < ::Rake::TaskLib
|
|
|
98
100
|
|
|
99
101
|
# Set GOARCH and GOOS.
|
|
100
102
|
def setenv(os, arch)
|
|
101
|
-
ENV['GOARCH'] = arch
|
|
103
|
+
ENV['GOARCH'] = arch&.to_s
|
|
102
104
|
ENV['GOOS'] = os
|
|
103
105
|
end
|
|
104
106
|
|
|
@@ -120,7 +122,7 @@ class Go4Rake < ::Rake::TaskLib
|
|
|
120
122
|
bin = `go list -f '{{.Target}}'`.chomp.delete_prefix("'").delete_suffix("'")
|
|
121
123
|
return unless bin
|
|
122
124
|
|
|
123
|
-
zip_file = File.expand_path(dir)
|
|
125
|
+
zip_file = "#{File.expand_path(dir)}/#{file}.zip"
|
|
124
126
|
name = File.basename(bin)
|
|
125
127
|
unless files
|
|
126
128
|
files = []
|
|
@@ -128,7 +130,7 @@ class Go4Rake < ::Rake::TaskLib
|
|
|
128
130
|
files.push('NOTICE') if File.exist?('NOTICE')
|
|
129
131
|
end
|
|
130
132
|
|
|
131
|
-
|
|
133
|
+
FileUtils.rm_f(zip_file)
|
|
132
134
|
Zip::File.open(zip_file, Zip::File::CREATE) do |zip|
|
|
133
135
|
[*files].each { |i|
|
|
134
136
|
t = File.basename(i)
|
|
@@ -144,7 +146,7 @@ class Go4Rake < ::Rake::TaskLib
|
|
|
144
146
|
|
|
145
147
|
# Remove the ZIP file (specify path and basename).
|
|
146
148
|
def clean(dir, file)
|
|
147
|
-
zip_file = File.expand_path(dir)
|
|
149
|
+
zip_file = "#{File.expand_path(dir)}/#{file}.zip"
|
|
148
150
|
return unless File.exist?(zip_file)
|
|
149
151
|
|
|
150
152
|
puts("Removing #{zip_file}")
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: go4rake
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.5.
|
|
4
|
+
version: 1.5.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vasily Korytov
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: rake
|
|
@@ -59,8 +58,8 @@ files:
|
|
|
59
58
|
homepage: https://github.com/chillum/go4rake
|
|
60
59
|
licenses:
|
|
61
60
|
- Apache-2.0
|
|
62
|
-
metadata:
|
|
63
|
-
|
|
61
|
+
metadata:
|
|
62
|
+
rubygems_mfa_required: 'true'
|
|
64
63
|
rdoc_options: []
|
|
65
64
|
require_paths:
|
|
66
65
|
- lib
|
|
@@ -75,8 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
75
74
|
- !ruby/object:Gem::Version
|
|
76
75
|
version: '0'
|
|
77
76
|
requirements: []
|
|
78
|
-
rubygems_version:
|
|
79
|
-
signing_key:
|
|
77
|
+
rubygems_version: 4.0.2
|
|
80
78
|
specification_version: 4
|
|
81
79
|
summary: Rake helper for cross-compiling Go programs
|
|
82
80
|
test_files: []
|