Class: RGitHook::Helpers
- Inherits:
-
Object
- Object
- RGitHook::Helpers
- Defined in:
- lib/rgithook/githook.rb
Constant Summary collapse
- HTML_ESCAPE =
{ '&'=>'&', '<'=>'<', '>'=>'>', '"'=>'"', "'"=>''', }
Class Method Summary collapse
-
.html_escape(text) ⇒ Object
Returns a copy of
textwith ampersands, angle brackets and quotes escaped into HTML entities.
Class Method Details
.html_escape(text) ⇒ Object
Returns a copy of text with ampersands, angle brackets and quotes escaped into HTML entities.
127 128 129 |
# File 'lib/rgithook/githook.rb', line 127 def self.html_escape(text) text.to_s.gsub(/[\"><&]/) { |s| HTML_ESCAPE[s] } end |