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

3660 commits

Author SHA1 Message Date
Kyrylo Silin
383f97e341 rubocop: fix offences of the Layout/EmptyLineBetweenDefs cop 2018-10-14 14:40:48 +08:00
Kyrylo Silin
e7f01818d3
Merge pull request from pry/rubocop-style-hash-syntax
rubocop: fix offences of the Style/HashSyntax cop
2018-10-13 03:20:08 +08:00
Kyrylo Silin
f33d82779a rubocop: fix offences of the Style/HashSyntax cop 2018-10-13 03:09:29 +08:00
Kyrylo Silin
4f121a6a07
Merge pull request from pry/rubocop-layout-end-alignment
rubocop: fix offences of the Layout/EndAlignment cop
2018-10-13 01:46:57 +08:00
Kyrylo Silin
ac9ddde444 rubocop: fix offences of the Layout/EndAlignment cop 2018-10-13 01:14:21 +08:00
Kyrylo Silin
6794ce504d
Merge pull request from pry/rubocop-layout-extra-spacing
rubocop: fix offences of the Layout/ExtraSpacing cop
2018-10-13 01:07:51 +08:00
Kyrylo Silin
4cc13f9a40 rubocop: fix offences of the Layout/ExtraSpacing cop 2018-10-13 00:54:00 +08:00
Kyrylo Silin
69c7b27f25
Merge pull request from pry/bright-default-removal
helpers/text: delete the 'bright_default' alias
2018-10-13 00:29:56 +08:00
Kyrylo Silin
21af0624d4 helpers/text: delete the 'bright_default' alias
Replaces https://github.com/pry/pry/pull/1692
(Remove the "default" method from `Pry::Helpers::Text`)

This alias serves no real purpose because `bold` is already superior: it's short
and understandable.
2018-10-13 00:11:17 +08:00
Kyrylo Silin
888e5e368b
Merge pull request from bambooengineering/handle_null_bytes_in_history
Gracefully handle (ignore) null bytes in history lines
2018-10-12 13:25:49 +08:00
Kyrylo Silin
88d0ab2cae
Merge pull request from pry/yardoc-check
travis: generate docs and fail if there are warnings
2018-10-11 02:49:35 +08:00
Kyrylo Silin
6035fc69ef README: remove sponsors
1. The links break the build because YARD cannot "resolve" them
2. Pry does not receive money from these companies for at least 4+ years
2018-10-11 02:39:24 +08:00
Kyrylo Silin
b303372f97 travis: generate docs and fail if there are warnings
The idea is extracted from https://github.com/pry/pry/pull/1720.

This ensures that documentation mistakes don't slip through the cracks in the
future.
2018-10-11 02:39:22 +08:00
Kyrylo Silin
30c6f3635b
Merge pull request from pry/pryrc-tweaks
Tweak documentation for pryrc
2018-10-11 00:53:28 +08:00
Kyrylo Silin
4bee7e368d Tweak documentation for pryrc
Since `~/.pryrc` was replaced by `$XDG_CONFIG_HOME` and `~/.config/pry/pryrc` in
https://github.com/pry/pry/pull/1609, we need to adjust some
documentation. `~/.pryrc` becomes simply `pryrc`.

I've also edited the wiki with this similar change.
2018-10-11 00:42:38 +08:00
Kyrylo Silin
d284dfbab8
Merge pull request from franklinyu/feat/config-file-path
Find configuration file in XDG Base Directory
2018-10-10 13:38:40 +08:00
Franklin Yu
a0be0cc7b2 Find configuration file in XDG Base Directory
Find configuration file in XDG Base Directory only if `PRYRC` is not
set, and `~/.pryrc` does not exist, therefore not confusing current
users. Note that cache file path is not modified.
2018-10-09 21:08:07 -04:00
Kyrylo Silin
528ff64806
Merge pull request from pry/1449-wtf-cause
commands/wtf,pry: add support for Exception#cause
2018-10-10 00:29:56 +08:00
Aleksandar Kostadinov
30cca64e5a commands/wtf,pry: add support for Exception#cause
Fixes  (support exceptions with cause)
Replaces 
2018-10-10 00:19:45 +08:00
Owen Stephens
3d7a11a676 Gracefully handle (ignore) null bytes in history lines
Fixes .

Readline is unable to add lines to its history that contain a null byte;
we should therefore avoid saving such lines to the history file, and
ignore any such lines that are already present in the file.
2018-10-09 13:29:44 +01:00
Kyrylo Silin
ef80932bc6
Merge pull request from pry/badge-master
README: update badges
2018-10-08 00:29:51 +08:00
Kyrylo Silin
12bb9f39ba README: add gem stat badges 2018-10-08 00:16:08 +08:00
Kyrylo Silin
6f0ee67411 README: update documentation badge 2018-10-08 00:15:26 +08:00
Kyrylo Silin
8198ddd82a README: update the Code Climate badge
Apparently, they've changed the URL. The old URL wasn't working.
2018-10-08 00:15:20 +08:00
Kyrylo Silin
9838ccad1a README: update travis badge
The old badge link seems to be outdated.
2018-10-08 00:07:57 +08:00
Kyrylo Silin
e49ba9284b
Merge pull request from pry/rbx-removal
spec/commands/edit: delete unwanted unlinking
2018-10-07 14:08:01 +08:00
Kyrylo Silin
1625d362cb spec/commands/edit: delete unwanted unlinking
This line was needed for Rubinius but since we dropped it, it serves no purpose.
2018-10-07 13:33:53 +08:00
Kyrylo Silin
baa29048cf
Merge pull request from pry/1775-rubinius-bye-bye
Drop support for Rubinius
2018-10-07 01:30:49 +08:00
Kyrylo Silin
743b905c81 Drop support for Rubinius
Fixes  (Drop support for Rubinius)

