Method: TTY::Pager::SystemPager#initialize

Defined in:
lib/tty/pager/system.rb

#initialize(command: nil, **options) ⇒ SystemPager

Create a system pager

Parameters:

  • :command (String)

    the command to use for paging



120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/tty/pager/system.rb', line 120

def initialize(command: nil, **options)
  super(**options)
  @pager_io = nil
  @pager_command = nil
  pager_command(*Array(command))

  if pager_command.nil?
    raise TTY::Pager::Error,
          "#{self.class.name} cannot be used on your system due to " \
          "lack of appropriate pager executable. Install `less` like " \
          "pager or try using `BasicPager` instead."
  end
end