free_mutant/spec/support/compress_helper.rb

11 lines
239 B
Ruby
Raw Normal View History

2012-08-16 12:02:03 -04:00
module CompressHelper
def strip_indent(string)
lines = string.lines
match = /\A( *)/.match(lines.first)
whitespaces = match[1].to_s.length
stripped = lines.map do |line|
line[whitespaces..-1]
end.join
end
end