Sha256: 967acfde5982435bf78ba14ee3cbdbf6809c120693088c1ddc165f01e642bcf6

Contents?: true

Size: 1.03 KB

Versions: 93

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

require 'avm/eac_rails_base1/runner_with/rails_environment'
require 'avm/eac_webapp_base0/runner'

module Avm
  module EacRailsBase1
    class Runner < ::Avm::EacWebappBase0::Runner
      class Log
        runner_with :help, ::Avm::EacRailsBase1::RunnerWith::RailsEnvironment do
          desc 'Read application\'s log.'
          bool_opt '-f', '--follow', 'Output appended data as the log grows.'
        end

        def run
          start_banner
          tail_command.system
        end

        private

        def log_path
          ::File.join(rails_instance.read_entry('fs_path'), 'log', "#{rails_environment}.log")
        end

        def start_banner
          infov 'Environment', rails_environment
          infov 'Log path', log_path
        end

        def tail_command
          rails_instance.host_env.command(*tail_command_args)
        end

        def tail_command_args
          r = %w[tail]
          r << '--follow' if parsed.follow?
          r + [log_path]
        end
      end
    end
  end
end

Version data entries

93 entries across 93 versions & 3 rubygems

Version Path
eac_tools-0.26.0 sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb
eac_tools-0.25.1 sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb
eac_tools-0.25.0 sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb
eac_tools-0.24.1 sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb
eac_tools-0.24.0 sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb
avm-eac_rails_base1-0.5.0 lib/avm/eac_rails_base1/runner/log.rb
eac_tools-0.23.0 sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb
eac_tools-0.22.0 sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb
eac_tools-0.21.0 sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb
eac_tools-0.20.0 sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb
eac_tools-0.19.0 sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb
eac_tools-0.18.0 sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb
eac_tools-0.17.0 sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb
eac_tools-0.16.1 sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb
eac_tools-0.16.0 sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb
eac_tools-0.15.0 sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb
eac_tools-0.14.0 sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb
avm-eac_rails_base1-0.4.2 lib/avm/eac_rails_base1/runner/log.rb
eac_tools-0.13.0 sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb
eac_tools-0.12.0 sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb