Module: Ruri::Util

Defined in:
lib/ruri/util.rb

Constant Summary collapse

PAGER =
'less -R -f -X'

Class Method Summary collapse

Class Method Details

.less(str = nil) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/ruri/util.rb', line 5

def less(str = nil)
  Tempfile.open('jugyo_is_very_cool') do |file|
    yield file if block_given?
    file << str if str
    file.flush
    system "#{PAGER} #{file.path}"
  end
end