Calculates the set of unambiguous abbreviations for the strings in
self
. If passed a pattern or a string, only the strings
matching the pattern or starting with the string are considered.
%w{ car cone }.abbrev #=> { "ca" => "car", "car" => "car", "co" => "cone", "con" => cone", "cone" => "cone" }
# File rake/lib/abbrev.rb, line 89 def abbrev(pattern = nil) Abbrev::abbrev(self, pattern) end
# File rake/lib/pp.rb, line 336 def pretty_print(q) q.group(1, '[', ']') { q.seplist(self) {|v| q.pp v } } end
# File rake/lib/pp.rb, line 344 def pretty_print_cycle(q) q.text(empty? ? '[]' : '[...]') end
Builds a command line string from an argument list array
joining all elements escaped for Bourne shell and separated by a space. See
Shellwords.shelljoin for
details.
# File rake/lib/shellwords.rb, line 148 def shelljoin Shellwords.join(self) end
Equivalent to CSV::generate_line(self, options)
.
# File rake/lib/csv.rb, line 2345 def to_csv(options = Hash.new) CSV.generate_line(self, options) end