Module: Uniconvert
- Defined in:
- lib/uniconvert.rb,
lib/uniconvert/setup.rb,
lib/uniconvert/version.rb,
lib/uniconvert/converters/HTML.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
"0.2.2"
Class Method Summary collapse
-
.file_to(converter, file, create_file = false) ⇒ Object
Convert contents of a file using one of the supported conversion handlers.
-
.str_to(converter, file, create_file = false) ⇒ Object
Convert a string using one of the supported conversion handlers.
Class Method Details
.file_to(converter, file, create_file = false) ⇒ Object
Convert contents of a file using one of the supported conversion handlers
11 12 13 14 |
# File 'lib/uniconvert.rb', line 11 def self.file_to(converter, file, create_file = false) converter_obj = Uniconvert.const_get(converter).new(create_file) converter_obj.convert_file(file) end |
.str_to(converter, file, create_file = false) ⇒ Object
Convert a string using one of the supported conversion handlers
24 25 26 27 28 29 30 31 32 |
# File 'lib/uniconvert.rb', line 24 def self.str_to(converter, file, create_file = false) converter_obj = Uniconvert.const_get(converter).new(create_file) converted_str = converter_obj.convert_str(file) # copy to clipboard? # if system('type pbcopy') # `echo "#{converted_str}" > /dev/null 2>&1 | pbcopy` # end end |