Last active
January 24, 2016 02:49
-
-
Save ngtk/b719a5b58add5587af0a to your computer and use it in GitHub Desktop.
generate ruby.rack.status_code.snip
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rack' | |
| File.open "ruby.rack.status_code.snip", "w" do |out| | |
| Rack::Utils::HTTP_STATUS_CODES.each do |code, message| | |
| symbol = message.downcase.gsub(/\s|-|'/, '_').to_sym | |
| out.write <<-EOL | |
| snippet #{symbol} | |
| abbr #{code} #{message} | |
| options word | |
| :#{symbol} | |
| EOL | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment