Class: JazzFingers::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/jazz_fingers/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#application_nameObject



41
42
43
44
45
46
47
48
49
# File 'lib/jazz_fingers/configuration.rb', line 41

def application_name
  return "(#{underscore(@application_name)})" unless @application_name.nil?

  if defined?(Rails)
    return "(#{Rails.application.class.parent_name.underscore})"
  else
    return "(jazz_fingers)"
  end
end

#awesome_print=(value) ⇒ Object (writeonly)

Sets the attribute awesome_print

Parameters:

  • value

    the value to set the attribute awesome_print to.



3
4
5
# File 'lib/jazz_fingers/configuration.rb', line 3

def awesome_print=(value)
  @awesome_print = value
end

#colored_promptObject

Color the prompt?

A different setting than Pry.color since some may like colored output, but a plain prompt.

Default: ‘true’ for GNU readline or rb-readline which correctly count line widths with color codes when using 001 and 002 hints. ‘false’ for libedit-based wrapper (standard on OS X unless ruby is explicitly compiled otherwise).



15
16
17
18
19
# File 'lib/jazz_fingers/configuration.rb', line 15

def colored_prompt
  return (Readline::VERSION !~ /EditLine/) && Pry.color if @colored_prompt.nil?

  @colored_prompt
end

#coolline=(value) ⇒ Object (writeonly)

Sets the attribute coolline

Parameters:

  • value

    the value to set the attribute coolline to.



3
4
5
# File 'lib/jazz_fingers/configuration.rb', line 3

def coolline=(value)
  @coolline = value
end

#prompt_separatorObject

Separator between application name and input in the prompt.

Default: right angle quote, or ‘>’ when using rb-readline which doesn’t handle mixed encodings well.



25
26
27
# File 'lib/jazz_fingers/configuration.rb', line 25

def prompt_separator
  @prompt_separator ||= defined?(RbReadline) ? ">" : "\u00BB"
end

Instance Method Details

#awesome_print?Boolean

Returns:

  • (Boolean)


35
36
37
38
39
# File 'lib/jazz_fingers/configuration.rb', line 35

def awesome_print?
  return true if @awesome_print.nil?

  @awesome_print
end

#coolline?Boolean

Returns:

  • (Boolean)


29
30
31
32
33
# File 'lib/jazz_fingers/configuration.rb', line 29

def coolline?
  return false if @coolline.nil?

  @coolline
end