diff options
| author | Markus Reiter | 2016-09-24 13:52:43 +0200 |
|---|---|---|
| committer | Markus Reiter | 2016-09-24 16:00:58 +0200 |
| commit | b86c8efb79b3ed835d552c4d7416640ef10caf21 (patch) | |
| tree | 7e1edc8a8f339e4d2781f43576d40c9c79aebcdc /Library/Homebrew/cask/lib/hbc/cli/internal_help.rb | |
| parent | 687f0fcf721c8e36f32570ed72d0988a6eaf986f (diff) | |
| download | brew-b86c8efb79b3ed835d552c4d7416640ef10caf21.tar.bz2 | |
Cask: Use nested classes and modules.
Diffstat (limited to 'Library/Homebrew/cask/lib/hbc/cli/internal_help.rb')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cli/internal_help.rb | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/internal_help.rb b/Library/Homebrew/cask/lib/hbc/cli/internal_help.rb index 81d7ee673..6c646cfd7 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/internal_help.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/internal_help.rb @@ -1,19 +1,23 @@ -class Hbc::CLI::InternalHelp < Hbc::CLI::InternalUseBase - def self.run(*_ignored) - max_command_len = Hbc::CLI.commands.map(&:length).max - puts "Unstable Internal-use Commands:\n\n" - Hbc::CLI.command_classes.each do |klass| - next if klass.visible - puts " #{klass.command_name.ljust(max_command_len)} #{help_for(klass)}" - end - puts "\n" - end +module Hbc + class CLI + class InternalHelp < InternalUseBase + def self.run(*_ignored) + max_command_len = CLI.commands.map(&:length).max + puts "Unstable Internal-use Commands:\n\n" + CLI.command_classes.each do |klass| + next if klass.visible + puts " #{klass.command_name.ljust(max_command_len)} #{help_for(klass)}" + end + puts "\n" + end - def self.help_for(klass) - klass.respond_to?(:help) ? klass.help : nil - end + def self.help_for(klass) + klass.respond_to?(:help) ? klass.help : nil + end - def self.help - "Print help strings for unstable internal-use commands" + def self.help + "Print help strings for unstable internal-use commands" + end + end end end |
