Skip to content

Commit

Permalink
Add ppl grep command
Browse files Browse the repository at this point in the history
  • Loading branch information
henrycatalinismith committed Oct 12, 2013
1 parent a6de6f4 commit ecf3651
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/ppl/application/bootstrap.rb
Expand Up @@ -52,6 +52,12 @@ class Ppl::Application::Bootstrap
help
end

register :command_grep do
grep = Ppl::Command::External.new("grep", "git grep", "Execute 'git grep' in the address book directory")
grep.storage = storage_adapter
grep
end

register :command_init do
init = Ppl::Command::Init.new
init.storage = storage_adapter
Expand Down Expand Up @@ -187,6 +193,7 @@ class Ppl::Application::Bootstrap
suite.add_command command_bday
suite.add_command command_completion
suite.add_command command_email
suite.add_command command_grep
suite.add_command command_help
suite.add_command command_init
suite.add_command command_ls
Expand Down
9 changes: 9 additions & 0 deletions spec/ppl/application/bootstrap_spec.rb
Expand Up @@ -43,6 +43,12 @@
end
end

describe "#command_grep" do
it "should return a command" do
@bootstrap.command_grep.should be_a(Ppl::Application::Command)
end
end

describe "#command_help" do
it "should return a Ppl::Command::Help" do
@bootstrap.command_help.should be_a(Ppl::Command::Help)
Expand Down Expand Up @@ -437,6 +443,9 @@
it "should contain the 'email' command" do
@bootstrap.command_suite.find_command("email").should_not be nil
end
it "should contain the 'grep' command" do
@bootstrap.command_suite.find_command("grep").should_not be nil
end
it "should contain the 'init' command" do
@bootstrap.command_suite.find_command("init").should_not be nil
end
Expand Down

0 comments on commit ecf3651

Please sign in to comment.