Class: Xantora::CLI
- Inherits:
-
Thor
- Object
- Thor
- Xantora::CLI
- Defined in:
- lib/xantora/cli.rb
Overview
Class responsible for the CLI logic based on thor
Constant Summary collapse
- Error =
Error raised by this runner
Class.new(StandardError)
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
13 14 15 |
# File 'lib/xantora/cli.rb', line 13 def self.exit_on_failure? true end |
Instance Method Details
#convert(source) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/xantora/cli.rb', line 38 def convert(source) if File.directory? source puts "[.] Scanning #{source} directory for .adoc files ..." Dir.glob(File.join(source, "/**/pages/*.adoc")) { |file| convert_document(file, ) } elsif source.end_with? ".adoc" convert_document(source, ) else puts "[error] No valid source detected." exit 1 end end |