ppl 1.22.2 → 1.23.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +42 -0
- data/completions/bash +238 -15
- data/features/add.feature +2 -1
- data/features/bday.feature +8 -0
- data/features/email.feature +8 -1
- data/features/init.feature +2 -1
- data/features/ls.feature +10 -0
- data/features/mutt.feature +22 -0
- data/features/mv.feature +15 -0
- data/features/nick.feature +16 -0
- data/features/org.feature +8 -1
- data/features/phone.feature +18 -2
- data/features/rm.feature +13 -0
- data/features/step_definitions/ppl_steps.rb +51 -3
- data/features/url.feature +16 -0
- data/lib/ppl.rb +1 -1
- data/ppl.gemspec +1 -1
- metadata +9 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c8a86000f8071b266624cd2cb96c4ea0da0294a
|
4
|
+
data.tar.gz: f0a2f09b185c73029847e11b010cc81f5fe97d7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb44a9bf6207db1a1073b47f2e7fe22787b4f05e9d04987faabc473de6372ee35db3ae04c3b5bffa85817b4bd5fe8b5c060ce071faa231dbba14dc7752dae5f1
|
7
|
+
data.tar.gz: 487f408c4610193bbb135d0016cee82555ab0445b64645da7c072eb351d1ea32084173886eaecf44e41a9563f4276865f843348fe4ecce614a082daa619a29a8
|
data/Rakefile
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
|
2
|
+
task :build => [:build193, :build200]
|
3
|
+
task :build193 => [:ruby193, :spec, :features]
|
4
|
+
task :build200 => [:ruby200, :spec, :features]
|
5
|
+
|
6
|
+
task :features => [:disable_config] do
|
7
|
+
system "bundle exec cucumber"
|
8
|
+
end
|
9
|
+
|
10
|
+
task :spec do
|
11
|
+
system "bundle exec rspec"
|
12
|
+
end
|
13
|
+
|
14
|
+
task :ruby193 do
|
15
|
+
system "bash -lc 'rvm use 1.9.3'"
|
16
|
+
Rake::Task["spec"].reenable
|
17
|
+
Rake::Task["features"].reenable
|
18
|
+
end
|
19
|
+
|
20
|
+
task :ruby200 do
|
21
|
+
system "bash -lc 'rvm use 2.0.0'"
|
22
|
+
Rake::Task["spec"].reenable
|
23
|
+
Rake::Task["features"].reenable
|
24
|
+
end
|
25
|
+
|
26
|
+
task :disable_config do
|
27
|
+
pplconfig = File.expand_path("~/.pplconfig")
|
28
|
+
bkpconfig = File.expand_path("~/.pplconfig.bkp")
|
29
|
+
if File.exists? pplconfig
|
30
|
+
FileUtils.mv pplconfig, bkpconfig
|
31
|
+
end
|
32
|
+
at_exit { Rake::Task["enable_config"].invoke }
|
33
|
+
end
|
34
|
+
|
35
|
+
task :enable_config do
|
36
|
+
pplconfig = File.expand_path("~/.pplconfig")
|
37
|
+
bkpconfig = File.expand_path("~/.pplconfig.bkp")
|
38
|
+
if File.exists? bkpconfig
|
39
|
+
FileUtils.mv bkpconfig, pplconfig
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
data/completions/bash
CHANGED
@@ -1,25 +1,248 @@
|
|
1
|
-
|
1
|
+
__ppl()
|
2
2
|
{
|
3
|
-
local cur prev opts nick_cmds base
|
4
|
-
COMPREPLY=()
|
5
|
-
cur="${COMP_WORDS[COMP_CWORD]}"
|
6
|
-
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
7
3
|
|
8
|
-
|
9
|
-
|
10
|
-
if [[ ${prev} == "ppl" ]]; then
|
11
|
-
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
|
4
|
+
if __ppl_needs_command_name; then
|
5
|
+
COMPREPLY=($(__ppl_suggest_command_name))
|
12
6
|
return 0
|
13
7
|
fi
|
14
8
|
|
15
|
-
|
16
|
-
|
17
|
-
if [[ $nick_cmds[${prev}] ]]; then
|
18
|
-
local nicknames=$(for x in `ppl nick --no-color | cut -d ':' -f 1`; do echo ${x} ; done )
|
19
|
-
COMPREPLY=( $(compgen -W "${nicknames}" -- ${cur}) )
|
9
|
+
if __ppl_needs_contact_id; then
|
10
|
+
COMPREPLY=($(__ppl_suggest_contact_id))
|
20
11
|
return 0
|
21
12
|
fi
|
13
|
+
|
14
|
+
if __ppl_needs_contact_email_address; then
|
15
|
+
COMPREPLY=($(__ppl_suggest_contact_email_address))
|
16
|
+
return 0
|
17
|
+
fi
|
18
|
+
|
19
|
+
if __ppl_needs_contact_nickname; then
|
20
|
+
COMPREPLY=($(__ppl_suggest_contact_nickname))
|
21
|
+
return 0
|
22
|
+
fi
|
23
|
+
|
24
|
+
if __ppl_needs_contact_organization; then
|
25
|
+
COMPREPLY=($(__ppl_suggest_contact_organization))
|
26
|
+
return 0
|
27
|
+
fi
|
28
|
+
|
29
|
+
if __ppl_needs_contact_phone_numher; then
|
30
|
+
COMPREPLY=($(__ppl_suggest_contact_phone_numher))
|
31
|
+
return 0
|
32
|
+
fi
|
33
|
+
|
34
|
+
if __ppl_needs_contact_url; then
|
35
|
+
COMPREPLY=($(__ppl_suggest_contact_url))
|
36
|
+
return 0
|
37
|
+
fi
|
38
|
+
|
39
|
+
if __ppl_needs_git_remote; then
|
40
|
+
COMPREPLY=($(__ppl_suggest_git_remote))
|
41
|
+
return 0
|
42
|
+
fi
|
43
|
+
|
44
|
+
}
|
45
|
+
|
46
|
+
__ppl_needs_command_name()
|
47
|
+
{
|
48
|
+
if [[ $COMP_CWORD == 1 ]]; then
|
49
|
+
return 0
|
50
|
+
else
|
51
|
+
return 1
|
52
|
+
fi
|
53
|
+
}
|
54
|
+
|
55
|
+
__ppl_needs_contact_id()
|
56
|
+
{
|
57
|
+
command_list=$(__ppl_commands_needing_contact_ids)
|
58
|
+
command_name=${COMP_WORDS[1]}
|
59
|
+
if [[ $command_list =~ $command_name ]] && [[ $COMP_CWORD -eq 2 ]]; then
|
60
|
+
return 0
|
61
|
+
else
|
62
|
+
return 1
|
63
|
+
fi
|
64
|
+
}
|
65
|
+
|
66
|
+
__ppl_needs_git_remote()
|
67
|
+
{
|
68
|
+
command_list=$(__ppl_commands_needing_git_remotes)
|
69
|
+
command_name=${COMP_WORDS[1]}
|
70
|
+
if [[ $command_list =~ $command_name ]] && [[ $COMP_CWORD -eq 2 ]]; then
|
71
|
+
return 0
|
72
|
+
else
|
73
|
+
return 1
|
74
|
+
fi
|
75
|
+
}
|
76
|
+
|
77
|
+
__ppl_needs_contact_email_address()
|
78
|
+
{
|
79
|
+
if [ "${COMP_WORDS[1]}" == "email" ] && [ "$COMP_CWORD" == 3 ]; then
|
80
|
+
return 0
|
81
|
+
else
|
82
|
+
return 1
|
83
|
+
fi
|
84
|
+
}
|
85
|
+
|
86
|
+
__ppl_needs_contact_nickname()
|
87
|
+
{
|
88
|
+
if [ "${COMP_WORDS[1]}" == "nick" ] && [ "$COMP_CWORD" == 3 ]; then
|
89
|
+
return 0
|
90
|
+
else
|
91
|
+
return 1
|
92
|
+
fi
|
93
|
+
}
|
94
|
+
|
95
|
+
__ppl_needs_contact_organization()
|
96
|
+
{
|
97
|
+
if [ "${COMP_WORDS[1]}" == "org" ] && [ "$COMP_CWORD" == 3 ]; then
|
98
|
+
return 0
|
99
|
+
else
|
100
|
+
return 1
|
101
|
+
fi
|
102
|
+
}
|
103
|
+
|
104
|
+
__ppl_needs_contact_phone_numher()
|
105
|
+
{
|
106
|
+
if [ "${COMP_WORDS[1]}" == "phone" ] && [ "$COMP_CWORD" == 3 ]; then
|
107
|
+
return 0
|
108
|
+
else
|
109
|
+
return 1
|
110
|
+
fi
|
111
|
+
}
|
112
|
+
|
113
|
+
__ppl_needs_contact_url()
|
114
|
+
{
|
115
|
+
if [ "${COMP_WORDS[1]}" == "url" ] && [ "$COMP_CWORD" == 3 ]; then
|
116
|
+
return 0
|
117
|
+
else
|
118
|
+
return 1
|
119
|
+
fi
|
120
|
+
}
|
121
|
+
|
122
|
+
__ppl_suggest_command_name()
|
123
|
+
{
|
124
|
+
compgen -W "$(__ppl_commands)" -- ${COMP_WORDS[COMP_CWORD]}
|
125
|
+
}
|
126
|
+
|
127
|
+
__ppl_suggest_contact_id()
|
128
|
+
{
|
129
|
+
compgen -W "$(__ppl_contact_ids)" -- ${COMP_WORDS[$COMP_CWORD]}
|
130
|
+
}
|
131
|
+
|
132
|
+
__ppl_suggest_git_remote()
|
133
|
+
{
|
134
|
+
compgen -W "$(__ppl_git_remotes)" -- ${COMP_WORDS[$COMP_CWORD]}
|
135
|
+
}
|
136
|
+
|
137
|
+
__ppl_suggest_contact_email_address()
|
138
|
+
{
|
139
|
+
contact_id=${COMP_WORDS[2]}
|
140
|
+
compgen -W "$(__ppl_contact_email_addresses $contact_id)" -- ${COMP_WORDS[$COMP_CWORD]}
|
141
|
+
}
|
142
|
+
|
143
|
+
__ppl_suggest_contact_nickname()
|
144
|
+
{
|
145
|
+
compgen -W "$(__ppl_contact_nicknames ${COMP_WORDS[2]})" -- ${COMP_WORDS[$COMP_CWORD]}
|
146
|
+
}
|
147
|
+
|
148
|
+
__ppl_suggest_contact_organization()
|
149
|
+
{
|
150
|
+
compgen -W "$(__ppl_contact_organizations ${COMP_WORDS[2]})" -- ${COMP_WORDS[$COMP_CWORD]}
|
151
|
+
}
|
152
|
+
|
153
|
+
__ppl_suggest_contact_phone_numher()
|
154
|
+
{
|
155
|
+
compgen -W "$(__ppl_contact_phone_numbers ${COMP_WORDS[2]})" -- ${COMP_WORDS[$COMP_CWORD]}
|
156
|
+
}
|
157
|
+
|
158
|
+
__ppl_suggest_contact_url()
|
159
|
+
{
|
160
|
+
compgen -W "$(__ppl_contact_urls ${COMP_WORDS[2]})" -- ${COMP_WORDS[$COMP_CWORD]}
|
161
|
+
}
|
162
|
+
|
163
|
+
__ppl_commands_needing_contact_ids()
|
164
|
+
{
|
165
|
+
echo "age"
|
166
|
+
echo "bday"
|
167
|
+
echo "email"
|
168
|
+
echo "mv"
|
169
|
+
echo "name"
|
170
|
+
echo "nick"
|
171
|
+
echo "org"
|
172
|
+
echo "phone"
|
173
|
+
echo "post"
|
174
|
+
echo "rm"
|
175
|
+
echo "show"
|
176
|
+
echo "url"
|
177
|
+
}
|
178
|
+
|
179
|
+
__ppl_commands_needing_git_remotes()
|
180
|
+
{
|
181
|
+
echo "pull"
|
182
|
+
echo "push"
|
183
|
+
}
|
184
|
+
|
185
|
+
__ppl_commands()
|
186
|
+
{
|
187
|
+
echo "add"
|
188
|
+
echo "age"
|
189
|
+
echo "bday"
|
190
|
+
echo "completion"
|
191
|
+
echo "email"
|
192
|
+
echo "init"
|
193
|
+
echo "ls"
|
194
|
+
echo "mutt"
|
195
|
+
echo "mv"
|
196
|
+
echo "name"
|
197
|
+
echo "nick"
|
198
|
+
echo "org"
|
199
|
+
echo "phone"
|
200
|
+
echo "post"
|
201
|
+
echo "pull"
|
202
|
+
echo "push"
|
203
|
+
echo "remote"
|
204
|
+
echo "rm"
|
205
|
+
echo "scrape"
|
206
|
+
echo "shell"
|
207
|
+
echo "show"
|
208
|
+
echo "url"
|
209
|
+
echo "version"
|
210
|
+
}
|
211
|
+
|
212
|
+
__ppl_contact_ids()
|
213
|
+
{
|
214
|
+
ppl nick --no-color | cut -d ':' -f 1
|
215
|
+
}
|
216
|
+
|
217
|
+
__ppl_contact_email_addresses()
|
218
|
+
{
|
219
|
+
ppl email $1
|
220
|
+
}
|
221
|
+
|
222
|
+
__ppl_contact_nicknames()
|
223
|
+
{
|
224
|
+
ppl nick $1
|
225
|
+
}
|
226
|
+
|
227
|
+
__ppl_contact_organizations()
|
228
|
+
{
|
229
|
+
ppl org $1
|
230
|
+
}
|
231
|
+
|
232
|
+
__ppl_contact_phone_numbers()
|
233
|
+
{
|
234
|
+
ppl phone $1
|
235
|
+
}
|
236
|
+
|
237
|
+
__ppl_contact_urls()
|
238
|
+
{
|
239
|
+
ppl url $1
|
240
|
+
}
|
241
|
+
|
242
|
+
__ppl_git_remotes()
|
243
|
+
{
|
244
|
+
ppl remote
|
22
245
|
}
|
23
246
|
|
24
|
-
complete -F
|
247
|
+
complete -F __ppl ppl
|
25
248
|
|
data/features/add.feature
CHANGED
data/features/email.feature
CHANGED
@@ -4,6 +4,13 @@ Feature: ppl email
|
|
4
4
|
Scenario: Add an email address to a contact
|
5
5
|
Given I am in an address book with a blank contact called bob
|
6
6
|
And I run "ppl email bob bob@example.org"
|
7
|
-
Then
|
7
|
+
Then it should succeed
|
8
|
+
And bob should have 1 email address
|
8
9
|
And the 1st email address should be "bob@example.org"
|
9
10
|
|
11
|
+
Scenario: Remove an email address from a contact
|
12
|
+
Given I am in the same address book as before
|
13
|
+
And I run "ppl email bob --delete bob@example.org"
|
14
|
+
Then it should succeed
|
15
|
+
And bob should have 0 email addresses
|
16
|
+
|
data/features/init.feature
CHANGED
@@ -4,7 +4,8 @@ Feature: ppl init
|
|
4
4
|
Scenario: Create a new address book
|
5
5
|
Given I am in an empty directory
|
6
6
|
When I run "ppl init ./contacts"
|
7
|
-
Then
|
7
|
+
Then it should succeed
|
8
|
+
And "./contacts" should be a ppl address book
|
8
9
|
|
9
10
|
Scenario: Incorrect usage
|
10
11
|
Given I am in an empty directory
|
data/features/ls.feature
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
|
2
|
+
Feature: ppl ls
|
3
|
+
|
4
|
+
Scenario: List contacts' names and email addresses
|
5
|
+
Given I am in an address book with a blank contact called bob
|
6
|
+
And bob's name is "Robert Testing"
|
7
|
+
And bob's email address is "bob@example.org"
|
8
|
+
Then running "ppl ls" should output 1 line
|
9
|
+
And the 1st line should be "bob: Robert Testing <bob@example.org>"
|
10
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
Feature: ppl mutt
|
3
|
+
|
4
|
+
Scenario: Find contacts whose name matches the given string
|
5
|
+
Given I am in an address book with a blank contact called bob
|
6
|
+
And bob's name is "Robert Testing"
|
7
|
+
And bob's email address is "bob@example.org"
|
8
|
+
Then running "ppl mutt Rob" should output 2 lines
|
9
|
+
And the 1st line should be "Searching address book... 1 email addresses... 1 matching:"
|
10
|
+
And the 2nd line should be "bob@example.org Robert Testing"
|
11
|
+
|
12
|
+
Scenario: Fail to match a name because the case is wrong
|
13
|
+
Given I am in the same address book as before
|
14
|
+
Then running "ppl mutt rob" should output 1 line
|
15
|
+
And the 1st line should be "No matches"
|
16
|
+
|
17
|
+
Scenario: Case-insensitive search
|
18
|
+
Given I am in the same address book as before
|
19
|
+
Then running "ppl mutt -i rob" should output 2 lines
|
20
|
+
And the 1st line should be "Searching address book... 1 email addresses... 1 matching:"
|
21
|
+
And the 2nd line should be "bob@example.org Robert Testing"
|
22
|
+
|
data/features/mv.feature
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
Feature: ppl mv
|
3
|
+
|
4
|
+
Scenario: Change a contact's ID
|
5
|
+
Given I am in an address book with a blank contact called bob
|
6
|
+
And I run "ppl mv bob rob"
|
7
|
+
Then it should succeed
|
8
|
+
And there should be 1 contact
|
9
|
+
And its ID should be "rob"
|
10
|
+
|
11
|
+
Scenario: Fail when the given contact ID doesn't exist
|
12
|
+
Given I am in the same address book as before
|
13
|
+
And I run "ppl mv bob rob 2> /dev/null"
|
14
|
+
Then it should fail
|
15
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
Feature: ppl nick
|
3
|
+
|
4
|
+
Scenario: Add a nickname to a contact
|
5
|
+
Given I am in an address book with a blank contact called bob
|
6
|
+
And I run "ppl nick bob Bob"
|
7
|
+
Then it should succeed
|
8
|
+
And bob should have 1 nickname
|
9
|
+
And the 1st nickname should be "Bob"
|
10
|
+
|
11
|
+
Scenario: Remove a nickname address from a contact
|
12
|
+
Given I am in the same address book as before
|
13
|
+
And I run "ppl nick bob --delete Bob"
|
14
|
+
Then it should succeed
|
15
|
+
And bob should have 0 nicknames
|
16
|
+
|
data/features/org.feature
CHANGED
@@ -4,6 +4,13 @@ Feature: ppl org
|
|
4
4
|
Scenario: Add an organization to a contact
|
5
5
|
Given I am in an address book with a blank contact called bob
|
6
6
|
And I run "ppl org bob 'Red Hat'"
|
7
|
-
Then
|
7
|
+
Then it should succeed
|
8
|
+
And bob should have 1 organization
|
8
9
|
And the 1st organization should be "Red Hat"
|
9
10
|
|
11
|
+
Scenario: Remove an organization from a contact
|
12
|
+
Given I am in the same address book as before
|
13
|
+
And I run "ppl org bob --delete 'Red Hat'"
|
14
|
+
Then it should succeed
|
15
|
+
And bob should have 0 organizations
|
16
|
+
|
data/features/phone.feature
CHANGED
@@ -4,11 +4,27 @@ Feature: ppl phone
|
|
4
4
|
Scenario: Add a phone number to a contact
|
5
5
|
Given I am in an address book with a blank contact called bob
|
6
6
|
And I run "ppl phone bob 01234567890"
|
7
|
-
Then
|
7
|
+
Then it should succeed
|
8
|
+
And bob should have 1 phone number
|
9
|
+
And the 1st phone number should be "01234567890"
|
10
|
+
|
11
|
+
Scenario: Update a phone number's type
|
12
|
+
Given I am in the same address book as before
|
13
|
+
And I run "ppl phone bob 01234567890 --type cell"
|
14
|
+
Then it should succeed
|
15
|
+
And bob should have 1 phone number
|
16
|
+
And the 1st phone number should be "01234567890 (cell)"
|
17
|
+
|
18
|
+
Scenario: Remove a phone number's type
|
19
|
+
Given I am in the same address book as before
|
20
|
+
And I run "ppl phone bob 01234567890 --type ''"
|
21
|
+
Then it should succeed
|
22
|
+
And bob should have 1 phone number
|
8
23
|
And the 1st phone number should be "01234567890"
|
9
24
|
|
10
25
|
Scenario: Remove a phone number from a contact
|
11
26
|
Given I am in the same address book as before
|
12
27
|
And I run "ppl phone bob --delete 01234567890"
|
13
|
-
Then
|
28
|
+
Then it should succeed
|
29
|
+
And bob should have 0 phone numbers
|
14
30
|
|
data/features/rm.feature
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
|
2
|
+
Feature: ppl rm
|
3
|
+
|
4
|
+
Scenario: Remove a contact from the address book
|
5
|
+
Given I am in an address book with a blank contact called bob
|
6
|
+
And I run "ppl rm bob"
|
7
|
+
Then there should be 0 contacts
|
8
|
+
|
9
|
+
Scenario: Fail when asked to remove a non-existent contact
|
10
|
+
Given I am in the same address book as before
|
11
|
+
And I run "ppl rm bob 2> /dev/null"
|
12
|
+
Then it should fail
|
13
|
+
|
@@ -10,14 +10,20 @@ When /^I run "ppl ([^"]+)"$/ do |command|
|
|
10
10
|
ppl command
|
11
11
|
end
|
12
12
|
|
13
|
+
Then /^it should succeed$/ do
|
14
|
+
$?.exitstatus.should eq 0
|
15
|
+
end
|
16
|
+
|
13
17
|
Then /^it should fail$/ do
|
14
18
|
$?.exitstatus.should_not eq 0
|
15
19
|
end
|
16
20
|
|
17
|
-
Then /^there should be
|
21
|
+
Then /^there should be (\d+) contacts?$/ do |n|
|
18
22
|
contact_list = ppl("ls").strip.split("\n")
|
19
|
-
contact_list.length.should eq
|
20
|
-
|
23
|
+
contact_list.length.should eq n.to_i
|
24
|
+
if contact_list[0]
|
25
|
+
@contact_id = contact_list[0].split(":").first
|
26
|
+
end
|
21
27
|
end
|
22
28
|
|
23
29
|
Then /^(bob) should have (\d+) email addresse?s?$/ do |name, number|
|
@@ -25,6 +31,11 @@ Then /^(bob) should have (\d+) email addresse?s?$/ do |name, number|
|
|
25
31
|
@email_addresses.length.should eq number.to_i
|
26
32
|
end
|
27
33
|
|
34
|
+
Then /^(bob) should have (\d+) nicknames?$/ do |name, number|
|
35
|
+
@nicknames = ppl("nick #{name}").split("\n")
|
36
|
+
@nicknames.length.should eq number.to_i
|
37
|
+
end
|
38
|
+
|
28
39
|
Then /^(bob) should have (\d+) organizations?$/ do |name, number|
|
29
40
|
@organizations = ppl("org #{name}").split("\n")
|
30
41
|
@organizations.length.should eq number.to_i
|
@@ -35,6 +46,15 @@ Then /^(bob) should have (\d+) phone numbers?$/ do |name, number|
|
|
35
46
|
@phone_numbers.length.should eq number.to_i
|
36
47
|
end
|
37
48
|
|
49
|
+
Then /^(bob) should have (\d+) URLs?$/ do |name, number|
|
50
|
+
@urls = ppl("url #{name}").split("\n")
|
51
|
+
@urls.length.should eq number.to_i
|
52
|
+
end
|
53
|
+
|
54
|
+
And /^its ID should be "([^"]+)"$/ do |id|
|
55
|
+
@contact_id.should eq id
|
56
|
+
end
|
57
|
+
|
38
58
|
And /^its name should be "([^"]+)"$/ do |name|
|
39
59
|
ppl("name #{@contact_id}").should eq name
|
40
60
|
end
|
@@ -43,6 +63,19 @@ Then(/^the (\d+).. email address should be "([^"]+)"$/) do |nth, address|
|
|
43
63
|
@email_addresses[nth.to_i - 1].should eq address
|
44
64
|
end
|
45
65
|
|
66
|
+
Then /^running "ppl ([^"]+)" should output (\d+) lines?$/ do |command, lines|
|
67
|
+
@output = ppl(command).split("\n")
|
68
|
+
@output.length.should eq lines.to_i
|
69
|
+
end
|
70
|
+
|
71
|
+
And /^the (\d+).. line should be "([^"]+)"$/ do |nth, line|
|
72
|
+
@output[nth.to_i - 1].should eq line
|
73
|
+
end
|
74
|
+
|
75
|
+
Then(/^the (\d+).. nickname should be "([^"]+)"$/) do |nth, nickname|
|
76
|
+
@nicknames[nth.to_i - 1].should eq nickname
|
77
|
+
end
|
78
|
+
|
46
79
|
Then(/^the (\d+).. organization should be "([^"]+)"$/) do |nth, organization|
|
47
80
|
@organizations[nth.to_i - 1].should eq organization
|
48
81
|
end
|
@@ -51,4 +84,19 @@ Then(/^the (\d+).. phone number should be "([^"]+)"$/) do |nth, phone_number|
|
|
51
84
|
@phone_numbers[nth.to_i - 1].should eq phone_number
|
52
85
|
end
|
53
86
|
|
87
|
+
Then(/^the (\d+).. URL should be "([^"]+)"$/) do |nth, url|
|
88
|
+
@urls[nth.to_i - 1].should eq url
|
89
|
+
end
|
90
|
+
|
91
|
+
Then /^(bob)'s birthday should be "([^"]+)"$/ do |id, birthday|
|
92
|
+
ppl("bday #{id}").should eq birthday
|
93
|
+
end
|
94
|
+
|
95
|
+
And /^(bob)'s name is "([^"]+)"$/ do |id, name|
|
96
|
+
ppl("name #{id} \"#{name}\"")
|
97
|
+
end
|
98
|
+
|
99
|
+
And /^(bob)'s email address is "([^"]+)"$/ do |id, email_address|
|
100
|
+
ppl("email #{id} \"#{email_address}\"")
|
101
|
+
end
|
54
102
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
Feature: ppl url
|
3
|
+
|
4
|
+
Scenario: Add a URL to a contact
|
5
|
+
Given I am in an address book with a blank contact called bob
|
6
|
+
And I run "ppl url bob http://example.org/~bob"
|
7
|
+
Then it should succeed
|
8
|
+
And bob should have 1 URL
|
9
|
+
And the 1st URL should be "http://example.org/~bob"
|
10
|
+
|
11
|
+
Scenario: Remove a URL from a contact
|
12
|
+
Given I am in the same address book as before
|
13
|
+
And I run "ppl url bob --delete http://example.org/~bob"
|
14
|
+
Then it should succeed
|
15
|
+
And bob should have 0 URLs
|
16
|
+
|
data/lib/ppl.rb
CHANGED
data/ppl.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ppl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.23.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henry Smith
|
@@ -163,17 +163,25 @@ files:
|
|
163
163
|
- COPYING
|
164
164
|
- Gemfile
|
165
165
|
- README.md
|
166
|
+
- Rakefile
|
166
167
|
- bin/ppl
|
167
168
|
- completions/bash
|
168
169
|
- completions/zsh
|
169
170
|
- features/add.feature
|
171
|
+
- features/bday.feature
|
170
172
|
- features/email.feature
|
171
173
|
- features/init.feature
|
174
|
+
- features/ls.feature
|
175
|
+
- features/mutt.feature
|
176
|
+
- features/mv.feature
|
177
|
+
- features/nick.feature
|
172
178
|
- features/org.feature
|
173
179
|
- features/phone.feature
|
180
|
+
- features/rm.feature
|
174
181
|
- features/step_definitions/address_book_steps.rb
|
175
182
|
- features/step_definitions/cwd_steps.rb
|
176
183
|
- features/step_definitions/ppl_steps.rb
|
184
|
+
- features/url.feature
|
177
185
|
- lib/ppl.rb
|
178
186
|
- lib/ppl/adapter/color.rb
|
179
187
|
- lib/ppl/adapter/color/colored.rb
|