Module: RbFind::Csv

Included in:
Entry
Defined in:
lib/rbfind/csv.rb

Constant Summary collapse

COLON =

Windows has “:” in filenames (“C:...”)

File::ALT_SEPARATOR ? "|" : ":"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.outfile(out) ⇒ Object



44
45
46
47
48
49
# File 'lib/rbfind/csv.rb', line 44

def outfile out
  o, @outfile = @outfile, out
  yield
ensure
  @outfile = o
end

.putl(l) ⇒ Object



41
42
43
# File 'lib/rbfind/csv.rb', line 41

def putl l
  @outfile << l << $/
end

Instance Method Details

#colsep(*args) ⇒ Object Also known as: col_sep

:nodoc:



13
14
15
# File 'lib/rbfind/csv.rb', line 13

def colsep *args
  csv COLON, *args
end

#csv(sep, *args) ⇒ Object



31
32
33
34
35
# File 'lib/rbfind/csv.rb', line 31

def csv sep, *args
  e = args.join sep
  Csv.putl e
  nil
end

#spcsep(*args) ⇒ Object Also known as: spc_sep, spacesep, p



23
24
25
# File 'lib/rbfind/csv.rb', line 23

def spcsep *args
  csv " ", *args
end

#tabsep(*args) ⇒ Object Also known as: tab_sep



18
19
20
# File 'lib/rbfind/csv.rb', line 18

def tabsep *args
  csv "\t", *args
end