brew-go 1.1.2 → 1.1.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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -0
  3. data/bin/brew-go +29 -27
  4. data/brew-go.gemspec +1 -1
  5. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c3d43872d66a6364fae9aecdffb30d9a0654afa
4
- data.tar.gz: e70bd97ae350dfa9f376bc57b833450c45979fe0
3
+ metadata.gz: 01ef3b4e07ae693e7e320c9564863d6f35cc31b4
4
+ data.tar.gz: f100e8ef58107f662634d02ebfee6d271536e4f8
5
5
  SHA512:
6
- metadata.gz: b8146423aa22d3ed62381572731bb0da47218dee2bc0029633488bbd6485739b4caee5f0f59409cfadaa5f7e8a1fbf7678acf5f191cd242dd2f8fc39a426ad46
7
- data.tar.gz: d0f9427066c1a2ad76caa2fef96b8ead36c3effb1894288ccdff44dadedcc94d4c70b2342634aefe53e4c220a260310939dd01e5e73e3e36a9d7390d1e64fbca
6
+ metadata.gz: 2a4c96285fe7650bcdd3f53837242d16b86daeee20c0128e6ca36eebc59ab8f203a6f13c670ed67003a5aec08b05700d3df8dceafea61863c9bffbb60d270967
7
+ data.tar.gz: 77de0205b568b1859e79d4de52049a3404d6dd3e7020cd9fd157da2afd78cb5319ae1ed05a60d8d8ba4bfcf901a1a5704b5f17a815ee3401487caeed02e8edf0
data/README.md CHANGED
@@ -15,6 +15,16 @@ The gem was inspired by [this blog post](https://blog.filippo.io/cleaning-up-my-
15
15
 
16
16
  $ gem install brew-go
17
17
 
18
+ If you're not a Ruby user, chances are that you use the system's `/usr/bin/gem`,
19
+ which tries installing to a directory that isn't writable by the user. Assuming
20
+ you have a local bin directory in $PATH, e.g. `~/bin`, use this instead:
21
+
22
+ $ gem install --user-install -n ~/bin brew-go
23
+
24
+ Alternatively, just download [the
25
+ script](https://raw.githubusercontent.com/mhinz/brew-go/master/bin/brew-go) in
26
+ any directory from $PATH and make it executable.
27
+
18
28
  ## Usage
19
29
 
20
30
  See `brew go` for all available commands.
@@ -8,22 +8,22 @@ unless defined? HOMEBREW_CELLAR
8
8
  end
9
9
 
10
10
  @commons = {
11
- "benchstat" => "golang.org/x/perf/cmd/benchstat",
12
- "dlv" => "github.com/derekparker/delve/cmd/dlv",
13
- "errcheck" => "github.com/kisielk/errcheck",
14
- "fillstruct" => "github.com/davidrjenni/reftools/cmd/fillstruct",
15
- "gocode" => "github.com/nsf/gocode",
16
- "godef" => "github.com/rogpeppe/godef",
17
- "goimports" => "golang.org/x/tools/cmd/goimports",
18
- "golint" => "github.com/golang/lint/golint",
19
- "gometalinter" => "github.com/alecthomas/gometalinter",
20
- "gorename" => "golang.org/x/tools/cmd/gorename",
21
- "gotags" => "github.com/jstemmer/gotags",
22
- "guru" => "golang.org/x/tools/cmd/guru",
23
- "impl" => "github.com/josharian/impl",
24
- "interfacer" => "mvdan.cc/interfacer",
25
- "staticcheck" => "honnef.co/go/tools/cmd/staticcheck",
26
- "unused" => "honnef.co/go/tools/cmd/unused",
11
+ 'benchstat' => 'golang.org/x/perf/cmd/benchstat',
12
+ 'dlv' => 'github.com/derekparker/delve/cmd/dlv',
13
+ 'errcheck' => 'github.com/kisielk/errcheck',
14
+ 'fillstruct' => 'github.com/davidrjenni/reftools/cmd/fillstruct',
15
+ 'gocode' => 'github.com/nsf/gocode',
16
+ 'godef' => 'github.com/rogpeppe/godef',
17
+ 'goimports' => 'golang.org/x/tools/cmd/goimports',
18
+ 'golint' => 'github.com/golang/lint/golint',
19
+ 'gometalinter' => 'github.com/alecthomas/gometalinter',
20
+ 'gorename' => 'golang.org/x/tools/cmd/gorename',
21
+ 'gotags' => 'github.com/jstemmer/gotags',
22
+ 'guru' => 'golang.org/x/tools/cmd/guru',
23
+ 'impl' => 'github.com/josharian/impl',
24
+ 'interfacer' => 'mvdan.cc/interfacer',
25
+ 'staticcheck' => 'honnef.co/go/tools/cmd/staticcheck',
26
+ 'unused' => 'honnef.co/go/tools/cmd/unused'
27
27
  }
28
28
 
29
29
  def helpme
@@ -66,15 +66,15 @@ def cmd_get(packages)
66
66
  threads << Thread.new do
67
67
  name = File.basename url
68
68
  cellarpath = "#{HOMEBREW_CELLAR}/brew-go-#{name}"
69
- gopath = "#{cellarpath}/#{url.gsub('/', '#')}"
69
+ gopath = "#{cellarpath}/#{url.tr '/', '#'}"
70
70
 
71
- ENV["GOPATH"] = gopath
72
- ENV.delete "GOBIN"
71
+ ENV['GOPATH'] = gopath
72
+ ENV.delete 'GOBIN'
73
73
 
74
74
  system "go get #{url}"
75
75
  unless $?.success?
76
76
  puts "[\x1b[31;1m✗\x1b[0m] #{url}"
77
- FileUtils.remove_dir "#{cellarpath}", true
77
+ FileUtils.remove_dir cellarpath, true
78
78
  Thread.exit
79
79
  end
80
80
 
@@ -87,14 +87,14 @@ def cmd_get(packages)
87
87
  system "brew link brew-go-#{name}", out: File::NULL
88
88
  end
89
89
  end
90
- threads.each { |thr| thr.join }
90
+ threads.each(&:join)
91
91
  end
92
92
 
93
93
  def cmd_list(name)
94
94
  if name.nil?
95
95
  installed = {}
96
96
  Dir["#{HOMEBREW_CELLAR}/brew-go-*/*"].each do |path|
97
- name = File.basename(Pathname(path).parent.to_s).sub("brew-go-", "")
97
+ name = File.basename(Pathname(path).parent.to_s).sub('brew-go-', '')
98
98
  url = get_url_from_cellar_path(path)
99
99
  installed[name] = url
100
100
  end
@@ -102,10 +102,10 @@ def cmd_list(name)
102
102
  return
103
103
  end
104
104
 
105
- name = "brew-go-#{name}" unless name.start_with?("brew-go")
105
+ name = "brew-go-#{name}" unless name.start_with?('brew-go')
106
106
  path = "#{HOMEBREW_CELLAR}/#{name}"
107
107
  if Dir.exist? path
108
- puts Dir["#{path}/**/*"].select { |f| File.file? f }
108
+ puts(Dir["#{path}/**/*"].select { |f| File.file? f })
109
109
  else
110
110
  puts "No such keg: #{path}"
111
111
  exit 1
@@ -114,13 +114,15 @@ end
114
114
 
115
115
  def cmd_rm(names)
116
116
  names.each do |name|
117
- name = "brew-go-#{name}" unless name.start_with?("brew-go-")
117
+ name = "brew-go-#{name}" unless name.start_with?('brew-go-')
118
118
  system "brew uninstall #{name}"
119
119
  end
120
120
  end
121
121
 
122
122
  def cmd_update(names)
123
- names = names.map { |name| name.start_with?("brew-go-") ? name : "brew-go-#{name}" }
123
+ names = names.map do |name|
124
+ name.start_with?('brew-go-') ? name : "brew-go-#{name}"
125
+ end
124
126
  urls = if names.empty?
125
127
  Dir["#{HOMEBREW_CELLAR}/brew-go-*/*"].map do |path|
126
128
  get_url_from_cellar_path path
@@ -134,7 +136,7 @@ def cmd_update(names)
134
136
  end
135
137
 
136
138
  def get_url_from_cellar_path(path)
137
- File.basename(path).gsub '#', '/'
139
+ File.basename(path).tr '#', '/'
138
140
  end
139
141
 
140
142
  def resolve_common_packages(packages)
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "brew-go"
7
- spec.version = "1.1.2"
7
+ spec.version = "1.1.3"
8
8
  spec.authors = ["Marco Hinz"]
9
9
  spec.email = ["mh.codebro+github@gmail.com"]
10
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brew-go
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Hinz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-11 00:00:00.000000000 Z
11
+ date: 2017-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  version: '0'
75
75
  requirements: []
76
76
  rubyforge_project:
77
- rubygems_version: 2.6.13
77
+ rubygems_version: 2.6.14
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: Manage Go tools via Homebrew.