ppl 1.19.0 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/completions/bash +1 -1
- data/completions/zsh +1 -1
- data/lib/ppl/command/attribute.rb +3 -0
- data/lib/ppl/command/nick.rb +3 -0
- data/lib/ppl/format/address_book/nicknames.rb +3 -0
- data/lib/ppl/format/table.rb +3 -0
- data/lib/ppl.rb +1 -1
- data/ppl.gemspec +1 -1
- data/spec/ppl/command/attribute_spec.rb +9 -0
- data/spec/ppl/format/address_book/nicknames_spec.rb +7 -0
- data/spec/ppl/format/table_spec.rb +17 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2c1a083b23b90a24e6f81e381593c1ed37150e1
|
4
|
+
data.tar.gz: e8477cde9b1eec569179e8695c65da79878f5925
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6526a4a9e7a9aebfb8172736570852731ec890e15c5d74be9851a89c9a4f34c3599d0c10368252a038aafa6a7e4a8b6ca127821dd3e035b16af2cbc4d12969a0
|
7
|
+
data.tar.gz: a8abdf21b1ef7faea30160279c1fcf0e7ebf1e71138e1c8232ffdd2ea9b893a1b1773655e773cf7b77009cd653357a28e85cbe6dbf49ff5da4f839cb84600a47
|
data/completions/bash
CHANGED
@@ -15,7 +15,7 @@ _ppl()
|
|
15
15
|
# Complete nicknames
|
16
16
|
nick_cmds=([age]="" [bday]="" [email]="" [mv]="" [name]="" [nick]="" [org]="" [phone]="" [post]="" [rm]="" [show]="" [url]="")
|
17
17
|
if [[ $nick_cmds[${prev}] ]]; then
|
18
|
-
local nicknames=$(for x in `ppl nick | cut -d ':' -f 1
|
18
|
+
local nicknames=$(for x in `ppl nick --no-color | cut -d ':' -f 1`; do echo ${x} ; done )
|
19
19
|
COMPREPLY=( $(compgen -W "${nicknames}" -- ${cur}) )
|
20
20
|
return 0
|
21
21
|
fi
|
data/completions/zsh
CHANGED
@@ -27,6 +27,9 @@ class Ppl::Command::Attribute < Ppl::Application::Command
|
|
27
27
|
|
28
28
|
def list_attribute(input, output)
|
29
29
|
address_book = @storage.load_address_book
|
30
|
+
if input.options[:no_color]
|
31
|
+
@list_format.disable_colors!
|
32
|
+
end
|
30
33
|
output.line(@list_format.process(address_book))
|
31
34
|
true
|
32
35
|
end
|
data/lib/ppl/command/nick.rb
CHANGED
data/lib/ppl/format/table.rb
CHANGED
data/lib/ppl.rb
CHANGED
data/ppl.gemspec
CHANGED
@@ -28,6 +28,15 @@ describe Ppl::Command::Attribute do
|
|
28
28
|
@command.execute(@input, @output).should eq true
|
29
29
|
end
|
30
30
|
|
31
|
+
it "should disable color output if :no_color is set" do
|
32
|
+
@input.options[:no_color] = true
|
33
|
+
@storage.stub(:load_address_book).and_return(@address_book)
|
34
|
+
@list_format.should_receive(:disable_colors!)
|
35
|
+
@list_format.stub(:process)
|
36
|
+
@output.should_receive(:line)
|
37
|
+
@command.execute(@input, @output).should eq true
|
38
|
+
end
|
39
|
+
|
31
40
|
it "should show the full list of attributes for the given contact" do
|
32
41
|
@input.arguments.push("jdoe")
|
33
42
|
@storage.should_receive(:require_contact).and_return(@contact)
|
@@ -98,5 +98,22 @@ describe Ppl::Format::Table do
|
|
98
98
|
|
99
99
|
end
|
100
100
|
|
101
|
+
describe "#disable_colors!" do
|
102
|
+
it "should disable colors" do
|
103
|
+
@table.colors = {
|
104
|
+
"id" => "red",
|
105
|
+
"name" => "yellow",
|
106
|
+
"email" => "blue",
|
107
|
+
}
|
108
|
+
@table.add_row({
|
109
|
+
:id => 12345,
|
110
|
+
:name => "John Doe",
|
111
|
+
:email => "jdoe@example.org",
|
112
|
+
})
|
113
|
+
@table.disable_colors!
|
114
|
+
@table.to_s.should eq "12345 John Doe jdoe@example.org"
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
101
118
|
end
|
102
119
|
|