aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib/hbc/cli/base.rb
diff options
context:
space:
mode:
authorMarkus Reiter2016-09-24 13:52:43 +0200
committerMarkus Reiter2016-09-24 16:00:58 +0200
commitb86c8efb79b3ed835d552c4d7416640ef10caf21 (patch)
tree7e1edc8a8f339e4d2781f43576d40c9c79aebcdc /Library/Homebrew/cask/lib/hbc/cli/base.rb
parent687f0fcf721c8e36f32570ed72d0988a6eaf986f (diff)
downloadbrew-b86c8efb79b3ed835d552c4d7416640ef10caf21.tar.bz2
Cask: Use nested classes and modules.
Diffstat (limited to 'Library/Homebrew/cask/lib/hbc/cli/base.rb')
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/base.rb34
1 files changed, 19 insertions, 15 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/base.rb b/Library/Homebrew/cask/lib/hbc/cli/base.rb
index af03969af..6c706d537 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/base.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/base.rb
@@ -1,21 +1,25 @@
-class Hbc::CLI::Base
- def self.command_name
- @command_name ||= name.sub(%r{^.*:}, "").gsub(%r{(.)([A-Z])}, '\1_\2').downcase
- end
+module Hbc
+ class CLI
+ class Base
+ def self.command_name
+ @command_name ||= name.sub(%r{^.*:}, "").gsub(%r{(.)([A-Z])}, '\1_\2').downcase
+ end
- def self.visible
- true
- end
+ def self.visible
+ true
+ end
- def self.cask_tokens_from(args)
- args.reject { |a| a.empty? || a.chars.first == "-" }
- end
+ def self.cask_tokens_from(args)
+ args.reject { |a| a.empty? || a.chars.first == "-" }
+ end
- def self.help
- "No help available for the #{command_name} command"
- end
+ def self.help
+ "No help available for the #{command_name} command"
+ end
- def self.needs_init?
- false
+ def self.needs_init?
+ false
+ end
+ end
end
end