diff --git a/Library/Contributions/examples/brew-dirty.rb b/Library/Contributions/examples/brew-dirty.rb new file mode 100755 index 0000000000..e22ad75c67 --- /dev/null +++ b/Library/Contributions/examples/brew-dirty.rb @@ -0,0 +1,7 @@ +# See: http://github.com/mxcl/homebrew/issues/issue/1359 + +to_list = HOMEBREW_CELLAR.children.select { |pn| pn.directory? } +to_list.each do |d| + versions = d.children.select { |pn| pn.directory? }.collect { |pn| pn.basename.to_s } + puts "#{d.basename} (#{versions.join(', ')})" if versions.size > 1 +end diff --git a/Library/Contributions/examples/brew-leaves.rb b/Library/Contributions/examples/brew-leaves.rb new file mode 100755 index 0000000000..ba5644c555 --- /dev/null +++ b/Library/Contributions/examples/brew-leaves.rb @@ -0,0 +1,9 @@ +# See: http://github.com/mxcl/homebrew/issues/issue/1438 + +require 'formula' +deps_graph = Formula.get_used_by +formulas = HOMEBREW_CELLAR.children.select { |pn| pn.directory? }.collect { |pn| pn.basename.to_s } +formulas.each do |name| + deps = deps_graph[name] || [] + puts name if !deps.any? { |dep| formulas.include?(dep) } +end diff --git a/Library/Contributions/examples/brew-options.rb b/Library/Contributions/examples/brew-options.rb new file mode 100755 index 0000000000..bf7a0180a2 --- /dev/null +++ b/Library/Contributions/examples/brew-options.rb @@ -0,0 +1,9 @@ +ARGV.formulae.each do |f| + f.options rescue next + puts f.name + f.options.each do |o| + puts o[0] + puts "\t"+o[1] + end + puts +end