Class: Falcon::Command::Top
- Inherits:
-
Samovar::Command
- Object
- Samovar::Command
- Falcon::Command::Top
- Defined in:
- lib/falcon/command/top.rb
Instance Method Summary collapse
- #call ⇒ Object
- #encoding ⇒ Object
- #quiet? ⇒ Boolean
-
#update_external_encoding!(encoding = Encoding::UTF_8) ⇒ Object
If you don’t specify these, it’s possible to have issues when encodings mismatch on the server.
- #verbose? ⇒ Boolean
Instance Method Details
#call ⇒ Object
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/falcon/command/top.rb', line 77 def call if encoding = self.encoding update_external_encoding!(encoding) else update_external_encoding! end if [:version] puts "#{self.name} v#{Falcon::VERSION}" elsif [:help] self.print_usage else @command.call end end |
#encoding ⇒ Object
71 72 73 74 75 |
# File 'lib/falcon/command/top.rb', line 71 def encoding if name = [:encoding] Encoding.find(name) end end |
#quiet? ⇒ Boolean
59 60 61 |
# File 'lib/falcon/command/top.rb', line 59 def quiet? [:logging] == :quiet end |
#update_external_encoding!(encoding = Encoding::UTF_8) ⇒ Object
If you don’t specify these, it’s possible to have issues when encodings mismatch on the server.
64 65 66 67 68 69 |
# File 'lib/falcon/command/top.rb', line 64 def update_external_encoding!(encoding = Encoding::UTF_8) if Encoding.default_external != encoding Console.logger.warn(self) {"Updating Encoding.default_external from #{Encoding.default_external} to #{encoding}"} Encoding.default_external = encoding end end |
#verbose? ⇒ Boolean
55 56 57 |
# File 'lib/falcon/command/top.rb', line 55 def verbose? [:logging] == :verbose end |