Module: Diff2Xml::XmlTool
- Included in:
- Diff2Html, Diff2Rss20
- Defined in:
- lib/diff2xml/xmltool.rb
Instance Method Summary collapse
Instance Method Details
#convert_illegal_characters(str) ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/diff2xml/xmltool.rb', line 30 def convert_illegal_characters(str) ret = str.chomp ret.gsub!( '&', '&' ) ret.gsub!('\'', ''') ret.gsub!('"', '"') ret.gsub!( '<', '<' ) ret.gsub!( '>', '>' ) ret.gsub!("\t", ' ') ret end |
#convert_space(str) ⇒ Object
41 42 43 44 |
# File 'lib/diff2xml/xmltool.rb', line 41 def convert_space(str) ret = str.gsub(' ', ' ') 0 == ret.length ? ' ' : ret end |
#sanitize(str) ⇒ Object
46 47 48 49 |
# File 'lib/diff2xml/xmltool.rb', line 46 def sanitize(str) ret = convert_illegal_characters(str) ret = convert_space(ret) end |