| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
|
|
|
| |
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
|
|
|
| |
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Sometimes I have a failing test, because it can't find Options constant.
Let's help Ruby in its hard job a bit.
Also, reformulate some comments and convert " to ' in some places.
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
I also fucked up one of cirwin's commits for some reason. It's a tiny
one, so I'll just re-commit it. I'm sorry for this.
This commit should finalise merging/rebasing from master. I had some
troubles when I was trying to combine all the shit together
(because Pry has undergone many changes since the time I started off
my work on plugin command).
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
|
|
|
| |
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Staight to the point:
pry(main)> plugin uninstall stack_explorer
Gem `pry-stack_explorer` uninstalled.
Also, add command helper method in order to capture output stream from
`Gem`. In this particular case I capture default "uninstall succeed"
message from RubyGems, because I want to use my own.
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The interesting part is `ClassCommand::Options#command?` method.
TL;DR
-----
It's the same as `Slop::Commands#present?`.
Details
-------
Usually, when you use `Slop::Commands` you have `#present?` method,
which checks for a command presence. But `Options` class uses
`#command?` method to do the same (this is a just a wrapper around
Slop's `#present?`). The reason is that I don't want to refactor all the
existing code just for one method name change. Also, it reads better.
You may ask how to use `install`. That is a very good question. The
answer:
pry(main)> plugin install doc stack_explorer
This command will install "pry-doc" and "pry-stack_explorer" gems.
Internally, it uses "gem-install" command from Pry.
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
|
|
|
|
|
| |
Do not create unwanted Proc, because there is no real reason for it.
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
|
|
|
|
|
|
|
| |
There were some changes in master that affect current code. Make a
couple of small amendments to feature/plugin_manager branch so the tests
pass again.
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
|
|
|
|
|
|
| |
Follow the new convention, where every command should be in its own
separate file.
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
|
|
|
| |
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"plugin status" subcommand shows plugin statuses (active or inactive).
Add two options to this subcommand: `--active` and `--inactive`. By
default, `plugin status` will display all installed plugins. With help
of these options a user can choose, which type of plugins wants to see.
For example:
pry(main)> plugin status --active
Active Plugins:
--
debundle
rails
Also, make all newly initialized plugins inactive by setting
`self.active` to `false` (currently the default value is `nil`).
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
|
|
|
|
|
|
| |
Include the headers of `plugin list` and `plugin list -r` into
stagger_output.
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
|
|
|
| |
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Lots of stuff happens here.
First of all, change the value of `PRY_PLUGIN_PREFIX` constant from
Regexp to String, because String interpolates better.
Add `RemotePlugin` struct, which represents remote Pry plugins and
carries information about them.
Next, add `@remote_plugins` ivar to `PluginManager`. This variable is an
`Array`, which contains the list of remote plugins (instances of
`RemotePlugin`). Refactor `PluginManager#locate_plugins`, so it supports
detection of remote plugins (basically it's just a dispatcher method).
Make `PluginManager` fetch Pry plugins through RubyGems API.
Last but not least, add `PluginManager.show_remote_plugins`, which forms
a nice list of plugins with their dependencies.
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Create `ClassCommand::Options` class, which ties up sub commands and
default options together.
Let's consider the command `food make --tea`. `food` is a command,
`make` is a sub command and `--tea` is an option of `make` sub command.
We can access `--tea` via `opts[:make][:tea].
Also, we can check the freshness of our food like so: `food --freshness`.
`--freshness` is a default option. We can access it like so:
`opts.freshness?` or `opts[:freshness]`.
Add unit tests for `ClassCommand::Option` and some other tests that
reflect the additions.
Finally, document everything and fix different typos in the existing
documentation.
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
|
|
|
|
|
| |
Relocate it to `test/test_helpers` directory
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
|
|
|
|
|
|
| |
Also, create `test/test_helpers` directory and place a new file in it:
`test_text.rb` with tests for `wrap` method.
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
|
|
|
| |
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add `plugin` command and add `-l` aka `--list` switch to it. It allows
to display the list of all intalled Pry plugins.
Also, change the `PluginManager.show_installed_plugins` method a little
bit: it takes Hash parameter instead of Array one.
Last but not least, adjust `--installed-plugins` switch of Pry to that
method change.
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
First of all, add `PluginManager.show_installed_plugins` method. The
body of this method is taken from `--installed-plugins` code, which
means that it still displays the list of all installed plugins.
Secondly, use `PluginManager.show_installed_plugins` in
`--installed-plugins` body instead of the old code.
This change is needed, because we want to invoke `--installed-plugins`
from other place of the program and we don't want to repeat ourselves.
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
| |
|
|
|
|
| |
1 gem installed to use it
|
| |
|
|
|
|
| |
This reverts commit 2e8881f59e2a9b2879194490bcd93cde4926fc22.
|
|
|
|
|
|
|
| |
Fix issue #743 (pager gives warnings `Missing filename ("less --help"
for help)`)
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
|
|
|
|
| |
This reverts commit f937bb6097c008c1bc0ab7740d9df1c9a99aab21.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This is working around (another) brokenness in jruby 1.6.8s splat
handling in ruby 1.9 mode; but I figure that now jruby 1.7 is out,
we can not bother fixing it.
|
| |
|
|\ |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
OHAI LEAKY ABSTRACTIONS
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This simplifies the contract of Pry.config.print which makes it easier to use
in other places that we want to output a value, like ls -l.
If desired you can stil remove the => by setting Pry.config.output_prefix = ''
in your ~/.pryrc
|