Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add prefix of 'gem-' to the formula file name, added 'Gem' prefix to klass name in Formula #21

Merged
merged 1 commit into from
Jan 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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