Class: ProconBypassMan::PrintBootMessageCommand::BootMessage
- Inherits:
-
Object
- Object
- ProconBypassMan::PrintBootMessageCommand::BootMessage
- Defined in:
- lib/procon_bypass_man/commands/print_boot_message_command.rb
Instance Method Summary collapse
-
#initialize ⇒ BootMessage
constructor
A new instance of BootMessage.
- #to_hash ⇒ Hash
- #to_s ⇒ String
Constructor Details
#initialize ⇒ BootMessage
Returns a new instance of BootMessage.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/procon_bypass_man/commands/print_boot_message_command.rb', line 3 def initialize @table = {} @table[:ruby_version] = RUBY_VERSION @table[:pbm_version] = ProconBypassMan::VERSION @table[:pbmenv_version] = Pbmenv::VERSION @table[:pid] = $$ @table[:root_path] = ProconBypassMan.root @table[:pid_path] = ProconBypassMan.pid_path @table[:setting_path] = ProconBypassMan..setting_path @table[:uptime_from_boot] = ProconBypassMan::Uptime.from_boot @table[:use_pbmenv] = ProconBypassMan.root.start_with?(Pbmenv::PBM_DIR) @table[:session_id] = ProconBypassMan.session_id @table[:device_id] = ProconBypassMan.device_id @table[:never_exit_accidentally] = ProconBypassMan.config.never_exit_accidentally @table[:uname] = `uname -a`.chomp # 開発中のHEADを取りたかったけど、Gem::Specification経由から取得する必要がありそう # build_version = `git rev-parse --short HEAD`.chomp # if build_version.empty? # @table[:build_version] = 'release version' # else # @table[:build_version] = build_version # end # build version: #{@table[:build_version]} end |
Instance Method Details
#to_hash ⇒ Hash
52 53 54 |
# File 'lib/procon_bypass_man/commands/print_boot_message_command.rb', line 52 def to_hash @table end |
#to_s ⇒ String
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/procon_bypass_man/commands/print_boot_message_command.rb', line 31 def to_s = " ----\n ProconBypassMan::VERSION: \#{@table[:pbm_version]}\n RUBY_VERSION: \#{@table[:ruby_version]}\n Pbmenv::VERSION: \#{@table[:pbmenv_version]}\n PBM-Cloud Integration: \#{ProconBypassMan::WebConnectivityChecker.new(ProconBypassMan.config.api_server, ProconBypassMan.config.current_ws_server_url)}\n ExternalInput Integration: \#{ProconBypassMan::ExternalInput::BootMessage.new(channels: ProconBypassMan::ExternalInput.channels)}\n pid: \#{@table[:pid]}\n root: \#{@table[:root_path]}\n pid_path: \#{@table[:pid_path]}\n setting_path: \#{@table[:setting_path]}\n uptime from boot: \#{@table[:uptime_from_boot]} sec\n use_pbmenv: \#{@table[:use_pbmenv]}\n session_id: \#{ProconBypassMan.session_id}\n device_id: \#{ProconBypassMan.device_id.gsub(/.{25}$/, \"*\"*25)}\n ----\n EOF\nend\n" |