[
  {
    "path": ".gitignore",
    "content": "*.gem\n*.rbc\n.bundle\n.config\n.yardoc\nGemfile.lock\nInstalledFiles\n_yardoc\ncoverage\ndoc/\nlib/bundler/man\npkg\nrdoc\nspec/reports\ntest/tmp\ntest/version_tmp\ntmp\n"
  },
  {
    "path": ".rubocop.yml",
    "content": "Metrics/LineLength:\n  Max: 120\n\nStyle/Documentation:\n  Enabled: false\n"
  },
  {
    "path": ".ruby-gemset",
    "content": "jazz_fingers"
  },
  {
    "path": ".ruby-version",
    "content": "3.4.1\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# CHANGELOG\n\n## 7.1.0 (2026-03-25)\n\n### Fixed\n* Pager on Ruby 4.0\n\n## 7.0.0 (2026-03-24)\n* Replace `readline` with `reline` for Ruby 4.0 compatibility\n* Remove `pry-byebug` runtime dependency and debugger aliases\n* Simplify `colored_prompt` and `prompt_separator` defaults\n\n## 6.3.0 (2025-10-01)\n* Upgrade [amazing-print][amazing-print] to 1.8\n* Upgrade [pry][pry] to 0.15\n* Upgrade [pry-byebug][pry-byebug] to 3.11\n\n## 6.2.0 (2021-04-19)\n* Upgrade [pry-byebug][pry-byebug] to 3.9\n\n## 6.1.0 (2021-04-19)\n* Update [amazing_print][amazing_print] to v1.3.0\n\n## 6.0.0.pre.rc1 (2020-10-22)\n* Switched [awesome_print][awesome_print] with [amazing_print][amazing_print]\n\n## 5.2.0 (2020-07-22)\n* Fixed application name\n\n## 5.2.1 (2020-07-16)\n* Fix Rails deprecation\n\n## 5.2.0 (2020-05-09)\n* Added Pry custom commands\n* Customize AwesomePrint configuration\n* Customize CodeRay colors\n\n## 5.1.0.rc1 (2020-04-25)\n* Change deprecated method on pry > 0.13.0\n* Improve naming context\n\n## 5.0.1 (2019-06-02)\n* Remove documentation for removed dependency\n* Use non deprecated method of `pry` if existent\n\n## 5.0.0 (2018-05-02)\n* Remove [pry-doc][pry-doc] dependency to reduce memory footprint\n* Remove [hirb][hirb] dependency since its not being actively maintained\n\n## 4.0.1 (2016-05-26)\n* Remove requires for `pry-remote`\n\n## 4.0.0 (2016-05-26)\n* Remove [pry-remote][pry-remote] dependency\n\n## 3.0.2 (2016-03-07)\n* Downgrade [pry-byebug][pry-byebug] to fix issues with [pry-remote][pry-remote]\n\n## 3.0.1 (2016-02-28)\n* Separate prompt and print output with a new line\n\n## 3.0.0 (2015-09-22)\n\n* Remove [pry-git] dependency\n* Switch to HTTPS in Gemfile\n\n## 2.0.2 (2015-09-06)\n\n* Fix YARD issue when ENV['HOME'] is empty\n\n## 2.0.1 (2015-06-29)\n\n* Fix application name when outside Rails\n\n## 2.0.1.rc1 (2015-05-27)\n\n* Fix load of [pry][pry] plugins\n* Fix application name when inside Rails\n* Add feature to set a custom Name\n\n## 2.0.0 (2015-05-31)\n\n* Add alias to the most used commands\n* Update [pry-byebug][pry-byebug] to ~> v3.1\n* Improve abstraction by creating models to handle specific responsibilities\n* Add configuration to enable/disable [pry-coolline][pry-coolline]\n* Add configuration to enable/disable [awesome_print][awesome_print]\n* Remove [pry-rails][pry-rails] dependency\n* Remove [railties][railties] dependency\n\n## 1.0.0 (2015-02-05)\n* Downgrade [pry-byebug][pry-byebug] to v1.3.3\n\n## 0.5.5 (2015-02-03)\n\n* Update [pry-byebug][pry-byebug] to v2.0.0\n* Update [awesome_print][awesome_print] to v1.6.1\n\n## 0.5.4 (2014-11-06)\n\n* Remove [pry-stack_explorer][pry-stack_explorer]\n\n## 0.5.3 (2014-11-04)\n\n* Using [pry-byebug][pry-byebug] to use ruby >= 2.0.0.\n* Switched [coolline][coolline] with [pry-coolline][pry-coolline]\n* Upgrade [pry][pry] to 0.10, [pry-doc][pry-doc] to 0.6\n* Rename to `JazzFingers` to allow releasing.\n\n## 0.5.2 (2013-10-24)\n\n* Upgrade [pry-rails][pry-rails] to the latest 0.3.2,\n  [awesome_print][awesome_print] to 1.2 and loosen it's dependency, and removed\n  [coderay][coderay] as an explicit dependency since [pry][pry] already includes\n  it.\n\n## 0.5.1 (2013-06-28)\n\n* Upgrade [pry-rails][pry-rails] to the latest 0.3.1, [pry-doc][pry-doc] 0.4.6,\n  [coolline][coolline] 0.4.2.\n\n\n## 0.5.0 (2013-03-13)\n\n* Rails 4, Ruby 2.0.0 compatibility.\n* Upgrade [pry][pry] to the latest 0.9.12,\n  [pry-stack_explorer][pry-stack_explorer] 0.4.9, [pry-remote][pry-remote]\n  0.1.7, [pry-debugger][pry-debugger] 0.2.2, [hirb][hirb] 0.7.1,\n  [coderay][coderay] 1.0.9.\n\n\n## 0.4.0 (2012-12-27)\n\n* Add [pry-rails][pry-rails] 0.2.2 for maintained console hooks and new\n  `show-routes`, `show-models`, and `show-middleware` commands.\n* Add `JazzHands.colored_prompt` and `JazzHands.prompt_separator` options.\n  Detect readline library to turn off incompatible colored prompt or Unicode\n  prompt separator where appropriate. Fixes #1 and #2.\n* Upgrade [pry][pry] to the latest 0.9.10, [pry-doc][pry-doc] 0.4.4,\n  [pry-stack_explorer][pry-stack_explorer] 0.4.7, [pry-remote][pry-remote]\n  0.1.6, [pry-debugger][pry-debugger] 0.2.1, [hirb][hirb] 0.7.0,\n  [Coolline][coolline] 0.4.0, [coderay][coderay] 1.0.8,\n  [awesome_print][awesome_print] 1.1.0. Fixes #4.\n\n## 0.3.1 (2012-06-11)\n\n* Upgrade [pry-debugger][pry-debugger] to 0.2.0.\n\n## 0.3.0 (2012-06-07)\n\n* Replace [pry-nav][pry-nav] with [pry-debugger][pry-debugger] for improved\n  performance and no segfaults. `JazzHands.enable_pry_nav` removed.\n* Upgrade [pry][pry] to the latest 0.9.9, [pry-doc][pry-doc] 0.4.2,\n  [pry-git][pry-git] 0.2.3, [pry-stack_explorer][pry-stack_explorer] 0.4.2,\n  [pry-remote][pry-remote] 0.1.4, [coderay][coderay] 1.0.6.\n\n## 0.2.0 (2012-03-19)\n\n* Add [pry-stack_explorer][pry-stack_explorer] 0.4.1.\n* Upgrade [pry-remote][pry-remote] to 0.1.1 and [pry-nav][pry-nav] to 0.2.0.\n* Upgrade recommended gem minor versions: [pry][pry] 0.9.8.4, [pry-doc][pry-doc]\n  0.4.1, [hirb][hirb] 0.6.2, and [coderay][coderay] 1.0.5.\n\n## 0.1.2 (2012-01-23)\n\n* Improved Rails 3.2 compatibility. Console methods like `app`, `new_session`,\n  `reload!`, `helper`, and `controller` work as expected.\n\n## 0.1.1 (2012-01-20)\n\n* Rails 3.2 compatibility\n\n## 0.1.0 (2012-01-04)\n\n* For performance, enable [pry-nav][pry-nav] only on MRI 1.9.3 by default. To\n  use on MRI 1.9.2, add `JazzHands.enable_pry_nav` to a Rails initializer.\n* Due to buggy behavior, syntax highlighting as you type via\n  [Coolline][coolline] and [Coderay][coderay] is disabled by default. Enable\n  with `JazzHands.enable_syntax_highlighting_as_you_type` in a Rails\n  initializer. MRI 1.9.3 only.\n* Fix [Hirb][hirb] support.\n* Upgrade [awesome_print][awesome_print] to 1.0.2.\n\n## 0.0.6 (2011-12-03)\n\n* Add line numbers to the prompt for easy reference when using `_in_` and\n  `_out`.\n* Upgrade [pry-nav][pry-nav] to 0.0.4.\n\n\n## 0.0.5 (2011-12-01)\n\n* Add [Hirb][hirb] support. Enable with `Hirb.enable` in the console.\n* Upgrade [pry-nav][pry-nav] to 0.0.3.\n\n\n## 0.0.4 (2011-11-30)\n\n* Add explicit requires for pry plugin gems.\n\n\n## 0.0.3 (2011-11-30)\n\n* Add [pry-nav][pry-nav].\n* Upgrade [awesome_print][awesome_print] to 1.0.1.\n\n\n## 0.0.2 (2011-11-25)\n\n* Add [pry-doc][pry-doc].\n\n\n## 0.0.1 (2011-11-25)\n\n* First release. Combine [pry][pry], [awesome_print][awesome_print],\n  [coolline][coolline] + [coderay][coderay], [pry-remote][pry-remote],\n  [pry-git][pry-git]. Bit of glue to replace IRB with pry in Rails console,\n  pretty colors.\n\n\n[pry]:                http://pry.github.com\n[awesome_print]:      https://github.com/michaeldv/awesome_print\n[amazing_print]:      https://github.com/amazing-print/amazing_print\n[pry-doc]:            https://github.com/pry/pry-doc\n[pry-git]:            https://github.com/pry/pry-git\n[pry-nav]:            https://github.com/nixme/pry-nav\n[pry-remote]:         https://github.com/Mon-Ouie/pry-remote\n[coolline]:           https://github.com/Mon-Ouie/coolline\n[pry-coolline]:        https://github.com/pry/pry-coolline\n[coderay]:            https://github.com/rubychan/coderay\n[hirb]:               https://github.com/cldwalker/hirb\n[pry-stack_explorer]: https://github.com/pry/pry-stack_explorer\n[pry-debugger]:       https://github.com/nixme/pry-debugger\n[pry-rails]:          https://github.com/rweng/pry-rails\n[pry-byebug]:         https://github.com/deivid-rodriguez/pry-byebug\n[railties]:           https://github.com/rails/rails\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "## Getting Involved\n\nNew contributors are always welcome, when it doubt please ask questions. We strive to be an open and welcoming community. Please be nice to one another.\n\n### Coding\n\n* Pick a task:\n  * Offer feedback on open [pull requests](https://github.com/plribeiro3000/jazz_fingers/pulls).\n  * Review open [issues](https://github.com/plribeiro3000/jazz_fingers/issues) for things to help on.\n  * [Create an issue](https://github.com/plribeiro3000/jazz_fingers/issues/new) to start a discussion on additions or features.\n* Fork the project, add your changes and tests to cover them in a topic branch.\n* Commit your changes and rebase against `plribeiro3000/jazz_fingers` to ensure everything is up to date.\n* [Submit a pull request](https://github.com/plribeiro3000/jazz_fingers/compare/)\n\n### Non-Coding\n\n* Offer feedback on open [issues](https://github.com/plribeiro3000/jazz_fingers/issues).\n* Organize or volunteer at events."
  },
  {
    "path": "CONTRIBUTORS.md",
    "content": "# Original Author\n* Gopal Patel <nixme@stillhope.com>\n\n# Contributors\n* Andrew Volozhanin <linuxheadrus@gmail.com>\n* Anthony Sellitti <anthony.github@asellitt.com>\n* Casey Lang <hello@casey-lang.com>\n* Fernando Paredes <nano@fdp.io>\n* Micah Gates <github@mgates.com>\n* Paulo Henrique Lopes Ribeiro <plribeiro3000@gmail.com>\n"
  },
  {
    "path": "Gemfile",
    "content": "source 'https://rubygems.org'\n\ngemspec\n"
  },
  {
    "path": "LICENSE.md",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2014-2015 [CONTRIBUTORS.md](https://github.com/plribeiro3000/jazz_fingers/blob/master/CONTRIBUTORS.md)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
  },
  {
    "path": "README.md",
    "content": "Jazz Fingers\n============\n\nThis repo is a fork, with updates and bug fixes based on [`jazz_hands`](https://github.com/nixme/jazz_hands).\n\nSpending hours in the pry console? Spruce it up and show off those\nhard-working fingers!\n\n**jazz_fingers** is an opinionated set of console-related gems and a bit of glue:\n\n* [**Pry**][pry] for a powerful shell alternative to IRB.\n* [**Amazing Print**][amazing_print] for stylish pretty print.\n  console.\n* [**Pry Coolline**][pry-coolline] for syntax highlighting as you type.\n\n## Notes on Update to `5.0.0`\n* [**Hirb**][hirb] was removed since it is not actively being maintained\n* [**Pry-Doc**][pry-doc] was removed since it adds a lot of memory footprint which makes `JazzFingers` too heavy to use in production.\nAdd it to your `Gemfile` if you want it back\n* `jazz_fingers/setup` is not needed since the setup is done automatically after the configuration block ends\n* Call `JazzFingers.setup!` if you are using the default configurations\n\n## Usage\n\nRuby 2.0.0+. Add to your project Gemfile:\n\n```ruby\ngroup :development, :test do\n  gem 'jazz_fingers'\nend\n```\n\nThat's it. Run `pry` as usual.\n\nRuby compiled against a proper readline library, ideally GNU readline, is\nrecommended. Alternatively, [`gem install rb-readline`][rb-readline] for an\nacceptible backup. Using ruby compiled against a `libedit` wrapper (primarily OS\nX) will work but is not recommended.\n\n\n## Options\n\nSome configurations can be overwritten:\n\n```ruby\nif defined?(JazzFingers)\n  JazzFingers.configure do |config|\n    config.colored_prompt = false\n    config.amazing_print = false\n    config.coolline = false\n    config.application_name = MyAwesomeProject\n  end\nend\n```\n\n### `colored_prompt`\n\nColor the console prompt? Defaults to `true` when the current ruby is compiled\nagainst GNU readline or `rb-readline`, which don't have issues counting\ncharacters in colored prompts. `false` for libedit.\n\nNote: `Pry.color = false` trumps this setting and disables all console coloring.\n\n### `prompt_separator`\n\nSeparator string between the application name and line input. Defaults to `»`\nfor GNU readline or libedit. Defaults to `>` for `rb-readline` which fails on\nmixed encodings.\n\n\n[pry]:                http://pry.github.com\n[amazing_print]:      https://github.com/amazing-print/amazing_print\n[hirb]:               https://github.com/cldwalker/hirb\n[pry-doc]:            https://github.com/pry/pry-doc\n[pry-coolline]:       https://github.com/pry/pry-coolline\n[coderay]:            https://github.com/rubychan/coderay\n[rb-readline]:        https://github.com/luislavena/rb-readline\n[pullrequests]:       https://github.com/plribeiro3000/jazz_fingers/pulls\n[issues]:             https://github.com/plribeiro3000/jazz_fingers/issues\n[changelog]:          https://github.com/plribeiro3000/jazz_fingers/blob/master/CHANGELOG.md\n"
  },
  {
    "path": "Rakefile",
    "content": "#!/usr/bin/env rake\n\nrequire 'bundler/gem_tasks'\n"
  },
  {
    "path": "jazz_fingers.gemspec",
    "content": "require File.expand_path('lib/jazz_fingers/version', __dir__)\n\nGem::Specification.new do |gem|\n  gem.name          = 'jazz_fingers'\n  gem.version       = JazzFingers::VERSION\n  gem.author        = 'Paulo Henrique Lopes Ribeiro'\n  gem.email         = 'plribeiro3000@gmail.com'\n  gem.license       = 'MIT'\n  gem.homepage      = 'https://github.com/plribeiro3000/jazz_fingers'\n  gem.summary       = 'Exercise those fingers. Pry-based enhancements for the default Ruby console.'\n  description =\n    'Spending hours in the ruby console? Spruce it up and show off those hard-working hands! jazz_fingers'\\\n    'replaces IRB with Pry, improves output through amazing_print, and has some other goodies up its sleeves.'\n  gem.description   = description\n\n  gem.executables   = `git ls-files -- bin/*`.split(\"\\n\").map { |f| File.basename(f) }\n  gem.files         = `git ls-files`.split(\"\\n\")\n  gem.test_files    = `git ls-files -- {test,spec,features}/*`.split(\"\\n\")\n  gem.require_paths = ['lib']\n\n  # Dependencies\n  gem.required_ruby_version = '>= 2.0'\n  gem.add_runtime_dependency 'amazing_print', '~> 1.8'\n  gem.add_runtime_dependency 'pry', '~> 0.15'\n  gem.add_runtime_dependency 'pry-coolline', '~> 0.2'\n\n  gem.add_development_dependency 'rubocop'\nend\n"
  },
  {
    "path": "lib/jazz_fingers/amazing_print.rb",
    "content": "module JazzFingers\n  AMAZING_PRINT = {\n    indent: 2,\n    sort_keys: true,\n    color: {\n      args: :greenish,\n      array: :whiteish,\n      bigdecimal: :blue,\n      class: :yellow,\n      date: :greenish,\n      falseclass: :red,\n      fixnum: :blue,\n      float: :blue,\n      hash: :whiteish,\n      keyword: :cyan,\n      method: :purpleish,\n      nilclass: :red,\n      string: :yellowish,\n      struct: :whiteish,\n      symbol: :cyanish,\n      time: :greenish,\n      trueclass: :green,\n      variable: :cyanish\n    }\n  }\nend\n"
  },
  {
    "path": "lib/jazz_fingers/coderay/escaped_colors.rb",
    "content": "module JazzFingers\n  module CodeRay\n    ESCAPED_COLORS = {\n      attribute_name: \"\\e[33m\",\n      attribute_value: \"\\e[31m\",\n      binary: \"\\e[1;35m\",\n      char: {\n        self: \"\\e[36m\",\n        delimiter: \"\\e[34m\"\n      },\n      class: \"\\e[1;35m\",\n      class_variable: \"\\e[36m\",\n      color: \"\\e[32m\",\n      comment: \"\\e[37m\",\n      complex: \"\\e[34m\",\n      constant: \"\\e[34m\\e[4m\",\n      decoration: \"\\e[35m\",\n      definition: \"\\e[1;32m\",\n      directive: \"\\e[32m\\e[4m\",\n      doc: \"\\e[46m\",\n      doctype: \"\\e[1;30m\",\n      doc_string: \"\\e[31m\\e[4m\",\n      entity: \"\\e[33m\",\n      error: \"\\e[1;33m\\e[41m\",\n      exception: \"\\e[1;31m\",\n      float: \"\\e[1;35m\",\n      function: \"\\e[1;34m\",\n      global_variable: \"\\e[42m\",\n      hex: \"\\e[1;36m\",\n      include: \"\\e[33m\",\n      integer: \"\\e[1;34m\",\n      key: \"\\e[35m\",\n      label: \"\\e[1;15m\",\n      local_variable: \"\\e[33m\",\n      octal: \"\\e[1;35m\",\n      operator_name: \"\\e[1;29m\",\n      predefined_constant: \"\\e[1;36m\",\n      predefined_type: \"\\e[1;30m\",\n      predefined: \"\\e[4m\\e[1;34m\",\n      preprocessor: \"\\e[36m\",\n      pseudo_class: \"\\e[34m\",\n      regexp: {\n        self: \"\\e[31m\",\n        content: \"\\e[31m\",\n        delimiter: \"\\e[1;29m\",\n        modifier: \"\\e[35m\",\n        function: \"\\e[1;29m\"\n      },\n      reserved: \"\\e[1;31m\",\n      shell: {\n        self: \"\\e[42m\",\n        content: \"\\e[1;29m\",\n        delimiter: \"\\e[37m\",\n      },\n      string: {\n        self: \"\\e[36m\",\n        modifier: \"\\e[1;32m\",\n        escape: \"\\e[1;36m\",\n        delimiter: \"\\e[1;32m\",\n      },\n      symbol: \"\\e[1;31m\",\n      tag: \"\\e[34m\",\n      type: \"\\e[1;34m\",\n      value: \"\\e[36m\",\n      variable: \"\\e[34m\",\n\n      insert: \"\\e[42m\",\n      delete: \"\\e[41m\",\n      change: \"\\e[44m\",\n      head: \"\\e[45m\"\n    }.freeze\n  end\nend\n\n"
  },
  {
    "path": "lib/jazz_fingers/coderay/unescaped_colors.rb",
    "content": "module JazzFingers\n  module CodeRay\n    UNESCAPED_COLORS = {\n      attribute_name: '33',\n      attribute_value: '31',\n      binary: '1;35',\n      char: {\n        self: '36',\n        delimiter: '34'\n      },\n      class: '1;35',\n      class_variable: '36',\n      color: '32',\n      comment: '37',\n      complex: '34',\n      constant: ['34', '4'],\n      decoration: '35',\n      definition: '1;32',\n      directive: ['32', '4'],\n      doc: '46',\n      doctype: '1;30',\n      doc_string: ['31', '4'],\n      entity: '33',\n      error: ['1;33', '41'],\n      exception: '1;31',\n      float: '1;35',\n      function: '1;34',\n      global_variable: '42',\n      hex: '1;36',\n      include: '33',\n      integer: '1;34',\n      key: '35',\n      label: '1;15',\n      local_variable: '33',\n      octal: '1;35',\n      operator_name: '1;29',\n      predefined_constant: '1;36',\n      predefined_type: '1;30',\n      predefined: ['4', '1;34'],\n      preprocessor: '36',\n      pseudo_class: '34',\n      regexp: {\n        self: '31',\n        content: '31',\n        delimiter: '1;29',\n        modifier: '35',\n        function: '1;29'\n      },\n      reserved: '1;31',\n      shell: {\n        self: '42',\n        content: '1;29',\n        delimiter: '37',\n      },\n      string: {\n        self: '36',\n        modifier: '1;32',\n        escape: '1;36',\n        delimiter: '1;32',\n      },\n      symbol: '1;31',\n      tag: '34',\n      type: '1;34',\n      value: '36',\n      variable: '34',\n\n      insert: '42',\n      delete: '41',\n      change: '44',\n      head: '45'\n    }.freeze\n  end\nend\n\n"
  },
  {
    "path": "lib/jazz_fingers/coderay.rb",
    "content": "module JazzFingers\n  module CodeRay\n    autoload :ESCAPED_COLORS, 'jazz_fingers/coderay/escaped_colors'\n    autoload :UNESCAPED_COLORS, 'jazz_fingers/coderay/unescaped_colors'\n\n    def self.setup!\n      ::CodeRay.scan(\"example\", :ruby).term\n\n      if ::CodeRay::VERSION >= '1.1.0'\n        ESCAPED_COLORS.each do |key, value|\n          ::CodeRay::Encoders::Terminal::TOKEN_COLORS[key] = value\n        end\n      else\n        UNESCAPED_COLORS.each do |key, value|\n          ::CodeRay::Encoders::Terminal::TOKEN_COLORS[key] = value\n        end\n      end\n    end\n  end\nend\n"
  },
  {
    "path": "lib/jazz_fingers/commands/caller_method.rb",
    "content": "module JazzFingers\n  module Commands\n    CALLER_METHOD = Pry::CommandSet.new do\n      command \"caller_method\" do |depth|\n        depth = depth.to_i || 1\n        if /^(.+?):(\\d+)(?::in `(.*)')?/ =~ caller(depth+1).first\n          file   = Regexp.last_match[1]\n          line   = Regexp.last_match[2].to_i\n          method = Regexp.last_match[3]\n          output.puts [file, line, method]\n        end\n      end\n    end\n  end\nend\n\n"
  },
  {
    "path": "lib/jazz_fingers/commands/copy.rb",
    "content": "module JazzFingers\n  module Commands\n    COPY = Pry::CommandSet.new do\n      command \"copy\", \"Copy argument to the clip-board\" do |str|\n        IO.popen('pbcopy', 'w') { |f| f << str.to_s }\n      end\n    end\n  end\nend\n\n"
  },
  {
    "path": "lib/jazz_fingers/commands/sql.rb",
    "content": "module JazzFingers\n  module Commands\n    SQL = Pry::CommandSet.new do\n      command \"sql\", \"Send sql over AR.\" do |query|\n        if defined?(Rails)\n          pp ActiveRecord::Base.connection.select_all(query)\n        else\n          pp \"Rails not defined\"\n        end\n      end\n    end\n  end\nend\n\n"
  },
  {
    "path": "lib/jazz_fingers/commands.rb",
    "content": "module JazzFingers\n  module Commands\n    autoload :CALLER_METHOD, 'jazz_fingers/commands/caller_method'\n    autoload :COPY, 'jazz_fingers/commands/copy'\n    autoload :SQL, 'jazz_fingers/commands/sql'\n  end\nend\n"
  },
  {
    "path": "lib/jazz_fingers/configuration.rb",
    "content": "module JazzFingers\n  class Configuration\n    attr_writer :colored_prompt, :prompt_separator, :coolline, :amazing_print,\n                :application_name\n\n    # Color the prompt?\n    #\n    # A different setting than Pry.color since some may like colored output, but a\n    # plain prompt.\n    #\n    # Default: true, delegating to Pry.color.\n    def colored_prompt\n      if @colored_prompt.nil?\n        Pry.color\n      else\n        @colored_prompt\n      end\n    end\n\n    # Separator between application name and input in the prompt.\n    #\n    # Default: right angle quote (»).\n    def prompt_separator\n      @prompt_separator ||= \"\\u00BB\"\n    end\n\n    def coolline?\n      return false if @coolline.nil?\n\n      @coolline\n    end\n\n    def amazing_print?\n      return true if @amazing_print.nil?\n\n      @amazing_print\n    end\n\n    def application_name\n      return underscore(@application_name) unless @application_name.nil?\n\n      if defined?(Rails)\n        application_class = Rails.application.class\n\n        if application_class.respond_to?(:module_parent_name)\n          return application_class.module_parent_name.underscore\n        else\n          return application_class.parent_name.underscore\n        end\n      end\n\n      \"jazz_fingers\"\n    end\n\n    private\n\n    def underscore(camel_cased_word)\n      camel_cased_word.to_s.gsub(/::/, '/')\n                      .gsub(/([A-Z]+)([A-Z][a-z])/, '\\1_\\2')\n                      .gsub(/([a-z\\d])([A-Z])/, '\\1_\\2')\n                      .tr('-', '_')\n                      .downcase\n    end\n  end\nend\n"
  },
  {
    "path": "lib/jazz_fingers/input.rb",
    "content": "require 'pry-coolline'\nrequire 'coderay'\n\nmodule JazzFingers\n  class Input\n    class << self\n      def config\n        {\n          cool: cool_input\n        }\n      end\n\n      def cool_input\n        Coolline.new do |c|\n          c.transform_proc = proc do\n            CodeRay.scan(c.line, :ruby).term\n          end\n\n          c.completion_proc = proc do\n            word = c.completed_word\n            Object.constants.map(&:to_s).select { |w| w.start_with?(word) }\n          end\n        end\n      end\n    end\n  end\nend\n"
  },
  {
    "path": "lib/jazz_fingers/print.rb",
    "content": "require 'amazing_print'\n\nmodule JazzFingers\n  class Print\n    class << self\n      def config\n        lambda do |_output, value, pry_object|\n          pretty = value.ai\n          pry_object.pager.page(\"=> #{pretty}\\n\")\n        end\n      end\n    end\n  end\nend\n"
  },
  {
    "path": "lib/jazz_fingers/prompt/pry_version_012_and_prior.rb",
    "content": "# frozen_string_literal: true\n\nmodule JazzFingers\n  class Prompt\n    # For Pry < 0.13.\n    module PryVersion012AndPrior\n      def config\n        [main_prompt, wait_prompt]\n      end\n\n      def main_prompt\n        lambda do |context, _nesting, pry|\n          template(Pry.view_clip(context), pry, main_separator)\n        end\n      end\n\n      def wait_prompt\n        lambda do |context, _nesting, pry|\n          template(Pry.view_clip(context), pry, wait_separator)\n        end\n      end\n    end\n  end\nend\n"
  },
  {
    "path": "lib/jazz_fingers/prompt/pry_version_013_and_later.rb",
    "content": "# frozen_string_literal: true\n\nmodule JazzFingers\n  class Prompt\n    # For Pry >= 0.13.\n    module PryVersion013AndLater\n      # Add the JazzFingers prompt to the Pry::Prompt hash to enable changing it\n      # with `change-prompt`.\n      #\n      # Return the Pry::Prompt object.\n      def config\n        return Pry::Prompt[:jazz_fingers] if Pry::Prompt[:jazz_fingers]\n\n        Pry::Prompt.add(\n          :jazz_fingers,\n          \"A spruced-up prompt provided by jazz_fingers.\",\n          [main_separator, wait_separator]\n        ) do |context, _nesting, pry, separator|\n          template(Pry.view_clip(context), pry, separator)\n        end\n\n        Pry::Prompt[:jazz_fingers]\n      end\n    end\n  end\nend\n"
  },
  {
    "path": "lib/jazz_fingers/prompt.rb",
    "content": "# frozen_string_literal: true\n\nmodule JazzFingers\n  class Prompt\n    OBJECT_INSTANCE = /#<(.+)>/\n\n    autoload :PryVersion013AndLater, 'jazz_fingers/prompt/pry_version_013_and_later'\n    autoload :PryVersion012AndPrior, 'jazz_fingers/prompt/pry_version_012_and_prior'\n\n    if Pry::VERSION >= \"0.13.0\"\n      include PryVersion013AndLater\n    else\n      include PryVersion012AndPrior\n    end\n\n    def initialize(options = {})\n      @colored = options.fetch(:colored)\n      @separator = options.fetch(:separator)\n      @application_name = options.fetch(:application_name)\n    end\n\n    def colored?\n      @colored\n    end\n\n    def red_text(text)\n      return text.to_s unless colored?\n\n      \"\\001\\e[0;31m\\002#{text}\\001\\e[0m\\002\"\n    end\n\n    def blue_text(text)\n      return text.to_s unless colored?\n\n      \"\\001\\e[0;34m\\002#{text}\\001\\e[0m\\002\"\n    end\n\n    def bold_text(text)\n      return text.to_s unless colored?\n\n      \"\\001\\e[1m\\002#{text}\\001\\e[0m\\002\"\n    end\n\n    def main_separator\n      red_text(@separator)\n    end\n\n    def wait_separator\n      \"*\"\n    end\n\n    # Return the current Pry context\n    #\n    # When the Pry context is `\"main\"` or `\"nil\"`, use the application name from\n    # the JazzFingers config. Examples: \"(my_rails_app_name)\", \"(jazz_fingers)\".\n    #\n    # When in the context of an object instance, use the abbreviated object\n    # path. Example: \"(#<Pry::Prompt>)\", \"(#<RSpec::...::ClassName>)\"\n    #\n    # Fall back to the raw context provided by Pry.view_clip.\n    # Example: \"(Pry::Prompt)\"\n    def context(module_name = \"main\")\n      name =\n        case module_name\n        when \"main\", \"nil\"\n          @application_name\n        when OBJECT_INSTANCE\n          abbreviated_context(module_name)\n        else\n          module_name\n        end\n\n      blue_text(\"(#{name})\")\n    end\n\n    def line_number(pry)\n      if pry.respond_to? :input_ring\n        bold_text(pry.input_ring.size)\n      else\n        bold_text(pry.input_array.size)\n      end\n    end\n\n    # Abbreviate the object path in the given `object_label` string so the\n    # prompt doesn't overflow. Display only the root and leaf namespaces.\n    #\n    # Examples:\n    #   In:  #<Class1::Class2::Class3::Class4::Class5>\n    #   Out: #<Class1::...::Class5>\n    #\n    #   In:  #<Class1::Class2>\n    #   Out: #<Class1::Class2>\n    #\n    #   In:  #<NoPathJustASingleLongClassName>\n    #   Out: #<NoPathJustASingleLongClassName>\n    def abbreviated_context(object_label)\n      object_path = object_label[OBJECT_INSTANCE, 1]\n      object_path_components = object_path.split(\"::\")\n      return object_label if object_path_components.length <= 2\n\n      root, *_, leaf = object_path_components\n      \"#<#{root}::...::#{leaf}>\"\n    end\n\n    def template(module_name, pry, separator)\n      format(\n        \"%<ruby>s %<context>s[%<line>s] %<separator>s \",\n        ruby: RUBY_VERSION,\n        context: context(module_name),\n        line: line_number(pry),\n        separator: separator\n      )\n    end\n  end\nend\n"
  },
  {
    "path": "lib/jazz_fingers/version.rb",
    "content": "module JazzFingers\n  VERSION = '7.1.0'.freeze\nend\n"
  },
  {
    "path": "lib/jazz_fingers.rb",
    "content": "ENV['HOME'] ||= '/dev/null'\n\nrequire 'pry'\nrequire 'forwardable'\n\n# Pry's SimplePager hardcodes the Readline constant. Ruby 4.0 removed\n# the readline stdlib, so we mirror Pry's own load_readline fallback\n# and shim the constant when only Reline is available.\nbegin\n  require 'readline'\nrescue LoadError\n  require 'reline'\n  Readline = Reline unless defined?(Readline)\nend\n\nmodule JazzFingers\n  autoload :AMAZING_PRINT, 'jazz_fingers/amazing_print'\n  autoload :CodeRay, 'jazz_fingers/coderay'\n  autoload :Commands, 'jazz_fingers/commands'\n  autoload :Configuration, 'jazz_fingers/configuration'\n  autoload :Input, 'jazz_fingers/input'\n  autoload :Print, 'jazz_fingers/print'\n  autoload :Prompt, 'jazz_fingers/prompt'\n  autoload :VERSION, 'jazz_fingers/version'\n\n  class << self\n    extend Forwardable\n\n    def_delegators :config, :amazing_print?, :coolline?\n\n    def print\n      @print ||= Print.config\n    end\n\n    def prompt\n      @prompt ||=\n        Prompt.new(\n          colored: config.colored_prompt,\n          separator: config.prompt_separator,\n          application_name: config.application_name\n        )\n      @prompt.config\n    end\n\n    def input\n      @input ||= Input.config\n    end\n\n    def configure\n      yield @config ||= Configuration.new\n      setup!\n    end\n\n    def config\n      @config ||= Configuration.new\n    end\n\n    def setup!\n      Pry.prompt = prompt\n      Pry.input = input if JazzFingers.coolline?\n      Pry.config.should_load_plugins = false\n      Pry.editor = 'vi'\n      Pry.config.ls.separator = \"\\n\"\n      Pry.config.ls.heading_color = :magenta\n      Pry.config.ls.public_method_color = :green\n      Pry.config.ls.protected_method_color = :yellow\n      Pry.config.ls.private_method_color = :bright_black\n\n      JazzFingers::Commands.constants(false).each do |constant|\n        command = JazzFingers::Commands.const_get(constant)\n        Pry.config.commands.import(command)\n      end\n\n      if JazzFingers.amazing_print?\n        require 'amazing_print'\n\n        AmazingPrint.defaults = JazzFingers::AMAZING_PRINT\n        Pry.print = print\n      end\n\n      JazzFingers::CodeRay.setup!\n\n      true\n    end\n  end\nend\n"
  }
]