Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: b74199ea66
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (23 sloc) 0.722 kB
module Enumerable
def dups
inject({}) {|h,v| h[v] = h[v].to_i + 1; h }.reject {|k,v| v == 1 }.keys
end
def non_dups
inject({}) {|h,v| h[v] = h[v].to_i + 1; h }.select {|k,v| v == 1 }.keys
end
end
class File
def self.file_to_string(path)
File.new(path).read
end
def self.string_to_file(string, path)
directory = File.dirname(path)
FileUtils.mkdir_p directory unless File.directory?(directory)
File.open(path, "w") { |file| file << string }
end
end
%w(January February March April May June July August September October November December).each_with_index do |month, index|
Object.send :define_method, month do |day, year|
Date.parse("#{day}/#{index + 1}/#{year}")
end
end
Jump to Line
Something went wrong with that request. Please try again.