Module: Format

Defined in:
lib/format.rb

Class Method Summary collapse

Class Method Details

.compact_datetime(dt) ⇒ Object



2
3
4
# File 'lib/format.rb', line 2

def Format.compact_datetime(dt)
	"%04d%02d%02d%02d%02d" % [dt.year, dt.month, dt.day, dt.hour, dt.minute]
end

.safe_for_filename(s) ⇒ Object



6
7
8
9
# File 'lib/format.rb', line 6

def Format.safe_for_filename(s)
	s.gsub(/[ ]/, '_')
		.gsub(/[(){}:]/, '')
end