Skip to content

Commit

Permalink
Merge pull request #26 from sportngin/bindir-from-gemspec
Browse files Browse the repository at this point in the history
Read executables from gemspec
  • Loading branch information
lundebrek committed May 18, 2016
2 parents 87a5c3d + aa9e3b9 commit 63bdc24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/brew/gem/formula.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ class <%= klass %> < Formula
].first
zsh_completion.install completion_for_zsh if completion_for_zsh

gemspec = Gem::Specification::load("#{prefix}/specifications/<%= name %>-#{version}.gemspec")
ruby_libs = Dir.glob("#{prefix}/gems/*/lib")
Pathname.glob("#{brew_gem_prefix}/bin/*").each do |file|
gemspec.executables.each do |exe|
file = Pathname.new("#{brew_gem_prefix}/#{gemspec.bindir}/#{exe}")
(bin+file.basename).open('w') do |f|
f << <<-RUBY
#!/usr/bin/ruby
Expand Down
2 changes: 1 addition & 1 deletion lib/brew/gem/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Brew
module Gem
VERSION = "0.7.2"
VERSION = "0.7.3"
end
end

0 comments on commit 63bdc24

Please sign in to comment.