Class: Markup::Preview::Command::Runner
- Inherits:
-
Object
- Object
- Markup::Preview::Command::Runner
- Includes:
- Util
- Defined in:
- lib/markup-preview-command.rb
Constant Summary collapse
- TMPDIR =
File.join(Dir.tmpdir, 'markup-preview')
- TMPFILE =
File.join(TMPDIR, $$.to_s) + '.html'
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Methods included from Util
#browser_command, #command_exist?
Constructor Details
Class Method Details
.run(argv) ⇒ Object
24 25 26 |
# File 'lib/markup-preview-command.rb', line 24 def self.run(argv) self.new(argv).run end |
Instance Method Details
#run ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/markup-preview-command.rb', line 28 def run create_html if @opts.browser open_browser exit($?.exitstatus || 0) else puts File.read(TMPFILE) exit 0 end end |