| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
This test sometimes fails (depends on the order of execution of specs). This is
probably because `ls` is not always defined at the time of invocation. `help` is
guaranteed to exist because it's generated by Slop.
|
| |
|
| |
|
|\
| |
| | |
spec/config: fix flaky test
|
|/
|
|
|
|
| |
This spec was failing for me locally (but worked well on Circle). The reason
is that `XDG_CONFIG_HOME` is set for me and takes precedence. Therefore, the fix
would be to unset it for the test.
|
|\
| |
| | |
Add Pry::Env and use where it makes sense
|
| | |
|
|/
|
|
| |
Env is a helper module to work with environment variables.
|
|\
| |
| | |
Close #2054 - prefer XDG_* paths (if set)
|
|/
|
|
|
|
|
|
|
| |
References #2054
Using XDG_* paths (if set) with preference higher than the
home dir, for pry config and history files.
Testing: ran `bundle exec rspec`, observed the tests pass.
|
|
|
|
| |
I moved the existing `subject` into the test because it didn't make sense for the second test I added.
|
|
|
|
|
| |
These tests would fail on my machine.
I think it is because I have a ~/.pry_history file.
I modified them to not depend on the state of my machine.
|
|\
| |
| | |
REPL prints to the configured output, not directly to $stdout
|
| | |
|
|\ \
| | |
| | | |
Remove all remaining `.should`s from the tests
|
| |/ |
|
|\ \
| |/
|/| |
Remove exclusionary easter egg command
|
|/
|
|
| |
See issue #2049 for more details.
|
|\
| |
| | |
spec/pry_defaults: silence unwanted deprecation warnings
|
|/ |
|
|\
| |
| | |
Merge Pry::Terminal with Pry::Output
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #1991 (Pry in a non-stdin/stdout PTY uses incorrect window size on
non-JRuby platforms)
`Pry::Terminal` was built without custom outputs in mind. We would always assume
that `$stdout` is what the user wants. This contradicted the `output` config
option.
Thanks to `Pry::Output`, which we use internally, we can decorate the output
that the user passes us with "size" methods. If we do that, we get improved
output support for free, so that PTY's `slave` can be passed to Pry and would be
able to determine its size correctly (example from #1991).
I do suspect that there are still some gotchas. Some commands or portions of
code may still be assuming that `$stdout` is the only possible option. This has
to be addressed separately, in the scope of
https://github.com/pry/pry/issues/1988. The more tests we add, the easier it
will be to uncover those spots.
|
|\
| |
| | |
Refactor Pry::Output and add tests
|
| | |
|
| |
| |
| |
| | |
Just a shortcut, so we don't expose the whole pry_instance to all of the class.
|
|/
|
|
|
|
| |
Surely, `boxed_io` sounds way cooler than plain and boring `output` but I don't
think it helps for understanding the code. Although it *is* an IO object, we
treat it as output. Hence, it should be output (no boxes involved).
|
|\
| |
| | |
terminal: rename 'bang' methods to normal ones
|
|/
|
|
|
|
| |
To be perfectly honest, I have no idea why these methods have exclamation
marks. Maybe because they may require `io/console`? Even then, there's nothing
dangerous in this.
|
|\
| |
| | |
commands/wtf: add the --code flag
|
| |
| |
| |
| | |
Fixes #1876 (Make `wtf` show code)
|
|/ |
|
|\
| |
| | |
Refactoring of 'wtf' and its tests
|
| | |
|
|/
|
|
|
| |
Although this is more verbose now, it looks more like proper unit tests. The
tester API needs to be revamped because `tester.eval` is *not* unit testing.
|
|\
| |
| | |
Resolve config warnings about redefined method
|
|/
|
|
|
|
|
|
| |
I spotted "method redefined" warnings while working with Pry in another project,
which used `--warnings`. It would be nice to enable `--warnings` in RSpec,
however it's a bit tricky because our test suite has a lot of violations (on
purpose). We should strive to fix all possible warnings, though (especially
those that occur in `lib/`).
|
|\
| |
| | |
Fix offences of the Style/FrozenStringLiteralComment cop
|
| |
| |
| |
| |
| | |
Fixes #1824 (Enabling `# frozen_string_literal: true` in `~/.pryc` crashes most
operations)
|
|/
|
|
| |
This will greatly ease Pry support on Ruby 3.0 (when it's out).
|
|\
| |
| | |
control_d_handler: don't mutate eval_string within the handler
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a preparational step for #1824
(Enabling `# frozen_string_literal: true` in `~/.pryc` crashes most operations)
Alternative to https://github.com/pry/pry/pull/2030
(config: delete the `control_d_handler` option)
We had to jump a few hoops to change how the handler works. The problem is that
mutation is the default expected behaviour. Therefore, we had to change its
API. There's no need to pass `eval_string` because `pry_instance` already has it
as an attribute.
`config.control_d_handler` is a proxy proc, to preserve backwards compatibility
with users of old signature (one known user is Pry Byebug). The handler will
emit a warning if the old signature is used.
|
|\
| |
| | |
warning: print file and line of the calling frame
|
|/
|
|
|
|
| |
We want to print the calling frame, so we can point out who exactly triggered
it. The current behaviour is less useful (we print the line that called the
warning).
|
|\
| |
| | |
Add Pry::Warning
|
| |
| |
| |
| |
| |
| | |
Quite often, when we deprecate APIs, we want to print a warning. Such a warning
would be hard to track without a file and line location. We are trying to be a
good citizen and print warnings like Ruby does it.
|
|\ \
| |/
|/| |
pry_instance: fix Style/AccessModifierDeclarations cop offences
|
|/ |
|
|\
| |
| | |
config: add `rc_file` that allows specifying `pryrc` file
|
|/
|
|
|
|
| |
Keeping this in a constant makes it really hard to test. Moving it to the config
and making it configurable seems to be sensible. Now we have a new option and a
lot of tests.
|
|\
| |
| | |
commands/show_info: fix formatting error for C method header
|