summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* spec/commands/show_doc: test against a different commandrandomize-testsKyrylo Silin2019-06-091-1/+1
| | | | | | 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/editor: make specs order-independent (and sturdier)Kyrylo Silin2019-06-091-5/+12
|
* spec_helper: randomize testsKyrylo Silin2019-06-091-0/+2
|
* Merge pull request #2058 from pry/config-spec-fixKyrylo Silin2019-06-091-2/+6
|\ | | | | spec/config: fix flaky test
| * spec/config: fix flaky testKyrylo Silin2019-06-091-2/+6
|/ | | | | | 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.
* Merge pull request #2057 from pry/env-key-helperKyrylo Silin2019-06-0915-50/+101
|\ | | | | Add Pry::Env and use where it makes sense
| * Use Pry::Env where it makes senseKyrylo Silin2019-06-0912-50/+56
| |
| * Add Pry::EnvKyrylo Silin2019-06-093-0/+45
|/ | | | Env is a helper module to work with environment variables.
* Merge pull request #2056 from aeter/masterKyrylo Silin2019-06-094-13/+31
|\ | | | | Close #2054 - prefer XDG_* paths (if set)
| * Close #2054 - prefer XDG_* paths (if set)A. Nackov2019-06-054-13/+31
|/ | | | | | | | | 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.
* MemoizedValue memoizes nil results (#2053)Josh Cheek2019-06-032-4/+18
| | | | I moved the existing `subject` into the test because it didn't make sense for the second test I added.
* Fix tests that fail based on user's environment (#2047)Josh Cheek2019-06-021-10/+18
| | | | | 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.
* Merge pull request #2048 from JoshCheek/fix-test-output-clobbering-itselfKyrylo Silin2019-06-011-1/+1
|\ | | | | REPL prints to the configured output, not directly to $stdout
| * REPL prints to the configured output, not directly to $stdoutJosh Cheek2019-05-291-1/+1
| |
* | Merge pull request #2050 from JoshCheek/remove-rspec-shouldKyrylo Silin2019-06-017-41/+32
|\ \ | | | | | | Remove all remaining `.should`s from the tests
| * | Remove all remaining `.should`s from the testsJosh Cheek2019-05-307-41/+32
| |/
* | Merge pull request #2051 from vaidehijoshi/remove-poemRyan Fitzgerald2019-05-311-10/+0
|\ \ | |/ |/| Remove exclusionary easter egg command
| * Remove exclusionary easter egg commandvaidehijoshi2019-05-311-10/+0
|/ | | | See issue #2049 for more details.
* Merge pull request #2046 from pry/test-suite-silence-warningsKyrylo Silin2019-05-282-1/+4
|\ | | | | spec/pry_defaults: silence unwanted deprecation warnings
| * spec/pry_defaults: silence unwanted deprecation warningstest-suite-silence-warningsKyrylo Silin2019-05-282-1/+4
|/
* Merge pull request #2045 from pry/1991-output-winsize-fixKyrylo Silin2019-05-2614-112/+276
|\ | | | | Merge Pry::Terminal with Pry::Output
| * Merge Pry::Terminal with Pry::OutputKyrylo Silin2019-05-2614-112/+276
|/ | | | | | | | | | | | | | | | | | | | 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.
* Merge pull request #2043 from pry/output-refactoringKyrylo Silin2019-05-262-12/+207
|\ | | | | Refactor Pry::Output and add tests
| * Add unit tests for Pry::OutputKyrylo Silin2019-05-261-0/+197
| |
| * output: assign @color inside initializeKyrylo Silin2019-05-261-6/+4
| | | | | | | | Just a shortcut, so we don't expose the whole pry_instance to all of the class.
| * output: rename 'boxed_io' to 'output'Kyrylo Silin2019-05-261-6/+6
|/ | | | | | 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).
* Merge pull request #2042 from pry/terminal-refactoringKyrylo Silin2019-05-196-13/+13
|\ | | | | terminal: rename 'bang' methods to normal ones
| * terminal: rename 'bang' methods to normal onesKyrylo Silin2019-05-196-13/+13
|/ | | | | | 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.
* Merge pull request #2037 from pry/1876-wtf-codeKyrylo Silin2019-05-123-4/+77
|\ | | | | commands/wtf: add the --code flag
| * commands/wtf: add the --code flagKyrylo Silin2019-05-123-4/+77
| | | | | | | | Fixes #1876 (Make `wtf` show code)
* | commands/wtf: fix typo in bannerKyrylo Silin2019-05-111-1/+1
|/
* Merge pull request #2036 from pry/wtf-refactoringKyrylo Silin2019-05-112-50/+176
|\ | | | | Refactoring of 'wtf' and its tests
| * commands/wtf: refactor to avoid duplicationKyrylo Silin2019-05-111-26/+27
| |
| * commands/wtf_spec: refactor unit testsKyrylo Silin2019-05-111-24/+149
|/ | | | | 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.
* Merge pull request #2035 from pry/config-ruby-warning-fixKyrylo Silin2019-05-112-4/+1
|\ | | | | Resolve config warnings about redefined method
| * Resolve config warnings about redefined methodKyrylo Silin2019-05-112-4/+1
|/ | | | | | | | 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/`).
* Merge pull request #2034 from pry/1824-frozen-string-literalKyrylo Silin2019-05-08221-72/+522
|\ | | | | Fix offences of the Style/FrozenStringLiteralComment cop
| * Fix offences of the Style/FrozenStringLiteralComment copKyrylo Silin2019-05-0823-72/+76
| | | | | | | | | | Fixes #1824 (Enabling `# frozen_string_literal: true` in `~/.pryc` crashes most operations)
| * rubocop: enable the Style/FrozenStringLiteralComment copKyrylo Silin2019-05-08221-0/+446
|/ | | | This will greatly ease Pry support on Ruby 3.0 (when it's out).
* Merge pull request #2032 from pry/control-d-ruby-3-friendlyKyrylo Silin2019-05-056-18/+125
|\ | | | | control_d_handler: don't mutate eval_string within the handler
| * control_d_handler: don't mutate eval_string within the handlerKyrylo Silin2019-05-046-18/+125
|/ | | | | | | | | | | | | | | | | 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.
* Merge pull request #2033 from pry/pry-warning-level-fixKyrylo Silin2019-05-042-6/+4
|\ | | | | warning: print file and line of the calling frame
| * warning: print file and line of the calling frameKyrylo Silin2019-05-042-6/+4
|/ | | | | | 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).
* Merge pull request #2031 from pry/warning-moduleKyrylo Silin2019-05-045-14/+44
|\ | | | | Add Pry::Warning
| * Add Pry::WarningKyrylo Silin2019-05-045-14/+44
| | | | | | | | | | | | 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.
* | Merge pull request #2029 from pry/rubocop-access-modifier-declarationsKyrylo Silin2019-05-041-107/+105
|\ \ | |/ |/| pry_instance: fix Style/AccessModifierDeclarations cop offences
| * pry_instance: fix Style/AccessModifierDeclarations cop offencesKyrylo Silin2019-05-041-107/+105
|/
* Merge pull request #2027 from pry/rc-file-attributeKyrylo Silin2019-05-036-18/+68
|\ | | | | config: add `rc_file` that allows specifying `pryrc` file
| * config: add `rc_file` that allows specifying `pryrc` fileKyrylo Silin2019-05-036-18/+68
|/ | | | | | 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.
* Merge pull request #2026 from pry/2006-show-source-formatting-fixKyrylo Silin2019-05-022-2/+2
|\ | | | | commands/show_info: fix formatting error for C method header