class Jeny::Configuration

Constants

DEFAULT_EDIT_PROC

Attributes

editor_command[RW]

Shell command to open the source code editor.

Default value checks the JENY_EDITOR, GIT_EDITOR, EDITOR environment variables, and fallbacks to “code”.

ignore_pattern[RW]

Regular expression matching files that can always be ignored by Snippets.

Defaults to /^(vendor|.bundle)/

jeny_block_delimiter[RW]

The delimiter used for jeny block in source code files.

Defaults to `#jeny`

jeny_file[RW]
state_manager[R]

State manager to use.

Default value check the JENY_STATE_MANAGER environment variable:

  • `none`, no state management is done

  • `git`, git is used to stash/unstash/commit/reset

Defaults to `none`, that is, to an empty state manager.

state_manager_options[R]

Options for the state manager.

This is a Hash, with `:stash` and `:commit` keys mapping to either true of false.

Both are true by default.

Public Class Methods

new() { |self| ... } click to toggle source
# File lib/jeny/configuration.rb, line 8
def initialize
  @jeny_block_delimiter = "#jeny"
  @ignore_pattern = /^(vendor|\.bundle)/
  @editor_command = default_editor_command
  @edit_changed_files = DEFAULT_EDIT_PROC
  @state_manager = default_state_manager
  @state_manager_options = {
    stash: true,
    commit: true
  }
  yield(self) if block_given?
end

Public Instance Methods

default_editor_command() click to toggle source
# File lib/jeny/configuration.rb, line 38
def default_editor_command
  ENV['JENY_EDITOR'] || ENV['GIT_EDITOR'] || ENV['EDITOR']
end