Skip to content

Instantly share code, notes, and snippets.

@takkkun
Created February 20, 2014 18:35
Show Gist options
  • Select an option

  • Save takkkun/9120285 to your computer and use it in GitHub Desktop.

Select an option

Save takkkun/9120285 to your computer and use it in GitHub Desktop.
module Helper
def smash_whitespaces(&block)
capture(&block).lines.lazy.map(&:strip).reduce(StringIO.new, :<<).string
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment