ppl 1.15.0 → 1.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/.travis.yml +3 -1
- data/Gemfile +1 -11
- data/lib/ppl/adapter/vcard/{vpim.rb → greencard.rb} +4 -4
- data/lib/ppl/application/bootstrap.rb +25 -43
- data/lib/ppl/application/configuration.rb +1 -0
- data/lib/ppl/application/router.rb +6 -6
- data/lib/ppl/application/shell.rb +1 -1
- data/lib/ppl/command/{execute.rb → external.rb} +1 -1
- data/lib/ppl.rb +3 -3
- data/ppl.gemspec +7 -3
- data/spec/ppl/adapter/vcard/{vpim_spec.rb → greencard_spec.rb} +4 -4
- data/spec/ppl/application/bootstrap_spec.rb +2 -20
- data/spec/ppl/application/configuration_spec.rb +11 -2
- data/spec/ppl/application/router_spec.rb +6 -6
- data/spec/ppl/application/shell_spec.rb +5 -5
- data/spec/ppl/command/{execute_spec.rb → external_spec.rb} +2 -2
- metadata +56 -27
- data/Gemfile.lock +0 -35
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c7a6a79415d099361118edf8c6d6a55d588a8efb
|
4
|
+
data.tar.gz: fa7c00ded45c0a0ec2d3f97a161b06e40fec94ee
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f8c037f64e3016665e6f388be1ae411ed2a503a0adfc525bfbda5d6840a0c12e125120b1eb94b930d4a6dddef0035a833ad79a5eab046da7205c797ef895a87c
|
7
|
+
data.tar.gz: 08b7a136a3f7c60a45da397ddd972c7517259ed41d943e25f5a79c520f3339abb75745e0af2ac3bc0670c4fce5283afd19e20336ce6946db15ccc23ab6a05b17
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -1,14 +1,4 @@
|
|
1
1
|
|
2
2
|
source "https://rubygems.org"
|
3
|
-
|
4
|
-
gem "inifile", "2.0.2"
|
5
|
-
gem "morphine", "0.1.1"
|
6
|
-
gem "rugged", "0.17.0.b6"
|
7
|
-
gem "vpim", "12.1.12", :git => "git://github.com/sam-github/vpim.git"
|
8
|
-
|
9
|
-
group :test do
|
10
|
-
gem "fakefs"
|
11
|
-
gem "rake"
|
12
|
-
gem "rspec"
|
13
|
-
end
|
3
|
+
gemspec
|
14
4
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
|
-
require "
|
2
|
+
require "greencard/vcard"
|
3
3
|
|
4
|
-
class Ppl::Adapter::Vcard::
|
4
|
+
class Ppl::Adapter::Vcard::GreenCard
|
5
5
|
|
6
6
|
@@postal_address_property_map = {
|
7
7
|
:street => :street,
|
@@ -13,7 +13,7 @@ class Ppl::Adapter::Vcard::Vpim
|
|
13
13
|
}
|
14
14
|
|
15
15
|
def encode(contact)
|
16
|
-
vcard =
|
16
|
+
vcard = GreenCard::Vcard::Maker.make2 do |maker|
|
17
17
|
encode_birthday(contact, maker)
|
18
18
|
encode_name(contact, maker)
|
19
19
|
encode_email_addresses(contact, maker)
|
@@ -27,7 +27,7 @@ class Ppl::Adapter::Vcard::Vpim
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def decode(string)
|
30
|
-
vcard =
|
30
|
+
vcard = GreenCard::Vcard.decode(string).first
|
31
31
|
contact = Ppl::Entity::Contact.new
|
32
32
|
decode_birthday(vcard, contact)
|
33
33
|
decode_email_addresses(vcard, contact)
|
@@ -108,19 +108,19 @@ class Ppl::Application::Bootstrap
|
|
108
108
|
end
|
109
109
|
|
110
110
|
register :command_pull do
|
111
|
-
pull = Ppl::Command::
|
111
|
+
pull = Ppl::Command::External.new("pull", "git pull", "Execute 'git pull' in the address book directory")
|
112
112
|
pull.storage = storage_adapter
|
113
113
|
pull
|
114
114
|
end
|
115
115
|
|
116
116
|
register :command_push do
|
117
|
-
push = Ppl::Command::
|
117
|
+
push = Ppl::Command::External.new("push", "git push", "Execute 'git push' in the address book directory")
|
118
118
|
push.storage = storage_adapter
|
119
119
|
push
|
120
120
|
end
|
121
121
|
|
122
122
|
register :command_remote do
|
123
|
-
remote = Ppl::Command::
|
123
|
+
remote = Ppl::Command::External.new("remote", "git remote", "Execute 'git remote' in the address book directory")
|
124
124
|
remote.storage = storage_adapter
|
125
125
|
remote
|
126
126
|
end
|
@@ -189,27 +189,24 @@ class Ppl::Application::Bootstrap
|
|
189
189
|
Ppl::Application::Configuration.new
|
190
190
|
end
|
191
191
|
|
192
|
-
register :
|
193
|
-
command = Ppl::Command::
|
192
|
+
register :external_command do
|
193
|
+
command = Ppl::Command::External.new(nil, nil, nil)
|
194
194
|
command.storage = storage_adapter
|
195
195
|
command
|
196
196
|
end
|
197
197
|
|
198
198
|
register :format_address_book_ages do
|
199
|
-
|
200
|
-
colors = config.color_enabled("age") ? config.command_colors("age") : {}
|
199
|
+
colors = configuration.command_colors("age")
|
201
200
|
Ppl::Format::AddressBook::Ages.new(colors)
|
202
201
|
end
|
203
202
|
|
204
203
|
register :format_address_book_birthdays do
|
205
|
-
|
206
|
-
colors = config.color_enabled("bday") ? config.command_colors("bday") : {}
|
204
|
+
colors = configuration.command_colors("bday")
|
207
205
|
Ppl::Format::AddressBook::Birthdays.new(colors)
|
208
206
|
end
|
209
207
|
|
210
208
|
register :format_address_book_email_addresses do
|
211
|
-
|
212
|
-
colors = config.color_enabled("email") ? config.command_colors("email") : {}
|
209
|
+
colors = configuration.command_colors("email")
|
213
210
|
Ppl::Format::AddressBook::EmailAddresses.new(colors)
|
214
211
|
end
|
215
212
|
|
@@ -218,86 +215,72 @@ class Ppl::Application::Bootstrap
|
|
218
215
|
end
|
219
216
|
|
220
217
|
register :format_address_book_names do
|
221
|
-
|
222
|
-
colors = config.color_enabled("name") ? config.command_colors("name") : {}
|
218
|
+
colors = configuration.command_colors("name")
|
223
219
|
Ppl::Format::AddressBook::Names.new(colors)
|
224
220
|
end
|
225
221
|
|
226
222
|
register :format_address_book_nicknames do
|
227
|
-
|
228
|
-
colors = config.color_enabled("nick") ? config.command_colors("nick") : {}
|
223
|
+
colors = configuration.command_colors("nick")
|
229
224
|
Ppl::Format::AddressBook::Nicknames.new(colors)
|
230
225
|
end
|
231
226
|
|
232
227
|
register :format_address_book_one_line do
|
233
|
-
|
234
|
-
colors = config.color_enabled("ls") ? config.command_colors("ls") : {}
|
228
|
+
colors = configuration.command_colors("ls")
|
235
229
|
Ppl::Format::AddressBook::OneLine.new(colors)
|
236
230
|
end
|
237
231
|
|
238
232
|
register :format_address_book_organizations do
|
239
|
-
|
240
|
-
colors = config.color_enabled("org") ? config.command_colors("org") : {}
|
233
|
+
colors = configuration.command_colors("org")
|
241
234
|
Ppl::Format::AddressBook::Organizations.new(colors)
|
242
235
|
end
|
243
236
|
|
244
237
|
register :format_address_book_phone_numbers do
|
245
|
-
|
246
|
-
colors = config.color_enabled("phone") ? config.command_colors("phone") : {}
|
238
|
+
colors = configuration.command_colors("phone")
|
247
239
|
Ppl::Format::AddressBook::PhoneNumbers.new(colors)
|
248
240
|
end
|
249
241
|
|
250
242
|
register :format_address_book_postal_addresses do
|
251
|
-
|
252
|
-
colors = config.color_enabled("post") ? config.command_colors("post") : {}
|
243
|
+
colors = configuration.command_colors("post")
|
253
244
|
Ppl::Format::AddressBook::PostalAddresses.new(colors)
|
254
245
|
end
|
255
246
|
|
256
247
|
register :format_address_book_urls do
|
257
|
-
|
258
|
-
colors = config.color_enabled("url") ? config.command_colors("url") : {}
|
248
|
+
colors = configuration.command_colors("url")
|
259
249
|
Ppl::Format::AddressBook::Urls.new(colors)
|
260
250
|
end
|
261
251
|
|
262
252
|
register :format_contact_age do
|
263
|
-
|
264
|
-
colors = config.color_enabled("age") ? config.command_colors("age") : {}
|
253
|
+
colors = configuration.command_colors("age")
|
265
254
|
Ppl::Format::Contact::Age.new(colors)
|
266
255
|
end
|
267
256
|
|
268
257
|
register :format_contact_birthday do
|
269
|
-
|
270
|
-
colors = config.color_enabled("bday") ? config.command_colors("bday") : {}
|
258
|
+
colors = configuration.command_colors("bday")
|
271
259
|
Ppl::Format::Contact::Birthday.new(colors)
|
272
260
|
end
|
273
261
|
|
274
262
|
register :format_contact_email_addresses do
|
275
|
-
|
276
|
-
colors = config.color_enabled("email") ? config.command_colors("email") : {}
|
263
|
+
colors = configuration.command_colors("email")
|
277
264
|
Ppl::Format::Contact::EmailAddresses.new(colors)
|
278
265
|
end
|
279
266
|
|
280
267
|
register :format_contact_name do
|
281
|
-
|
282
|
-
colors = config.color_enabled("name") ? config.command_colors("name") : {}
|
268
|
+
colors = configuration.command_colors("name")
|
283
269
|
Ppl::Format::Contact::Name.new(colors)
|
284
270
|
end
|
285
271
|
|
286
272
|
register :format_contact_nicknames do
|
287
|
-
|
288
|
-
colors = config.color_enabled("nick") ? config.command_colors("nick") : {}
|
273
|
+
colors = configuration.command_colors("nick")
|
289
274
|
Ppl::Format::Contact::Nicknames.new(colors)
|
290
275
|
end
|
291
276
|
|
292
277
|
register :format_contact_organizations do
|
293
|
-
|
294
|
-
colors = config.color_enabled("org") ? config.command_colors("org") : {}
|
278
|
+
colors = configuration.command_colors("org")
|
295
279
|
Ppl::Format::Contact::Organization.new(colors)
|
296
280
|
end
|
297
281
|
|
298
282
|
register :format_contact_phone_numbers do
|
299
|
-
|
300
|
-
colors = config.color_enabled("phone") ? config.command_colors("phone") : {}
|
283
|
+
colors = configuration.command_colors("phone")
|
301
284
|
Ppl::Format::Contact::PhoneNumber.new(colors)
|
302
285
|
end
|
303
286
|
|
@@ -306,8 +289,7 @@ class Ppl::Application::Bootstrap
|
|
306
289
|
end
|
307
290
|
|
308
291
|
register :format_contact_urls do
|
309
|
-
|
310
|
-
colors = config.color_enabled("url") ? config.command_colors("url") : {}
|
292
|
+
colors = configuration.command_colors("url")
|
311
293
|
Ppl::Format::Contact::Urls.new(colors)
|
312
294
|
end
|
313
295
|
|
@@ -323,7 +305,7 @@ class Ppl::Application::Bootstrap
|
|
323
305
|
router = Ppl::Application::Router.new(command_suite)
|
324
306
|
router.aliases = configuration.aliases
|
325
307
|
router.default = "help"
|
326
|
-
router.
|
308
|
+
router.external_command = external_command
|
327
309
|
router
|
328
310
|
end
|
329
311
|
|
@@ -343,7 +325,7 @@ class Ppl::Application::Bootstrap
|
|
343
325
|
end
|
344
326
|
|
345
327
|
register :vcard_adapter do
|
346
|
-
Ppl::Adapter::Vcard::
|
328
|
+
Ppl::Adapter::Vcard::GreenCard.new
|
347
329
|
end
|
348
330
|
|
349
331
|
end
|
@@ -3,7 +3,7 @@ class Ppl::Application::Router
|
|
3
3
|
|
4
4
|
attr_accessor :aliases
|
5
5
|
attr_accessor :default
|
6
|
-
attr_accessor :
|
6
|
+
attr_accessor :external_command
|
7
7
|
|
8
8
|
def initialize(command_suite)
|
9
9
|
@command_suite = command_suite
|
@@ -14,7 +14,7 @@ class Ppl::Application::Router
|
|
14
14
|
command = @command_suite.find_command(argument)
|
15
15
|
if command.nil? && @aliases.has_key?(argument)
|
16
16
|
if is_bang_alias?(argument)
|
17
|
-
command =
|
17
|
+
command = create_external_command(argument)
|
18
18
|
else
|
19
19
|
command = @command_suite.find_command(@aliases[argument])
|
20
20
|
end
|
@@ -32,10 +32,10 @@ class Ppl::Application::Router
|
|
32
32
|
@aliases[key].match(/^!/)
|
33
33
|
end
|
34
34
|
|
35
|
-
def
|
36
|
-
@
|
37
|
-
@
|
38
|
-
@
|
35
|
+
def create_external_command(key)
|
36
|
+
@external_command.name = key
|
37
|
+
@external_command.command = @aliases[key][1..-1]
|
38
|
+
@external_command
|
39
39
|
end
|
40
40
|
|
41
41
|
end
|
@@ -31,7 +31,7 @@ class Ppl::Application::Shell
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def prepare_command(command, input)
|
34
|
-
if !command.nil? && !command.is_a?(Ppl::Command::
|
34
|
+
if !command.nil? && !command.is_a?(Ppl::Command::External)
|
35
35
|
@optparse = OptionParser.new do |parser|
|
36
36
|
command.options(parser, input.options)
|
37
37
|
end
|
data/lib/ppl.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
module Ppl
|
3
3
|
|
4
|
-
Version = "1.15.
|
4
|
+
Version = "1.15.1"
|
5
5
|
|
6
6
|
module Adapter
|
7
7
|
end
|
@@ -31,7 +31,7 @@ require "ppl/adapter/storage/disk"
|
|
31
31
|
require "ppl/adapter/storage/factory"
|
32
32
|
require "ppl/adapter/storage/git"
|
33
33
|
require "ppl/adapter/vcard"
|
34
|
-
require "ppl/adapter/vcard/
|
34
|
+
require "ppl/adapter/vcard/greencard"
|
35
35
|
|
36
36
|
require "ppl/application/bootstrap"
|
37
37
|
require "ppl/application/command"
|
@@ -62,7 +62,7 @@ require "ppl/command/post"
|
|
62
62
|
require "ppl/command/shell"
|
63
63
|
require "ppl/command/url"
|
64
64
|
require "ppl/command/version"
|
65
|
-
require "ppl/command/
|
65
|
+
require "ppl/command/external"
|
66
66
|
|
67
67
|
require "ppl/entity/address_book"
|
68
68
|
require "ppl/entity/contact"
|
data/ppl.gemspec
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
Gem::Specification.new do |spec|
|
3
3
|
|
4
4
|
spec.name = "ppl"
|
5
|
-
spec.version = "1.15.
|
6
|
-
spec.date = "2013-
|
5
|
+
spec.version = "1.15.1"
|
6
|
+
spec.date = "2013-04-11"
|
7
7
|
|
8
8
|
spec.required_ruby_version = ">= 1.9.3"
|
9
9
|
|
@@ -15,7 +15,11 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.add_dependency("inifile", "2.0.2")
|
16
16
|
spec.add_dependency("morphine", "0.1.1")
|
17
17
|
spec.add_dependency("rugged", "0.17.0.b6")
|
18
|
-
spec.add_dependency("
|
18
|
+
spec.add_dependency("greencard", "0.0.3")
|
19
|
+
|
20
|
+
spec.add_development_dependency("rspec")
|
21
|
+
spec.add_development_dependency("rake")
|
22
|
+
spec.add_development_dependency("fakefs")
|
19
23
|
|
20
24
|
spec.authors = ["Henry Smith"]
|
21
25
|
spec.email = "henry@henrysmith.org"
|
@@ -1,8 +1,8 @@
|
|
1
1
|
|
2
|
-
describe Ppl::Adapter::Vcard::
|
2
|
+
describe Ppl::Adapter::Vcard::GreenCard, "#encode" do
|
3
3
|
|
4
4
|
before(:each) do
|
5
|
-
@adapter = Ppl::Adapter::Vcard::
|
5
|
+
@adapter = Ppl::Adapter::Vcard::GreenCard.new
|
6
6
|
@contact = Ppl::Entity::Contact.new
|
7
7
|
@contact.id = "test"
|
8
8
|
end
|
@@ -81,10 +81,10 @@ describe Ppl::Adapter::Vcard::Vpim, "#encode" do
|
|
81
81
|
end
|
82
82
|
|
83
83
|
|
84
|
-
describe Ppl::Adapter::Vcard::
|
84
|
+
describe Ppl::Adapter::Vcard::GreenCard, "#decode" do
|
85
85
|
|
86
86
|
before(:each) do
|
87
|
-
@adapter = Ppl::Adapter::Vcard::
|
87
|
+
@adapter = Ppl::Adapter::Vcard::GreenCard.new
|
88
88
|
end
|
89
89
|
|
90
90
|
it "should return a Ppl::Entity::Contact" do
|
@@ -147,7 +147,6 @@ describe Ppl::Application::Bootstrap do
|
|
147
147
|
@colors = {}
|
148
148
|
@config = double(Ppl::Application::Configuration)
|
149
149
|
@bootstrap.stub(:configuration).and_return(@config)
|
150
|
-
@config.should_receive(:color_enabled).with("age").and_return(true)
|
151
150
|
@config.should_receive(:command_colors).with("age").and_return(@colors)
|
152
151
|
@bootstrap.format_address_book_ages
|
153
152
|
end
|
@@ -163,7 +162,6 @@ describe Ppl::Application::Bootstrap do
|
|
163
162
|
@colors = {}
|
164
163
|
@config = double(Ppl::Application::Configuration)
|
165
164
|
@bootstrap.stub(:configuration).and_return(@config)
|
166
|
-
@config.should_receive(:color_enabled).with("bday").and_return(true)
|
167
165
|
@config.should_receive(:command_colors).with("bday").and_return(@colors)
|
168
166
|
@bootstrap.format_address_book_birthdays
|
169
167
|
end
|
@@ -177,7 +175,6 @@ describe Ppl::Application::Bootstrap do
|
|
177
175
|
@colors = {}
|
178
176
|
@config = double(Ppl::Application::Configuration)
|
179
177
|
@bootstrap.stub(:configuration).and_return(@config)
|
180
|
-
@config.should_receive(:color_enabled).with("email").and_return(true)
|
181
178
|
@config.should_receive(:command_colors).with("email").and_return(@colors)
|
182
179
|
@bootstrap.format_address_book_email_addresses
|
183
180
|
end
|
@@ -197,7 +194,6 @@ describe Ppl::Application::Bootstrap do
|
|
197
194
|
@colors = {}
|
198
195
|
@config = double(Ppl::Application::Configuration)
|
199
196
|
@bootstrap.stub(:configuration).and_return(@config)
|
200
|
-
@config.should_receive(:color_enabled).with("org").and_return(true)
|
201
197
|
@config.should_receive(:command_colors).with("org").and_return(@colors)
|
202
198
|
@bootstrap.format_address_book_organizations
|
203
199
|
end
|
@@ -211,7 +207,6 @@ describe Ppl::Application::Bootstrap do
|
|
211
207
|
@colors = {}
|
212
208
|
@config = double(Ppl::Application::Configuration)
|
213
209
|
@bootstrap.stub(:configuration).and_return(@config)
|
214
|
-
@config.should_receive(:color_enabled).with("name").and_return(true)
|
215
210
|
@config.should_receive(:command_colors).with("name").and_return(@colors)
|
216
211
|
@bootstrap.format_address_book_names
|
217
212
|
end
|
@@ -225,7 +220,6 @@ describe Ppl::Application::Bootstrap do
|
|
225
220
|
@colors = {}
|
226
221
|
@config = double(Ppl::Application::Configuration)
|
227
222
|
@bootstrap.stub(:configuration).and_return(@config)
|
228
|
-
@config.should_receive(:color_enabled).with("nick").and_return(true)
|
229
223
|
@config.should_receive(:command_colors).with("nick").and_return(@colors)
|
230
224
|
@bootstrap.format_address_book_nicknames
|
231
225
|
end
|
@@ -239,7 +233,6 @@ describe Ppl::Application::Bootstrap do
|
|
239
233
|
@colors = {}
|
240
234
|
@config = double(Ppl::Application::Configuration)
|
241
235
|
@bootstrap.stub(:configuration).and_return(@config)
|
242
|
-
@config.should_receive(:color_enabled).with("ls").and_return(true)
|
243
236
|
@config.should_receive(:command_colors).with("ls").and_return(@colors)
|
244
237
|
@bootstrap.format_address_book_one_line
|
245
238
|
end
|
@@ -253,7 +246,6 @@ describe Ppl::Application::Bootstrap do
|
|
253
246
|
@colors = {}
|
254
247
|
@config = double(Ppl::Application::Configuration)
|
255
248
|
@bootstrap.stub(:configuration).and_return(@config)
|
256
|
-
@config.should_receive(:color_enabled).with("phone").and_return(true)
|
257
249
|
@config.should_receive(:command_colors).with("phone").and_return(@colors)
|
258
250
|
@bootstrap.format_address_book_phone_numbers
|
259
251
|
end
|
@@ -267,7 +259,6 @@ describe Ppl::Application::Bootstrap do
|
|
267
259
|
@colors = {}
|
268
260
|
@config = double(Ppl::Application::Configuration)
|
269
261
|
@bootstrap.stub(:configuration).and_return(@config)
|
270
|
-
@config.should_receive(:color_enabled).with("post").and_return(true)
|
271
262
|
@config.should_receive(:command_colors).with("post").and_return(@colors)
|
272
263
|
@bootstrap.format_address_book_postal_addresses
|
273
264
|
end
|
@@ -281,7 +272,6 @@ describe Ppl::Application::Bootstrap do
|
|
281
272
|
@colors = {}
|
282
273
|
@config = double(Ppl::Application::Configuration)
|
283
274
|
@bootstrap.stub(:configuration).and_return(@config)
|
284
|
-
@config.should_receive(:color_enabled).with("url").and_return(true)
|
285
275
|
@config.should_receive(:command_colors).with("url").and_return(@colors)
|
286
276
|
@bootstrap.format_address_book_urls
|
287
277
|
end
|
@@ -295,7 +285,6 @@ describe Ppl::Application::Bootstrap do
|
|
295
285
|
@colors = {}
|
296
286
|
@config = double(Ppl::Application::Configuration)
|
297
287
|
@bootstrap.stub(:configuration).and_return(@config)
|
298
|
-
@config.should_receive(:color_enabled).with("age").and_return(true)
|
299
288
|
@config.should_receive(:command_colors).with("age").and_return(@colors)
|
300
289
|
@bootstrap.format_contact_age
|
301
290
|
end
|
@@ -309,7 +298,6 @@ describe Ppl::Application::Bootstrap do
|
|
309
298
|
@colors = {}
|
310
299
|
@config = double(Ppl::Application::Configuration)
|
311
300
|
@bootstrap.stub(:configuration).and_return(@config)
|
312
|
-
@config.should_receive(:color_enabled).with("bday").and_return(true)
|
313
301
|
@config.should_receive(:command_colors).with("bday").and_return(@colors)
|
314
302
|
@bootstrap.format_contact_birthday
|
315
303
|
end
|
@@ -323,7 +311,6 @@ describe Ppl::Application::Bootstrap do
|
|
323
311
|
@colors = {}
|
324
312
|
@config = double(Ppl::Application::Configuration)
|
325
313
|
@bootstrap.stub(:configuration).and_return(@config)
|
326
|
-
@config.should_receive(:color_enabled).with("email").and_return(true)
|
327
314
|
@config.should_receive(:command_colors).with("email").and_return(@colors)
|
328
315
|
@bootstrap.format_contact_email_addresses
|
329
316
|
end
|
@@ -337,7 +324,6 @@ describe Ppl::Application::Bootstrap do
|
|
337
324
|
@colors = {}
|
338
325
|
@config = double(Ppl::Application::Configuration)
|
339
326
|
@bootstrap.stub(:configuration).and_return(@config)
|
340
|
-
@config.should_receive(:color_enabled).with("name").and_return(true)
|
341
327
|
@config.should_receive(:command_colors).with("name").and_return(@colors)
|
342
328
|
@bootstrap.format_contact_name
|
343
329
|
end
|
@@ -351,7 +337,6 @@ describe Ppl::Application::Bootstrap do
|
|
351
337
|
@colors = {}
|
352
338
|
@config = double(Ppl::Application::Configuration)
|
353
339
|
@bootstrap.stub(:configuration).and_return(@config)
|
354
|
-
@config.should_receive(:color_enabled).with("nick").and_return(true)
|
355
340
|
@config.should_receive(:command_colors).with("nick").and_return(@colors)
|
356
341
|
@bootstrap.format_contact_nicknames
|
357
342
|
end
|
@@ -365,7 +350,6 @@ describe Ppl::Application::Bootstrap do
|
|
365
350
|
@colors = {}
|
366
351
|
@config = double(Ppl::Application::Configuration)
|
367
352
|
@bootstrap.stub(:configuration).and_return(@config)
|
368
|
-
@config.should_receive(:color_enabled).with("org").and_return(true)
|
369
353
|
@config.should_receive(:command_colors).with("org").and_return(@colors)
|
370
354
|
@bootstrap.format_contact_organizations
|
371
355
|
end
|
@@ -379,7 +363,6 @@ describe Ppl::Application::Bootstrap do
|
|
379
363
|
@colors = {}
|
380
364
|
@config = double(Ppl::Application::Configuration)
|
381
365
|
@bootstrap.stub(:configuration).and_return(@config)
|
382
|
-
@config.should_receive(:color_enabled).with("phone").and_return(true)
|
383
366
|
@config.should_receive(:command_colors).with("phone").and_return(@colors)
|
384
367
|
@bootstrap.format_contact_phone_numbers
|
385
368
|
end
|
@@ -399,7 +382,6 @@ describe Ppl::Application::Bootstrap do
|
|
399
382
|
@colors = {}
|
400
383
|
@config = double(Ppl::Application::Configuration)
|
401
384
|
@bootstrap.stub(:configuration).and_return(@config)
|
402
|
-
@config.should_receive(:color_enabled).with("url").and_return(true)
|
403
385
|
@config.should_receive(:command_colors).with("url").and_return(@colors)
|
404
386
|
@bootstrap.format_contact_urls
|
405
387
|
end
|
@@ -540,8 +522,8 @@ describe Ppl::Application::Bootstrap do
|
|
540
522
|
end
|
541
523
|
|
542
524
|
describe "#vcard_adapter" do
|
543
|
-
it "should return a Ppl::Adapter::Vcard::
|
544
|
-
@bootstrap.vcard_adapter.should be_a(Ppl::Adapter::Vcard::
|
525
|
+
it "should return a Ppl::Adapter::Vcard::GreenCard" do
|
526
|
+
@bootstrap.vcard_adapter.should be_a(Ppl::Adapter::Vcard::GreenCard)
|
545
527
|
end
|
546
528
|
end
|
547
529
|
|
@@ -56,20 +56,29 @@ describe Ppl::Application::Configuration do
|
|
56
56
|
|
57
57
|
describe "#command_colors" do
|
58
58
|
|
59
|
-
|
59
|
+
before(:each) do
|
60
|
+
@config.stub(:color_enabled).and_return(true)
|
60
61
|
@config.stub(:user_configuration).and_return({
|
61
62
|
"color \"ls\"" => {
|
62
63
|
"id" => "blue",
|
63
64
|
},
|
64
65
|
})
|
66
|
+
end
|
67
|
+
|
68
|
+
it "should return the colors configured for the given command" do
|
65
69
|
@config.command_colors("ls").should eq({
|
66
70
|
"id" => "blue",
|
67
71
|
})
|
68
72
|
end
|
69
73
|
|
74
|
+
it "should return an empty hash if colors aren't enabled for the command" do
|
75
|
+
@config.stub(:color_enabled).and_return(false)
|
76
|
+
@config.command_colors("ls").should eq({})
|
77
|
+
end
|
78
|
+
|
70
79
|
it "should return nil if no colors are configured for the given command" do
|
71
80
|
@config.stub(:user_configuration).and_return({})
|
72
|
-
@config.command_colors("
|
81
|
+
@config.command_colors("show").should eq(nil)
|
73
82
|
end
|
74
83
|
|
75
84
|
end
|
@@ -5,8 +5,8 @@ describe Ppl::Application::Router do
|
|
5
5
|
@suite = Ppl::Application::CommandSuite.new
|
6
6
|
@router = Ppl::Application::Router.new(@suite)
|
7
7
|
|
8
|
-
@
|
9
|
-
@router.
|
8
|
+
@external = double(Ppl::Command::External)
|
9
|
+
@router.external_command = @external
|
10
10
|
|
11
11
|
@cmd_one = Ppl::Application::Command.new
|
12
12
|
@cmd_one.name = "one"
|
@@ -45,11 +45,11 @@ describe Ppl::Application::Router do
|
|
45
45
|
@router.route("t").should be @cmd_two
|
46
46
|
end
|
47
47
|
|
48
|
-
it "should return a Ppl::Command::
|
49
|
-
@
|
50
|
-
@
|
48
|
+
it "should return a Ppl::Command::External if the input matches a bang alias" do
|
49
|
+
@external.should_receive(:name=).with("t")
|
50
|
+
@external.should_receive(:command=).with("two")
|
51
51
|
@router.aliases = {"t" => "!two"}
|
52
|
-
@router.route("t").should be @
|
52
|
+
@router.route("t").should be @external
|
53
53
|
end
|
54
54
|
|
55
55
|
end
|
@@ -67,11 +67,11 @@ describe Ppl::Application::Shell do
|
|
67
67
|
@shell.run(@input, @output)
|
68
68
|
end
|
69
69
|
|
70
|
-
it "should not do any option parsing for Ppl::Command::
|
71
|
-
|
72
|
-
|
73
|
-
@shell.should_receive(:select_command).and_return(
|
74
|
-
|
70
|
+
it "should not do any option parsing for Ppl::Command::External instances" do
|
71
|
+
external = Ppl::Command::External.new("ls", "ls", "List directory contents")
|
72
|
+
external.stub(:execute).and_return(true)
|
73
|
+
@shell.should_receive(:select_command).and_return(external)
|
74
|
+
external.should_not_receive(:options)
|
75
75
|
@shell.run(@input, @output)
|
76
76
|
end
|
77
77
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
|
2
|
-
describe Ppl::Command::
|
2
|
+
describe Ppl::Command::External do
|
3
3
|
|
4
4
|
before(:each) do
|
5
|
-
@command = Ppl::Command::
|
5
|
+
@command = Ppl::Command::External.new("remote", "git remote", "Execute 'git remote' in the address book directory")
|
6
6
|
@input = Ppl::Application::Input.new
|
7
7
|
@output = double(Ppl::Application::Output)
|
8
8
|
@storage = double(Ppl::Adapter::Storage)
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ppl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.15.
|
5
|
-
prerelease:
|
4
|
+
version: 1.15.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Henry Smith
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-04-11 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: colored
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - '='
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - '='
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: inifile
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - '='
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - '='
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: morphine
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - '='
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - '='
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -62,7 +55,6 @@ dependencies:
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: rugged
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - '='
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,27 +62,66 @@ dependencies:
|
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - '='
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: 0.17.0.b6
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
|
-
name:
|
70
|
+
name: greencard
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
73
|
- - '='
|
84
74
|
- !ruby/object:Gem::Version
|
85
|
-
version:
|
75
|
+
version: 0.0.3
|
86
76
|
type: :runtime
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
80
|
- - '='
|
92
81
|
- !ruby/object:Gem::Version
|
93
|
-
version:
|
82
|
+
version: 0.0.3
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rake
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: fakefs
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
94
125
|
description: CLI Address Book
|
95
126
|
email: henry@henrysmith.org
|
96
127
|
executables:
|
@@ -103,7 +134,6 @@ files:
|
|
103
134
|
- .travis.yml
|
104
135
|
- COPYING
|
105
136
|
- Gemfile
|
106
|
-
- Gemfile.lock
|
107
137
|
- README.md
|
108
138
|
- bin/ppl
|
109
139
|
- lib/ppl.rb
|
@@ -114,7 +144,7 @@ files:
|
|
114
144
|
- lib/ppl/adapter/storage/factory.rb
|
115
145
|
- lib/ppl/adapter/storage/git.rb
|
116
146
|
- lib/ppl/adapter/vcard.rb
|
117
|
-
- lib/ppl/adapter/vcard/
|
147
|
+
- lib/ppl/adapter/vcard/greencard.rb
|
118
148
|
- lib/ppl/application/bootstrap.rb
|
119
149
|
- lib/ppl/application/command.rb
|
120
150
|
- lib/ppl/application/command_suite.rb
|
@@ -128,7 +158,7 @@ files:
|
|
128
158
|
- lib/ppl/command/attribute.rb
|
129
159
|
- lib/ppl/command/bday.rb
|
130
160
|
- lib/ppl/command/email.rb
|
131
|
-
- lib/ppl/command/
|
161
|
+
- lib/ppl/command/external.rb
|
132
162
|
- lib/ppl/command/help.rb
|
133
163
|
- lib/ppl/command/init.rb
|
134
164
|
- lib/ppl/command/ls.rb
|
@@ -183,7 +213,7 @@ files:
|
|
183
213
|
- spec/ppl/adapter/storage/factory_spec.rb
|
184
214
|
- spec/ppl/adapter/storage/git_spec.rb
|
185
215
|
- spec/ppl/adapter/storage_spec.rb
|
186
|
-
- spec/ppl/adapter/vcard/
|
216
|
+
- spec/ppl/adapter/vcard/greencard_spec.rb
|
187
217
|
- spec/ppl/adapter/vcard_spec.rb
|
188
218
|
- spec/ppl/application/bootstrap_spec.rb
|
189
219
|
- spec/ppl/application/command_spec.rb
|
@@ -197,7 +227,7 @@ files:
|
|
197
227
|
- spec/ppl/command/attribute_spec.rb
|
198
228
|
- spec/ppl/command/bday_spec.rb
|
199
229
|
- spec/ppl/command/email_spec.rb
|
200
|
-
- spec/ppl/command/
|
230
|
+
- spec/ppl/command/external_spec.rb
|
201
231
|
- spec/ppl/command/help_spec.rb
|
202
232
|
- spec/ppl/command/init_spec.rb
|
203
233
|
- spec/ppl/command/ls_spec.rb
|
@@ -246,26 +276,25 @@ files:
|
|
246
276
|
homepage: http://ppladdressbook.org
|
247
277
|
licenses:
|
248
278
|
- GPL-2
|
279
|
+
metadata: {}
|
249
280
|
post_install_message:
|
250
281
|
rdoc_options: []
|
251
282
|
require_paths:
|
252
283
|
- lib
|
253
284
|
required_ruby_version: !ruby/object:Gem::Requirement
|
254
|
-
none: false
|
255
285
|
requirements:
|
256
|
-
- -
|
286
|
+
- - '>='
|
257
287
|
- !ruby/object:Gem::Version
|
258
288
|
version: 1.9.3
|
259
289
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
260
|
-
none: false
|
261
290
|
requirements:
|
262
|
-
- -
|
291
|
+
- - '>='
|
263
292
|
- !ruby/object:Gem::Version
|
264
293
|
version: '0'
|
265
294
|
requirements: []
|
266
295
|
rubyforge_project:
|
267
|
-
rubygems_version:
|
296
|
+
rubygems_version: 2.0.3
|
268
297
|
signing_key:
|
269
|
-
specification_version:
|
298
|
+
specification_version: 4
|
270
299
|
summary: CLI Address Book
|
271
300
|
test_files: []
|
data/Gemfile.lock
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
GIT
|
2
|
-
remote: git://github.com/sam-github/vpim.git
|
3
|
-
revision: 6753a367cda64e53eab745414cedc130d2f149c8
|
4
|
-
specs:
|
5
|
-
vpim (12.1.12)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
diff-lcs (1.1.3)
|
11
|
-
fakefs (0.4.1)
|
12
|
-
inifile (2.0.2)
|
13
|
-
morphine (0.1.1)
|
14
|
-
rake (10.0.1)
|
15
|
-
rspec (2.12.0)
|
16
|
-
rspec-core (~> 2.12.0)
|
17
|
-
rspec-expectations (~> 2.12.0)
|
18
|
-
rspec-mocks (~> 2.12.0)
|
19
|
-
rspec-core (2.12.0)
|
20
|
-
rspec-expectations (2.12.0)
|
21
|
-
diff-lcs (~> 1.1.3)
|
22
|
-
rspec-mocks (2.12.0)
|
23
|
-
rugged (0.17.0.b6)
|
24
|
-
|
25
|
-
PLATFORMS
|
26
|
-
ruby
|
27
|
-
|
28
|
-
DEPENDENCIES
|
29
|
-
fakefs
|
30
|
-
inifile (= 2.0.2)
|
31
|
-
morphine (= 0.1.1)
|
32
|
-
rake
|
33
|
-
rspec
|
34
|
-
rugged (= 0.17.0.b6)
|
35
|
-
vpim (= 12.1.12)!
|