Class: Scide::Commands::Tail

Inherits:
Run show all
Defined in:
lib/scide/commands/tail.rb

Overview

Tails a file.

Configuration Example

# this YAML configuration,
projects:
  project1:
    options:
      tail: '-n 1000'
    windows:
      - "window1 TAIL $HOME/fubar.txt"

# will produce the following command in window1:
tail -n 1000 -f $HOME/fubar.txt

Instance Attribute Summary

Attributes inherited from Scide::Command

#options

Instance Method Summary collapse

Methods inherited from Run

#text_with_options

Methods inherited from Show

#to_screen

Methods inherited from Scide::Command

resolve, #text_with_options, #to_screen

Constructor Details

#initialize(contents, options = {}) ⇒ Tail

Returns a new tail command.

See class definition for examples.

Arguments

  • contents - The file to tail.

  • options - Options that can be used in the contents of the command.

Options

  • tail => string - Arguments to tail.



31
32
33
34
# File 'lib/scide/commands/tail.rb', line 31

def initialize contents, options = {}
  super contents, options
  @text = [ 'tail', options[:tail].to_s, '-f', @text.to_s ].select(&:present?).join(' ')
end