Skip to content

Commit

Permalink
Merge pull request #46 from origin/brew-gem-formula
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksieger committed Aug 3, 2017
2 parents 0c4a6a5 + d78ea6c commit 97e4a35
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/brew/gem/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module Brew::Gem::CLI
"upgrade" => "Upgrade to the latest version of a brew gem",
"uninstall" => "Uninstall a brew gem",
"info" => "Show information for an installed gem",
"formula" => "Print out the generated formula for a gem",
"help" => "This message"
}

Expand Down Expand Up @@ -75,8 +76,13 @@ def run(args = ARGV)
version = fetch_version(name, supplied_version)

with_temp_formula(name, version, use_homebrew_ruby) do |filename|
system "brew #{command} #{filename}"
exit $?.exitstatus unless $?.success?
case command
when "formula"
$stdout.puts File.read(filename)
else
system "brew #{command} #{filename}"
exit $?.exitstatus unless $?.success?
end
end
end
end

0 comments on commit 97e4a35

Please sign in to comment.