touch

touch(list, options = {}) Class Public methods Options: noop verbose Updates modification time (mtime) and access time (atime) of file(s) in list. Files are created if they don't exist. FileUtils.touch 'timestamp' FileUtils.touch Dir.glob('*.c'); system 'make'

uptodate?

uptodate?(new, old_list) Class Public methods Options: (none) Returns true if newer is newer than all old_list. Non-existent files are older than any file. FileUtils.uptodate?('hello.o', %w(hello.c hello.h)) or \ system 'make hello.o'

ruby

ruby(*args,&block) Instance Public methods Run a Ruby interpreter with the given arguments. Example: ruby %{-pe '$_.upcase!' <README}

safe_ln

safe_ln(*args) Instance Public methods Attempt to do a normal file link, but fall back to a copy if the link fails.

sh

sh(*cmd, &block) Instance Public methods Run the system command cmd. If multiple arguments are given the command is not run with the shell (same semantics as Kernel::exec and Kernel::system). Example: sh %{ls -ltr} sh 'ls', 'file with spaces' # check exit status after command runs sh %{grep pattern file} do |ok, res| if ! ok puts "pattern not found (status = #{res.exitstatus})" end end

split_all

split_all(path) Instance Public methods Split a file path into individual directory names. Example: split_all("a/b/c") => ['a', 'b', 'c']

new

new(filename) Class Public methods Create a new fileviewer, and view the file.

init_curses

init_curses() Instance Public methods Perform the curses setup

interact

interact() Instance Public methods Allow the user to interact with the display. This uses EMACS-like keybindings, and also vi-like keybindings as well, except that left and right move to the beginning and end of the file, respectively.

load_file

load_file(filename) Instance Public methods Load the file into memory, and put the first part on the curses display.