Skip to content

Commit

Permalink
Merge pull request #21 from rcmdnk/prefix
Browse files Browse the repository at this point in the history
add prefix of 'gem-' to the formula file name, added 'Gem' prefix to klass name in Formula
  • Loading branch information
Andy Fleener committed Jan 5, 2016
2 parents 5a53e1a + 698f56b commit 1fef6c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ To uninstall:

brew gem uninstall heroku

To check information:

brew gem info heroku

Note:

Installed gems are listed in `brew list` with prefix of `gem-`,
like `gem-heroku`.

### BASH/ZSH Completions

Expand Down
4 changes: 2 additions & 2 deletions bin/brew-gem
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ unless gems.detect { |f| f =~ /^#{name} \(([^\s,]+).*\)/ }
end
version = ARGV[2] || $1

klass = name.capitalize.gsub(/[-_.\s]([a-zA-Z0-9])/) { $1.upcase }.gsub('+', 'x')
klass = 'Gem' + name.capitalize.gsub(/[-_.\s]([a-zA-Z0-9])/) { $1.upcase }.gsub('+', 'x')
user_gemrc = "#{ENV['HOME']}/.gemrc"

require 'erb'
template = ERB.new(File.read(__FILE__).split(/^__END__$/, 2)[1].strip)

require 'tempfile'
filename = File.join Dir.tmpdir, "#{name}.rb"
filename = File.join Dir.tmpdir, "gem-#{name}.rb"

begin
open(filename, 'w') do |f|
Expand Down

0 comments on commit 1fef6c3

Please sign in to comment.