class Mark::Options
- Mark::Options
- Reference
- Object
Overview
Wraps arguments and options from CLI. Handles setting defaults and running validations.
Example usage:
options = Mark::Options.new(["source.md"], { :target => "/path/to/target.html" })
options.sources # => ["source.md"]
options.target # => "/path/to/target.html"
options.template_html # => ".... default html template ..."
options.open_command # => "open /path/to/target.html"
options.keep # => false
options.keep_for # => 300
options.validate! # => no-op since all options are valid
options = Mark::Options.new([], { :target => "/path/to/target.html" })
options.validate! # => raises OptionError, at least one source required
Defined in:
mark/options.crConstant Summary
-
DEFAULT_KEEP_FOR =
"300"
-
DEFAULT_OPEN =
"open %"
-
DEFAULT_TARGET =
".mark.html"
-
DEFAULT_TEMPLATE =
File.join(ENV["HOME"], ".mark", "template.html")
Constructors
Instance Method Summary
- #keep : Bool
- #keep_for_seconds
- #open_command
- #sources : Array(String)
- #target : String
- #target_directory
- #template_html
- #validate!