class Agen::Shell

Public Class Methods

new(options) click to toggle source
# File lib/agen/shell.rb, line 5
def initialize(options)
  @options = options
end

Public Instance Methods

add_options() click to toggle source
# File lib/agen/shell.rb, line 9
def add_options
  if !@options[:histfile]
    @options = opts_klass.set_histfile
  end

  if @options && !@options[:rcfile]
    @options = opts_klass.set_rcfile
  end

  @options
end

Private Instance Methods

bash?() click to toggle source
# File lib/agen/shell.rb, line 23
def bash?
  @_bash ||= shell.match?(/bash/)
end
opts_klass() click to toggle source
# File lib/agen/shell.rb, line 27
def opts_klass
  @_opts_klass ||= if bash?
    BashOptions
  elsif zsh?
    ZshOptions
  else
    BaseOptions
  end.new(@options)
end
shell() click to toggle source
# File lib/agen/shell.rb, line 37
def shell
  @_shell ||= ENV["SHELL"]
end
zsh?() click to toggle source
# File lib/agen/shell.rb, line 41
def zsh?
  @_zsh ||= shell.match?(/zsh/)
end