Class: Fronde::Emacs
- Inherits:
-
Object
- Object
- Fronde::Emacs
- Defined in:
- lib/fronde/emacs.rb
Overview
Wraps Gnu/Emacs calls
Instance Method Summary collapse
-
#initialize(verbose: false) ⇒ Emacs
constructor
A new instance of Emacs.
- #publish(project = 'website', force: false) ⇒ Object
- #publish_file(file_path, force: false) ⇒ Object
Constructor Details
#initialize(verbose: false) ⇒ Emacs
Returns a new instance of Emacs.
8 9 10 11 |
# File 'lib/fronde/emacs.rb', line 8 def initialize(verbose: false) @verbose = verbose @command = nil end |
Instance Method Details
#publish(project = 'website', force: false) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/fronde/emacs.rb', line 13 def publish(project = 'website', force: false) if force build_command %[(org-publish "#{project}" t)] else build_command %[(org-publish "#{project}")] end run_command end |
#publish_file(file_path, force: false) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/fronde/emacs.rb', line 22 def publish_file(file_path, force: false) if force build_command '(org-publish-current-file t)' else build_command '(org-publish-current-file)' end @command.insert(-2, %(--visit "#{file_path}")) run_command end |