From b7e98b129cc19d0d4ce283a358785665ac100212 Mon Sep 17 00:00:00 2001 From: Baptiste Fontaine Date: Sun, 27 Dec 2015 19:12:27 +0100 Subject: [PATCH] cmd/options.rb: move common code in options.rb Closes Homebrew/homebrew#47423. Signed-off-by: Baptiste Fontaine --- Library/Homebrew/cmd/info.rb | 2 +- Library/Homebrew/cmd/options.rb | 9 +-------- Library/Homebrew/options.rb | 10 ++++++++++ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index fcc0c67107..fb31c0a946 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -1,6 +1,6 @@ require "blacklist" require "caveats" -require "cmd/options" +require "options" require "formula" require "keg" require "tab" diff --git a/Library/Homebrew/cmd/options.rb b/Library/Homebrew/cmd/options.rb index 9db4f2f9ca..f9d3ad7937 100644 --- a/Library/Homebrew/cmd/options.rb +++ b/Library/Homebrew/cmd/options.rb @@ -1,4 +1,5 @@ require "formula" +require "options" module Homebrew def options @@ -24,12 +25,4 @@ module Homebrew end end end - - def dump_options_for_formula(f) - f.options.sort_by(&:flag).each do |opt| - puts "#{opt.flag}\n\t#{opt.description}" - end - puts "--devel\n\tInstall development version #{f.devel.version}" if f.devel - puts "--HEAD\n\tInstall HEAD version" if f.head - end end diff --git a/Library/Homebrew/options.rb b/Library/Homebrew/options.rb index ba10dca8b3..1d92fbf47b 100644 --- a/Library/Homebrew/options.rb +++ b/Library/Homebrew/options.rb @@ -112,3 +112,13 @@ class Options "#<#{self.class.name}: #{to_a.inspect}>" end end + +module Homebrew + def dump_options_for_formula(f) + f.options.sort_by(&:flag).each do |opt| + puts "#{opt.flag}\n\t#{opt.description}" + end + puts "--devel\n\tInstall development version #{f.devel.version}" if f.devel + puts "--HEAD\n\tInstall HEAD version" if f.head + end +end