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

7 commits

Author SHA1 Message Date
Kyrylo Silin
c2050dbb49 Make subclassed commands always carry all options
By options I mean the command options like `:listing`, `:shellwords`,
etc.

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
2012-12-27 13:29:28 +02:00
John Mair
9a279461c1 PryTestHelpers methods are now module_functions, included into Bacon::Context by default 2012-12-07 23:08:49 +01:00
John Mair
31a9578228 cleaned up lib/pry/test/helper.rb
* removed most historicla junk from lib/pry/test/helper.rb
* relocated recalcitrant junk to the local spec/helper.rb (this isn't exposed to 3rd parties)
2012-12-07 21:41:05 +01:00
Kyrylo Silin
8a39813708 Fix subcommands
A few things were missing. I had to add a new method and slightly adjust
ClassCommand#slop method. Without these changes subcommands doesn't work
properly.

Add some unit tests for subcommands.

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
2012-11-26 18:07:32 +02:00
Kyrylo Silin
30ec15ab1c Rename "sub_command" to "subcommand"
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
2012-11-23 13:56:58 +02:00
Kyrylo Silin
cf786881bb Extend ClassCommand so it can define sub commands
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>
2012-11-23 13:41:44 +02:00
☈king
848b6bdbeb Rename for tabcompletion-friendliness. 2012-11-15 18:59:51 -06:00
Renamed from test/test_command.rb (Browse further)