Module: Uniconvert
- Defined in:
- lib/uniconvert.rb,
lib/uniconvert/version.rb
Constant Summary collapse
- VERSION =
"0.1.1"
Class Method Summary collapse
Class Method Details
.to_html(file, create_file = true) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/uniconvert.rb', line 2 def self.to_html(file, create_file = true) coder = HTMLEntities.new non_latin_strings = File.read(file) translated_file_name = file + '.converted' converted = coder.encode(non_latin_strings, :named) if create_file File.open(translated_file_name, 'w+') do |f| f.write converted end `$EDITOR #{translated_file_name}` end converted.nil? end |