I am amazed how many hacks we've had just to support Rubinius. It feels good to
be able to remove them and reduce the complexity of the codebase.
2018-10-07 00:58:53 +08:00
Kyrylo Silin
a6428b2f43
Merge pull request from pry/spec-run-simplification
Rakefile: unit test with help of RSpec::Core::RakeTask
2018-10-06 23:48:02 +08:00
Kyrylo Silin
b9edf9d698 Rakefile: unit test with help of RSpec::Core::RakeTask
Commit a99861f1b1 broke some tests for me when I
try to run them locally. Example failures:

```
Failures:

  1) gist nominally logs in
     Failure/Error: expect(Pad.gist_calls[:login!]).not_to be_nil

       expected: not nil
            got: nil

  2) show-doc on modules show-doc -a messages relating to -a indicates...
     Failure/Error:
       raise CommandError, "No docs found for: #{
         obj_name ? obj_name : 'current context'

     Pry::CommandError:
       No docs found for: TestClassForShowSource
```

There's little reason to use our own task for specs since RSpec already provides
one. Switching to that deletes some old (likely unused) code and fixes the
failures for me. Win-win.
2018-10-06 23:33:57 +08:00
Kyrylo Silin
9d32f25a69
Merge pull request from pry/rubocop
Add Rubocop
2018-10-06 22:18:46 +08:00
Kyrylo Silin
fe51ec27fb travis: run rubocop checks 2018-10-06 20:10:23 +08:00
Kyrylo Silin
a5c0718731 rubocop: generate config
The config ignores all violations for now. We will be fixing them at our own
pace.
2018-10-06 20:07:27 +08:00
Kyrylo Silin
9ffa460548 Gemfile: add rubocop 0.59.2 and lock it
Rubocop is a really nice tool when configured properly. A lot of default rules
are very opinionated but the good thing is that it's very easy to disable them.
With help of Rubocop I'd like to improve the quality of Pry's code.
2018-10-06 20:07:25 +08:00
Kyrylo Silin
e5756706d0
Merge pull request from DamienRobert/fix_indent
repl.rb: guard against negative overhang
2018-10-04 21:25:21 +08:00
Kyrylo Silin
7e4a72e7b4
Merge pull request from pry/1452-show-source-fix
commands/show_source: handle when source is nil but comment exists
2018-10-04 21:15:12 +08:00
Damien Robert
80decc7c57 pry_repl_spec: test for previous overhang fix 2018-10-03 22:43:36 +02:00
Damien Robert
05ac4fc5e5 repl.rb: guard against negative overhang
When copy pasting into pry a code like this
~~~ ruby
foo do
	bar #note the tab here
done
~~~
then `@indent.indent(val)` replace the tab by two spaces, and so
`overhang = original_val.length - indented_val.length` is negative,
which yields an Exception in `whitespace = ' ' * overhang`.

Guard against this by taking the max with 0.
2018-10-03 22:09:58 +02:00
Kyrylo Silin
e252aacf91 commands/show_source: handle when source is nil but comment exists
Fixes https://github.com/pry/pry/issues/1452.
($ RuntimeError.exception fails)

Alternative to https://github.com/pry/pry/pull/1453.
2018-10-04 03:46:33 +08:00
Kyrylo Silin
943a964c64 CHANGELOG: delete unwanted bracket 2018-10-01 21:27:37 +08:00
Kyrylo Silin
d9a6a79d06 CHANGELOG: mention 2018-10-01 21:26:40 +08:00
Kyrylo Silin
9e74d5967c
Merge pull request from MatthiasWinkelmann/realpath
Check for existance of cli_options_file before calling realpath()
2018-10-01 21:25:50 +08:00
Matthias Winkelmann
1feb395903
Check for existance of cli_options_file before calling realpath() 2018-10-01 11:16:28 +02:00
Robert
28a56c4a9f Add 'Data' as a deprecated constant () 2018-10-01 12:51:20 +08:00
Kyrylo Silin
9956502447
Merge pull request from dnamsons/patch-1
Update year in LICENSE
2018-10-01 12:41:45 +08:00
Kyrylo Silin
70564589ff CHANGELOG: mention 2018-10-01 12:40:50 +08:00
Damien Robert
975fd746db PluginManager#load_cli_options: use the realpath ()
* PluginManager#load_cli_options: use the realpath

Since ruby 2.5, `require 'foo'` will use the realpath of the file
corresponding to foo.rb. However `require '/absolute/path/to/foo.rb'`
won't use the realpath.

So when $GEM_HOME contains a symlink (ie it is not the realpath), when a
pry plugin is loaded, by `activate!`:
    require gem_name if !active?
the real_path of `gem_name` is used.

But then in load_cli_options:
    cli_options_file = File.join(spec.full_gem_path, "lib/#{spec.name}/cli.rb")
    require cli_options_file if File.exist?(cli_options_file)
since the path given is absolute, it will be used directly without realpath.

This means that cli.rb may potentially be required twice (once via its realpath if the plugin requires it, the other via its $GEM_HOME path when required by `load_cli_options`), which could raise some errors.

Fix this by using the realpath in load_cli_options too.

Revision r59984 in ruby 2.5 introduced the use of realpath for load paths,
and it was backported to version 2.4 in the minor revision 2.4.4. So
only use the realpath ourselves for ruby versions above or equal to
2.4.4.
2018-10-01 12:18:28 +08:00
Dāvis Namsons
4c5a391e79 Update year in LICENSE 2018-09-30 19:48:28 +03:00
Kyrylo Silin
c180f2262d CHANGELOG: mention 2018-09-22 15:53:26 +08:00