class Jekyll::Compose::FileEditor

Attributes

compose_config[R]
jekyll_compose_config[R]

Public Class Methods

auto_open?() click to toggle source
# File lib/jekyll-compose/file_editor.rb, line 40
def auto_open?
  compose_config["auto_open"]
end
bootstrap(config) click to toggle source
# File lib/jekyll-compose/file_editor.rb, line 22
def bootstrap(config)
  @compose_config = config["jekyll_compose"] || {}
end
open_editor(filepath) click to toggle source
# File lib/jekyll-compose/file_editor.rb, line 26
def open_editor(filepath)
  run_editor(post_editor, File.expand_path(filepath)) if post_editor
end
post_editor() click to toggle source
# File lib/jekyll-compose/file_editor.rb, line 34
def post_editor
  return unless auto_open?

  ENV["JEKYLL_EDITOR"] || ENV["VISUAL"] || ENV["EDITOR"]
end
run_editor(editor_name, filepath) click to toggle source
# File lib/jekyll-compose/file_editor.rb, line 30
def run_editor(editor_name, filepath)
  system("#{editor_name} #{filepath}")
end