Sha256: be9e6cb0d97168ada5cec80dcc6def6c178d192e81c4a44aab410cd0b547ceb2

Contents?: true

Size: 521 Bytes

Versions: 1

Compression:

Stored size: 521 Bytes

Contents

class String
  def first_caps
    self.split(/ /).map{|x| x.capitalize}.join(' ')
  end
  def sp_to_underscore #fills in the gap in rails inflectors, since their #underscore method only works for CamelCase
    self.downcase.gsub(/\s+/,"_")
  end
end
class Hash
  def to_s_pretty
    self.collect {|k,v| "#{k}: #{v}"}.join(', ')
  end
end
class Dir
  def filter(regex)
    self.select do |x|
      x =~ regex
    end
  end
end

class Object
end

class Numeric
  def secs_to_days
    self / (60.0 * 60 * 24)
  end
end
    

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pixelearth-3.2.4 config/initializers/ruby_core_mods.rb