Module: JazzFingers

Extended by:
Forwardable
Defined in:
lib/jazz_fingers.rb,
lib/jazz_fingers/input.rb,
lib/jazz_fingers/print.rb,
lib/jazz_fingers/prompt.rb,
lib/jazz_fingers/coderay.rb,
lib/jazz_fingers/version.rb,
lib/jazz_fingers/commands.rb,
lib/jazz_fingers/commands/sql.rb,
lib/jazz_fingers/amazing_print.rb,
lib/jazz_fingers/commands/copy.rb,
lib/jazz_fingers/configuration.rb,
lib/jazz_fingers/coderay/escaped_colors.rb,
lib/jazz_fingers/commands/caller_method.rb,
lib/jazz_fingers/coderay/unescaped_colors.rb,
lib/jazz_fingers/prompt/pry_version_012_and_prior.rb,
lib/jazz_fingers/prompt/pry_version_013_and_later.rb

Defined Under Namespace

Modules: CodeRay, Commands Classes: Configuration, Input, Print, Prompt

Constant Summary collapse

VERSION =
'7.1.0'.freeze
AMAZING_PRINT =
{
  indent: 2,
  sort_keys: true,
  color: {
    args: :greenish,
    array: :whiteish,
    bigdecimal: :blue,
    class: :yellow,
    date: :greenish,
    falseclass: :red,
    fixnum: :blue,
    float: :blue,
    hash: :whiteish,
    keyword: :cyan,
    method: :purpleish,
    nilclass: :red,
    string: :yellowish,
    struct: :whiteish,
    symbol: :cyanish,
    time: :greenish,
    trueclass: :green,
    variable: :cyanish
  }
}

Class Method Summary collapse

Class Method Details

.configObject



54
55
56
# File 'lib/jazz_fingers.rb', line 54

def config
  @config ||= Configuration.new
end

.configure {|@config ||= Configuration.new| ... } ⇒ Object

Yields:



49
50
51
52
# File 'lib/jazz_fingers.rb', line 49

def configure
  yield @config ||= Configuration.new
  setup!
end

.inputObject



45
46
47
# File 'lib/jazz_fingers.rb', line 45

def input
  @input ||= Input.config
end


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

def print
  @print ||= Print.config
end

.promptObject



35
36
37
38
39
40
41
42
43
# File 'lib/jazz_fingers.rb', line 35

def prompt
  @prompt ||=
    Prompt.new(
      colored: config.colored_prompt,
      separator: config.prompt_separator,
      application_name: config.application_name
    )
  @prompt.config
end

.setup!Object



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/jazz_fingers.rb', line 58

def setup!
  Pry.prompt = prompt
  Pry.input = input if JazzFingers.coolline?
  Pry.config.should_load_plugins = false
  Pry.editor = 'vi'
  Pry.config.ls.separator = "\n"
  Pry.config.ls.heading_color = :magenta
  Pry.config.ls.public_method_color = :green
  Pry.config.ls.protected_method_color = :yellow
  Pry.config.ls.private_method_color = :bright_black

  JazzFingers::Commands.constants(false).each do |constant|
    command = JazzFingers::Commands.const_get(constant)
    Pry.config.commands.import(command)
  end

  if JazzFingers.amazing_print?
    require 'amazing_print'

    AmazingPrint.defaults = JazzFingers::AMAZING_PRINT
    Pry.print = print
  end

  JazzFingers::CodeRay.setup!

  true
end