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

fixed 'name' in formula (use name of ARGV in brew-gem, instead of filename of formula) #22

Merged
merged 1 commit into from
Jan 6, 2016
Merged
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
16 changes: 8 additions & 8 deletions bin/brew-gem
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ require 'fileutils'

class RubyGemsDownloadStrategy < AbstractDownloadStrategy
def fetch
ohai "Fetching #{name} from gem source"
ohai "Fetching <%= name %> from gem source"
HOMEBREW_CACHE.cd do
system "gem", "fetch", name, "--version", resource.version
system "gem", "fetch", "<%= name %>", "--version", resource.version
end
end

def cached_location
Pathname.new("#{HOMEBREW_CACHE}/#{name}-#{resource.version}.gem")
Pathname.new("#{HOMEBREW_CACHE}/<%= name %>-#{resource.version}.gem")
end

def clear_cache
Expand Down Expand Up @@ -82,17 +82,17 @@ class <%= klass %> < Formula
bin.rmtree if bin.exist?
bin.mkpath

brew_gem_prefix = prefix+"gems/#{name}-#{version}"
brew_gem_prefix = prefix+"gems/<%= name %>-#{version}"

completion_for_bash = Dir[
"#{brew_gem_prefix}/completion{s,}/#{name}.{bash,sh}",
"#{brew_gem_prefix}/**/#{name}_completion{s,}.{bash,sh}"
"#{brew_gem_prefix}/completion{s,}/<%= name %>.{bash,sh}",
"#{brew_gem_prefix}/**/<%= name %>_completion{s,}.{bash,sh}"
].first
bash_completion.install completion_for_bash if completion_for_bash

completion_for_zsh = Dir[
"#{brew_gem_prefix}/completions/#{name}.zsh",
"#{brew_gem_prefix}/**/#{name}_completion{s,}.zsh"
"#{brew_gem_prefix}/completions/<%= name %>.zsh",
"#{brew_gem_prefix}/**/<%= name %>_completion{s,}.zsh"
].first
zsh_completion.install completion_for_zsh if completion_for_zsh

Expand Down