Module: Gimli
- Extended by:
- OptiFlagSet
- Defined in:
- lib/gimli/setup.rb,
lib/gimli.rb,
lib/gimli/file.rb,
lib/gimli/markup.rb,
lib/gimli/version.rb,
lib/gimli/converter.rb
Overview
Set up the flags available
Defined Under Namespace
Classes: Albino, Converter, File, Markup
Constant Summary collapse
- Version =
"0.1.3"
Class Method Summary collapse
-
.load_file(file) ⇒ Object
Add file to the files to be converted if it’s valid.
-
.process! ⇒ Object
Starts the processing of selected files.
Class Method Details
.load_file(file) ⇒ Object
Add file to the files to be converted if it’s valid
36 37 38 39 |
# File 'lib/gimli.rb', line 36 def self.load_file(file) file = File.new file @files << file if file.valid? end |
.process! ⇒ Object
Starts the processing of selected files
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/gimli.rb', line 12 def self.process! if ARGV.flags.version? puts "Version: #{Gimli::Version}" return end @files = [] if ARGV.flags.file? Gimli.load_file(ARGV.flags.file) else Dir.glob("*").each do |file| Gimli.load_file(file) end end @files.each do |file| converter = Converter.new file converter.convert! end end |