Files

File::Insert

Public Class Methods

content(options = {}) click to toggle source
# File lib/sugar-high/file.rb, line 153
def self.content options = {}, *args, &block
  case args.first
  when String
    args.first
  when Hash
    options[:content] || (yield if block)      
  else
    return yield if block
    raise ArgumentError, "You must supply content to insert, either as a String before the options hash, a :content option or a block" 
  end     
end
get_marker(marker) click to toggle source
# File lib/sugar-high/file.rb, line 144
def self.get_marker marker
  marker = case marker
  when String
    Regexp.escape(marker)
  when Regexp
    marker.source  
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.