Sha256: 6322729d2c876fe4a0b05cd0ed8441c4ed0c02d12aeb412e8c08a0ffab766aa3
Contents?: true
Size: 774 Bytes
Versions: 26
Compression:
Stored size: 774 Bytes
Contents
=begin rdoc Array extensions =end require "enumerator" class Array def to_os map {|a| a.to_os } end def collect_with_index &block self.enum_for(:each_with_index).collect &block end def runnable(quiet=true) self.join(" \n ").runnable(quiet) end def nice_runnable(quiet=true) self.flatten.reject{|e| (e.nil? || e.empty?) }.join(" \n ").chomp.nice_runnable(quiet) end def to_string(pre="") map {|a| a.to_string(pre)}.join("\n") end def get_named(str="") map {|a| a.name == str ? a : nil }.reject {|a| a.nil? } end def to_option_string(ns=[]) "[ #{map {|e| e.to_option_string }.reject {|a| a.nil? || a.empty? }.join(", ")} ]" end def respec_string(ns=[]) "'#{map {|e| e.to_option_string }.join("', '")}'" end end
Version data entries
26 entries across 26 versions & 2 rubygems