summaryrefslogtreecommitdiff
path: root/lib/pry/commands
Commit message (Collapse)AuthorAgeFilesLines
* Delete the 'simple-prompt' commandprompt-commandsKyrylo Silin2018-11-041-24/+0
| | | | It's duplicative since you can use `change-prompt simple`.
* commands/change_prompt: incorporate 'list_prompts' functionalityKyrylo Silin2018-11-042-36/+28
| | | | Fixes #1829 (Merge `list-prompts` and `change-prompt` into one command)
* prompt: add basic API for adding promptsKyrylo Silin2018-11-044-21/+16
| | | | Fixes #1836 (Add an API for adding new prompts)
* Deprecate Pry::Platform and introduce Pry::Helpers::PlatformKyrylo Silin2018-11-025-5/+5
| | | | | | `Pry::Platform` really looks like a helper and therefore should be defined as one. Invoking `Pry::Platform` emits a warning now. Users are encouraged to use `Pry::Helpers::Platform`.
* Move prompt related code from pry.rb to prompt.rbKyrylo Silin2018-10-282-4/+4
| | | | | It makes a lot more sense to keep these procs under the `Pry::Prompt` namespace than `Pry`, which is already heavily populated by other various things.
* rubocop: fix offences of the Lint/AssignmentInCondition copKyrylo Silin2018-10-212-2/+2
|
* ring: rewrite the class to improve APIKyrylo Silin2018-10-212-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the Ring class is written with help of Hash as backend store. According to the comments, the implementation should behave like a circular buffer, however it doesn't. Upon reaching maximum capacity Ring doesn't replace old elements but keeps writing to new cells, deleting old cells, so that the hash contains `nil` entries. The new implementation is based on Array and seems to be closer to the actual Ring. Older elemens get overwritten with newer ones. This class also includes Enumerable, however none of our APIs take advantage of it, so it seems like an overkill. There was also a problem with with this API because of the above-mentioned nils. For example, if the ring exceeds its maximum size, then callin `Enumerable#first` on it returns `nil`. The new implementation deals with this with removal of Enumerable. The `#[]` syntax is preserved, and now `ring[0]` returns an actual element instead of `nil`. In case users need the Enumerable functionality, they can call `Ring#to_a` to build the array, which supports the wanted methods. As for the speed, the new implementation is: * slower overall because it's thread-safe * faster without mutexes for `#<<` * slower without mutexes for `#[]` Benchmark for old implementation: ``` Warming up -------------------------------------- Ring#<< 223.451k i/100ms Ring#[] 2.837k i/100ms Calculating ------------------------------------- Ring#<< 223.157B (± 3.4%) i/s - 778.097B Ring#[] 82.485M (± 9.4%) i/s - 402.602M in 4.957792s ``` Benchmark for this implementation: ``` Warming up -------------------------------------- Ring#<< 211.587k i/100ms Ring#[] 1.974k i/100ms Calculating ------------------------------------- Ring#<< 211.385B (± 2.8%) i/s - 698.439B Ring#[] 40.292M (±17.0%) i/s - 190.069M in 4.971195s ``` The benchmark: ```rb require './lib/pry' require 'benchmark/ips' Benchmark.ips do |x| empty_ring = Pry::Ring.new(100) populated_ring = Pry::Ring.new(100) 150.times { |i| populated_ring << i } x.report("Ring#<<") do |times| empty_ring << times end x.report("Ring#[]") do |times| populated_ring[0] populated_ring[1] populated_ring[2] populated_ring[-1] populated_ring[-2] populated_ring[-3] populated_ring[1..2] populated_ring[-2..-1] populated_ring[-2..3] populated_ring[0..-1] populated_ring[2..-1] populated_ring[-1..10] populated_ring[-1..0] populated_ring[-1..1] end end ```
* Rename '{input/output}_array' to '{input/output}_ring'Kyrylo Silin2018-10-204-10/+10
|
* rubocop: fix offences of the Style/MultilineTernaryOperator copKyrylo Silin2018-10-203-13/+14
|
* ommands/ls/formatter,helpers/table: pass local Pry configKyrylo Silin2018-10-161-1/+1
| | | | | | | | | | | | | | | | | Replaces #1713 (Pry local config The following methods take a third required argument, an instance of Pry) This fulfills queries to `_pry_.config` in: * Pry::Helpers.tablify * Pry::Helpers.tablify_to_screen_width * Pry::Helpers.tablify_or_one_line Unlike #1713 this PR doesn't introduce any breaking changes thanks to the default parameter value trick, *except* the `Table#new` signature. Overall, this brings the code in line with how the rest of Pry works.
* rubocop: fix offences of the Lint/StringConversionInInterpolationKyrylo Silin2018-10-161-1/+1
|
* Fix rubocop empty line after guard clause style violationsArlandis Word2018-10-1410-0/+13
|
* commands/watch_expression: add a todo to fix arguments laterKyrylo Silin2018-10-141-0/+2
| | | | | | b031df2f2f5850ee6e9018f33d35f3485a9b0423 added this command but never made use of this variable. The method is being passed an argument but it never uses it. Why? Idk, needs investigation.
* commands/import_set: add a comment to figure out what it does laterKyrylo Silin2018-10-141-0/+1
| | | | | This command is quite obscure: no docs and the parameter it expects is not used in the method. For simplicity, I am leaving the comment to check later.
* commands/amend_line: refactor 'amended_input'Kyrylo Silin2018-10-141-3/+2
| | | | | | The way it's written is still a little bit confusing, however for simplicity of https://github.com/pry/pry/pull/1801 I am leaving this as is and resolving the parameter issue only.
* rubocop: fix offences of the Lint/UnusedMethodArgument copKyrylo Silin2018-10-144-4/+4
|
* rubocop: fix offences of the Layout/EmptyLineBetweenDefs copKyrylo Silin2018-10-143-2/+1
|
* rubocop: fix offences of the Style/HashSyntax copKyrylo Silin2018-10-1323-76/+76
|
* rubocop: fix offences of the Layout/EndAlignment copKyrylo Silin2018-10-132-7/+3
|
* rubocop: fix offences of the Layout/ExtraSpacing copKyrylo Silin2018-10-136-11/+12
|
* commands/wtf,pry: add support for Exception#causeAleksandar Kostadinov2018-10-101-0/+13
| | | | | Fixes #1449 (support exceptions with cause) Replaces #1525
* commands/show_source: handle when source is nil but comment exists1452-show-source-fixKyrylo Silin2018-10-042-4/+13
| | | | | | | Fixes https://github.com/pry/pry/issues/1452. ($ RuntimeError.exception fails) Alternative to https://github.com/pry/pry/pull/1453.
* Add 'Data' as a deprecated constant (#1731)Robert2018-10-011-1/+1
|
* Push full edit command contents to history, enabling up-and-enter actionJack Kinsella2018-03-251-0/+1
|
* Add a new command, "clear-screen", that clears the content of the (#1723)Robert2017-12-261-0/+14
| | | screen Pry is running in regardless of platform (Windows or UNIX-like).
* add gem-stat command … (#1707)r-obert2017-11-181-0/+81
| | | | | | | | | | | | thanks to @dannytatom for the original gem-stats rubygems plugin, which inspired this Pry command. it returns some general statistics about a rubygem when given a name. note that rubygems rate limits the requests, and thanks to that this command can be a "Fail Whale" although the error is handled gracefully. This commit depends on pull request: https://github.com/pry/pry/pull/1701
* Deprecate Pry::Command#text. Please use black(), white(), etc directly (#1701)r-obert2017-11-1615-34/+35
| | | | instead (as you would with helper functions from BaseHelpers and CommandHelpers)
* :warning: ambiguous first argument; put parentheses or a space even after ↵Akira Matsuda2017-10-201-1/+1
| | | | `/' operator (#1667)
* add 'JavaPackageModuleTemplate' as a deprecated constant (jruby).robert2017-09-201-0/+1
|
* whereami?!?!?!?! fix #1597r-obert2017-07-151-0/+1
|
* use Integer instead of `1.class`robert2017-06-131-1/+1
|
* add TimeoutError to the listrobert2017-06-041-1/+1
|
* hide deprecated constants from `ls` output by default.robert2017-06-042-2/+14
|
* fix 2.4 warning in edit command and specs about deprecated constant (Fixnum)robert2017-06-031-1/+1
|
* Remove exclamation point from #no_definition_messageWaldyr2016-04-021-1/+1
| | | | Add \n in the end of expected error message
* Merge pull request #1484 from bronzdoc/feature/add_histignoreKyrylo Silin2016-02-121-2/+2
|\ | | | | Feature/add histignore
| * Comment is not needed anymore, since the last command could be anything nowbronzdoc2016-02-111-1/+0
| |
| * Filter historybronzdoc2015-10-251-2/+3
| |
* | Fix typoJake Worth2015-12-091-1/+1
|/
* display an error message when cat is invoked without arguments.egwspiti2015-09-031-2/+2
|
* improve error message; add testcase for #1461strcmp2015-08-191-1/+1
|
* Merge branch 'ri-command-requires-argument' of ↵strcmp2015-08-191-0/+4
|\ | | | | | | https://github.com/dalizard/pry into dalizard-ri-command-requires-argument
| * Pry::Command::Ri requires an argumentDimitar Haralanov2015-08-181-0/+4
| | | | | | | | | | When the ri command is called within a pry session, it will prompt you to supply an argument if none is passed.
* | fix namespace typoWolfgang Teuber2015-06-221-1/+1
| |
* | shell_command: simplify the return conditionsKyrylo Silin2015-06-171-3/+1
| |
* | Refactor CDPATH and its testsKyrylo Silin2015-06-171-21/+28
| | | | | | | | The original code was confusing and had incompatible style.
* | Test added for .cd taking the CDPATH into account.Chr. Clemens Lee2015-06-171-7/+15
| |
* | Shell command .cd takes the environment's CDPATH variable into account.Chr. Clemens Lee2015-06-171-0/+13
| |
* | Changes deprecated ‘File.exists’ to ‘File.exist’Travis Yoder2015-05-102-2/+2
| |
* | Revert "Alias whereami to pwd"revert-1404-add-pwdJohn Mair2015-04-011-1/+0
| |