1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00
Commit graph

27 commits

Author SHA1 Message Date
André Luis Leal Cardoso Junior
c17235896c Skip spec/pry_repl_spec.rb spec on windows 2022-03-05 21:49:48 -03:00
André Luis Leal Cardoso Junior
8e8f2d53d6 Fix RegexpError: premature end of char-class 2020-10-05 21:57:30 -03:00
Kyrylo Silin
18c45d26c5 rubocop: enable the Style/FrozenStringLiteralComment cop
This will greatly ease Pry support on Ruby 3.0 (when it's out).
2019-05-08 00:13:17 +03:00
Kyrylo Silin
e5556a2be8 Refactor Config
Fixes #1843 (Rework the Pry config)

There are a few breaking changes. They are mostly minor, so I decided not to
indroduce deprecations because it will considerable slow things down.

Key changes:

* `Pry.lazy` was replaced with `Pry::Configuration::LazyValue`

  The config accepts three values now `LazyValue`, `MemoizedValue` and simply
  `Value`. The main difference is that:
    - `Value` is any value, including procs (so that an option returns a raw
      proc)
    - `LazyValue` is a proc that is call on every invocation of an option
    - `MemoizedValue` is a value that is called only once (and then the option
      always returns the return value of the )

* `Pry.config.history` was a meta-option that held suboptions. However, the new
  config doesn't permit that (unless you know what you do)

  Instead, we introduce a few options. For example:
    - `Pry.config.history.histignore` becomes `Pry.config.history_ignorelist`
    - `Pry.config.history.file` becomes `Pry.config.history_file`
    - and so on

  This was done so we can simplify configuration merging. Inlining option makes
  configuration implementation simpler, without losing much. The rule is that
  you want to keep your options under your prefix (if you are a
  plugin). Therefore, say, `Pry.config.pry_rescue.*` should be
  `Pry.config.pry_rescue_*` if you need merging.

The rest should behave in a similar fashion (and I rely heavily on our test
suite to claim so).
2019-05-02 00:10:37 +03:00
Kyrylo Silin
07de304553 rubocop: fix Naming/HeredocDelimiterNaming cop 2019-03-24 15:36:06 +02:00
Kyrylo Silin
475b01da9b Rename '_pry_' to 'pry_instance'
Although `_pry_` is a well-established name, it is confusing. `pry_instance` is
a clearer name (arguably the best name). This change was dictated by Rubocop but
I support it. Therefore, I decided to do it, but I realise it's a big change.

`Pry::Command` deprecates `_pry_` and emits a warning. This seems to be the only
place where `_pry_` is used publicly.

Another place where it may affect the user is the sticky locals area. I don't
think it will be a big issue there, though.
2019-03-23 00:54:39 +02:00
Kyrylo Silin
080d2b0b3a rubocop: fix offences of the Style/SingleLineMethods cop 2019-03-02 15:42:52 +02:00
Kyrylo Silin
e61354693f Add .rspec and require 'helper' from there
Just discovered this nice feature of RSpec where it can load all files for
us. Works with `bundle exec rake` and `bundle exec rspec spec/file_spec.rb`,
which covers all use cases.
2018-11-18 14:04:44 +08:00
Kyrylo Silin
04d4f424e3 rubocop: fix offences regarding spaces
Fixes offences of the following cops:

* Layout/SpaceAroundEqualsInParameterDefault
* Layout/SpaceAroundOperators
* Layout/SpaceBeforeBlockBraces
* Layout/SpaceInsideBlockBraces
2018-11-04 17:34:24 +08:00
Kyrylo Silin
f33d82779a rubocop: fix offences of the Style/HashSyntax cop 2018-10-13 03:09:29 +08:00
Kyrylo Silin
4cc13f9a40 rubocop: fix offences of the Layout/ExtraSpacing cop 2018-10-13 00:54:00 +08:00
Damien Robert
80decc7c57 pry_repl_spec: test for previous overhang fix 2018-10-03 22:43:36 +02:00
strcmp
c27fe9c04d return false from #piping? when $stdout is not an IO. 2015-08-24 03:08:41 +01:00
Kyrylo Silin
dd92e2a359 Fix regression with respect to space prefixes
Fixes #1369 (Prefixing commands with a space is not working)

The regression was introduced by this commit:

  68bcca22a0

Since then the main logic for the REPL was hugely refactored. This
refactoring morphed the error into this commit:

  e020f8cecd

Sorry about this hacky solution.
2015-03-08 10:06:56 +02:00
Matijs van Zuijlen
96b61f14aa Fix some warnings 2015-01-23 14:03:36 +01:00
Robert Gleeson
74135c1890 allow for tests to be run with ease.
'bacon spec/config_spec.rb' instead of 'bacon -I spec spec/config_spec.rb'
2014-03-14 05:31:24 +01:00
Robert Gleeson
c3d79eb59f fix last fail. inherit StringIO 'output' from wrapped "Pry" in ReplTester. 2014-01-29 14:56:54 +01:00
Ryan Fitzgerald
eb150b71d7 Fix specs on rbx-2.1.0 2013-11-23 18:11:29 -08:00
WU Jun
3b36a998c5 Add tests for exception rescuing in REPL. 2013-03-26 21:23:13 +08:00
Conrad Irwin
8a23c9a8a7 Use correct_indent not auto_indent...
Prior to this change, when auto_indent was set to true for some tests,
the green dots would be cleared half-way through.

We should probably re-consider these options, but it seems useful to
explicitly disable ANSI code rewriting during specs while leaving
indentation mutating read lines (before this change, there was a bug
in REPL that did not manifest because auto_indent was false).
2012-12-28 16:06:54 -08:00
Ryan Fitzgerald
e82eaad134 Update existing pry_repl test 2012-12-23 22:06:06 -08:00
Ryan Fitzgerald
4b5d47cd60 Fix tester for nested-instance case 2012-12-23 19:58:18 -08:00
Ryan Fitzgerald
00c2fc935d Test command mutating eval_string instead of Ruby doing it
It probably isn't actually important to support Ruby mutating
eval_string.
2012-12-23 15:22:02 -08:00
Ryan Fitzgerald
4edafaee0f ReplTester API changes; add failing spec 2012-12-23 12:25:48 -08:00
Ryan Fitzgerald
3c6ffaf69c Slightly refactor REPL initialization 2012-12-23 00:08:40 -08:00
Ryan Fitzgerald
6ee0f4a32b Add integration tester, failing spec 2012-12-23 00:03:29 -08:00
Conrad Irwin
e020f8cecd Ensure running commands in multiline exprs works 2012-12-15 14:09:40 -08:00