ppl 3.0.0 → 4.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.editorconfig +16 -0
- data/.eleventy.js +86 -0
- data/.eleventyignore +1 -0
- data/.github/workflows/build.yml +61 -0
- data/.gitignore +3 -1
- data/Rakefile +1 -18
- data/{CODE_OF_CONDUCT.md → code_of_conduct.md} +1 -1
- data/features/step_definitions/ppl_steps.rb +27 -27
- data/gh-pages/Gemfile +2 -0
- data/gh-pages/_config.yml +5 -0
- data/gh-pages/_includes/changelog.html +23 -0
- data/gh-pages/_includes/development-sidebar.html +25 -0
- data/gh-pages/_includes/footer.html +22 -0
- data/gh-pages/_includes/header.html +43 -0
- data/gh-pages/_includes/news.html +36 -0
- data/gh-pages/_includes/tip.html +54 -0
- data/gh-pages/_layouts/changelog.html +1 -0
- data/gh-pages/_layouts/command.html +104 -0
- data/gh-pages/_layouts/configuration.html +71 -0
- data/gh-pages/_layouts/development.html +20 -0
- data/gh-pages/_layouts/frontpage.html +6 -0
- data/gh-pages/_layouts/integration.html +44 -0
- data/gh-pages/_layouts/news.html +2 -0
- data/gh-pages/_layouts/page.html +6 -0
- data/gh-pages/_layouts/tip.html +2 -0
- data/gh-pages/_posts/2012-01-15-first-post.md +16 -0
- data/gh-pages/_posts/2012-12-20-1.0.0.md +19 -0
- data/gh-pages/_posts/2012-12-20-1.1.0.md +28 -0
- data/gh-pages/_posts/2012-12-20-1.2.0.md +18 -0
- data/gh-pages/_posts/2012-12-21-1.3.0.md +20 -0
- data/gh-pages/_posts/2012-12-21-thank-you-for-your-all-your-feedback.md +26 -0
- data/gh-pages/_posts/2012-12-22-1.4.1.md +21 -0
- data/gh-pages/_posts/2012-12-22-1.5.0.md +17 -0
- data/gh-pages/_posts/2012-12-23-1.5.1.md +13 -0
- data/gh-pages/_posts/2012-12-23-1.5.2.md +15 -0
- data/gh-pages/_posts/2012-12-26-1.5.3.md +19 -0
- data/gh-pages/_posts/2012-12-27-1.6.0.md +18 -0
- data/gh-pages/_posts/2012-12-29-1.7.0.md +18 -0
- data/gh-pages/_posts/2013-01-05-1.8.0.md +18 -0
- data/gh-pages/_posts/2013-01-06-1.9.0.md +20 -0
- data/gh-pages/_posts/2013-01-10-1.10.0.md +18 -0
- data/gh-pages/_posts/2013-01-20-1.11.0.md +14 -0
- data/gh-pages/_posts/2013-02-16-1.12.0.md +14 -0
- data/gh-pages/_posts/2013-02-17-1.13.0.md +29 -0
- data/gh-pages/_posts/2013-02-17-1.14.0.md +15 -0
- data/gh-pages/_posts/2013-02-17-1.14.1.md +18 -0
- data/gh-pages/_posts/2013-02-17-two-months-in.md +27 -0
- data/gh-pages/_posts/2013-03-16-1.15.0.md +28 -0
- data/gh-pages/_posts/2013-03-16-coloured-output-released.md +27 -0
- data/gh-pages/_posts/2013-04-10-ruby-2.0-compatibility.md +28 -0
- data/gh-pages/_posts/2013-04-11-1.15.1.md +13 -0
- data/gh-pages/_posts/2013-04-12-1.16.0.md +22 -0
- data/gh-pages/_posts/2013-04-14-1.17.0.md +15 -0
- data/gh-pages/_posts/2013-04-14-1.17.1.md +20 -0
- data/gh-pages/_posts/2013-04-14-1.17.2.md +13 -0
- data/gh-pages/_posts/2013-04-15-sync-alias.md +31 -0
- data/gh-pages/_posts/2013-04-15-utf8-fixed-and-more.md +37 -0
- data/gh-pages/_posts/2013-04-16-1.18.0.md +15 -0
- data/gh-pages/_posts/2013-04-16-set-up-color-output.md +47 -0
- data/gh-pages/_posts/2013-04-19-1.19.0.md +13 -0
- data/gh-pages/_posts/2013-04-19-1.20.0.md +15 -0
- data/gh-pages/_posts/2013-04-20-1.21.0.md +16 -0
- data/gh-pages/_posts/2013-04-20-1.22.0.md +14 -0
- data/gh-pages/_posts/2013-04-20-1.22.1.md +13 -0
- data/gh-pages/_posts/2013-04-21-1.22.2.md +15 -0
- data/gh-pages/_posts/2013-04-21-1.23.0.md +35 -0
- data/gh-pages/_posts/2013-04-23-1.24.0.md +16 -0
- data/gh-pages/_posts/2013-04-24-1.25.0.md +21 -0
- data/gh-pages/_posts/2013-05-09-2.0.0.md +33 -0
- data/gh-pages/_posts/2013-05-09-version-2.0.0-released.md +32 -0
- data/gh-pages/_posts/2013-07-20-2.1.0.md +36 -0
- data/gh-pages/_posts/2013-07-20-2.2.0.md +20 -0
- data/gh-pages/_posts/2013-10-12-2.3.0.md +19 -0
- data/gh-pages/_posts/2014-03-30-2.3.1.md +25 -0
- data/gh-pages/_posts/2015-01-05-2.3.2.md +18 -0
- data/gh-pages/_posts/2015-12-03-get-involved.md +29 -0
- data/gh-pages/_posts/2015-12-05-2.3.3.md +16 -0
- data/gh-pages/_posts/2016-01-02-2.4.0.md +19 -0
- data/gh-pages/_posts/2017-05-01-2.4.1.md +12 -0
- data/gh-pages/_posts/2017-10-23-sleep-mode.md +18 -0
- data/gh-pages/_posts/2018-01-03-3.0.1.md +12 -0
- data/gh-pages/_stylesheets/ppl/color.less +119 -0
- data/gh-pages/_stylesheets/ppl/layout.less +54 -0
- data/gh-pages/_stylesheets/ppl/style.less +185 -0
- data/gh-pages/_stylesheets/ppl/typography.less +59 -0
- data/gh-pages/development/changelog/index.md +18 -0
- data/gh-pages/development/changelog/split.rb +51 -0
- data/gh-pages/development/index.html +32 -0
- data/gh-pages/development/roadmap/index.md +15 -0
- data/gh-pages/documentation/about/index.html +63 -0
- data/gh-pages/documentation/commands/add/index.md +43 -0
- data/gh-pages/documentation/commands/age/add/index.md +40 -0
- data/gh-pages/documentation/commands/age/index.md +38 -0
- data/gh-pages/documentation/commands/bday/index.md +44 -0
- data/gh-pages/documentation/commands/completion/index.md +38 -0
- data/gh-pages/documentation/commands/email/index.md +64 -0
- data/gh-pages/documentation/commands/grep/index.md +32 -0
- data/gh-pages/documentation/commands/init/index.md +28 -0
- data/gh-pages/documentation/commands/ls/index.md +55 -0
- data/gh-pages/documentation/commands/mutt/index.md +36 -0
- data/gh-pages/documentation/commands/mv/index.md +26 -0
- data/gh-pages/documentation/commands/name/index.md +45 -0
- data/gh-pages/documentation/commands/nick/index.md +44 -0
- data/gh-pages/documentation/commands/org/index.md +45 -0
- data/gh-pages/documentation/commands/phone/index.md +56 -0
- data/gh-pages/documentation/commands/post/index.md +61 -0
- data/gh-pages/documentation/commands/pull/index.md +39 -0
- data/gh-pages/documentation/commands/push/index.md +36 -0
- data/gh-pages/documentation/commands/remote/index.md +40 -0
- data/gh-pages/documentation/commands/rm/index.md +23 -0
- data/gh-pages/documentation/commands/scrape/index.md +38 -0
- data/gh-pages/documentation/commands/shell/index.md +39 -0
- data/gh-pages/documentation/commands/show/index.md +33 -0
- data/gh-pages/documentation/commands/url/index.md +44 -0
- data/gh-pages/documentation/commands/version/index.md +27 -0
- data/gh-pages/documentation/configuration/address_book/index.md +22 -0
- data/gh-pages/documentation/configuration/alias/index.md +45 -0
- data/gh-pages/documentation/configuration/color/index.md +47 -0
- data/gh-pages/documentation/configuration/color_age/index.md +20 -0
- data/gh-pages/documentation/configuration/color_bday/index.md +20 -0
- data/gh-pages/documentation/configuration/color_email/index.md +21 -0
- data/gh-pages/documentation/configuration/color_ls/index.md +21 -0
- data/gh-pages/documentation/configuration/color_name/index.md +20 -0
- data/gh-pages/documentation/configuration/color_nick/index.md +20 -0
- data/gh-pages/documentation/configuration/color_org/index.md +20 -0
- data/gh-pages/documentation/configuration/color_phone/index.md +22 -0
- data/gh-pages/documentation/configuration/color_post/index.md +20 -0
- data/gh-pages/documentation/configuration/color_url/index.md +20 -0
- data/gh-pages/documentation/configuration/index.html +8 -0
- data/gh-pages/documentation/index.html +183 -0
- data/gh-pages/documentation/integration/bash/index.md +23 -0
- data/gh-pages/documentation/integration/google/index.md +26 -0
- data/gh-pages/documentation/integration/index.html +8 -0
- data/gh-pages/documentation/integration/mutt/index.md +35 -0
- data/gh-pages/documentation/integration/zsh/index.md +19 -0
- data/gh-pages/documentation/quick-start/index.html +88 -0
- data/gh-pages/documentation/tips/index.html +9 -0
- data/gh-pages/index.html +108 -0
- data/gh-pages/news/index.html +9 -0
- data/gh-pages/robots.txt +3 -0
- data/gh-pages/stylesheets/flatstrap.css +10 -0
- data/gh-pages/stylesheets/ppl.scss +235 -0
- data/gh-pages/wiki.png +0 -0
- data/lib/ppl.rb +4 -1
- data/lib/ppl/adapter/color.rb +0 -1
- data/lib/ppl/adapter/color/colored.rb +0 -1
- data/lib/ppl/adapter/email_scraper.rb +0 -1
- data/lib/ppl/adapter/email_scraper/mail.rb +4 -5
- data/lib/ppl/adapter/storage.rb +0 -1
- data/lib/ppl/adapter/storage/disk.rb +0 -1
- data/lib/ppl/adapter/storage/factory.rb +0 -1
- data/lib/ppl/adapter/vcard.rb +0 -1
- data/lib/ppl/adapter/vcard/vpim.rb +5 -1
- data/lib/ppl/application/bootstrap.rb +0 -1
- data/lib/ppl/application/command.rb +0 -1
- data/lib/ppl/application/command_suite.rb +0 -1
- data/lib/ppl/application/configuration.rb +0 -1
- data/lib/ppl/application/input.rb +0 -1
- data/lib/ppl/application/output.rb +0 -1
- data/lib/ppl/application/router.rb +0 -1
- data/lib/ppl/application/shell.rb +0 -1
- data/lib/ppl/command/add.rb +0 -1
- data/lib/ppl/command/age.rb +0 -1
- data/lib/ppl/command/attribute.rb +0 -1
- data/lib/ppl/command/bday.rb +0 -1
- data/lib/ppl/command/completion.rb +0 -1
- data/lib/ppl/command/email.rb +0 -1
- data/lib/ppl/command/external.rb +0 -1
- data/lib/ppl/command/help.rb +0 -1
- data/lib/ppl/command/init.rb +0 -1
- data/lib/ppl/command/ls.rb +0 -1
- data/lib/ppl/command/mutt.rb +0 -1
- data/lib/ppl/command/mv.rb +0 -1
- data/lib/ppl/command/name.rb +0 -1
- data/lib/ppl/command/nick.rb +0 -1
- data/lib/ppl/command/org.rb +0 -1
- data/lib/ppl/command/phone.rb +0 -1
- data/lib/ppl/command/post.rb +0 -1
- data/lib/ppl/command/rm.rb +0 -1
- data/lib/ppl/command/scrape.rb +0 -1
- data/lib/ppl/command/shell.rb +0 -1
- data/lib/ppl/command/show.rb +0 -1
- data/lib/ppl/command/url.rb +0 -1
- data/lib/ppl/command/version.rb +0 -1
- data/lib/ppl/entity/address_book.rb +0 -1
- data/lib/ppl/entity/contact.rb +0 -1
- data/lib/ppl/entity/email_address.rb +0 -1
- data/lib/ppl/entity/name.rb +0 -1
- data/lib/ppl/entity/phone_number.rb +0 -1
- data/lib/ppl/entity/postal_address.rb +0 -1
- data/lib/ppl/error/completion_not_found.rb +0 -1
- data/lib/ppl/error/contact_not_found.rb +0 -1
- data/lib/ppl/error/incorrect_usage.rb +0 -1
- data/lib/ppl/error/invalid_vcard.rb +1 -0
- data/lib/ppl/error/postal_address_not_found.rb +0 -1
- data/lib/ppl/format/address_book.rb +0 -1
- data/lib/ppl/format/address_book/ages.rb +0 -1
- data/lib/ppl/format/address_book/birthdays.rb +0 -1
- data/lib/ppl/format/address_book/email_addresses.rb +0 -1
- data/lib/ppl/format/address_book/mutt_query.rb +0 -1
- data/lib/ppl/format/address_book/names.rb +0 -1
- data/lib/ppl/format/address_book/nicknames.rb +0 -1
- data/lib/ppl/format/address_book/one_line.rb +0 -1
- data/lib/ppl/format/address_book/organizations.rb +0 -1
- data/lib/ppl/format/address_book/phone_numbers.rb +0 -1
- data/lib/ppl/format/address_book/postal_addresses.rb +0 -1
- data/lib/ppl/format/address_book/urls.rb +0 -1
- data/lib/ppl/format/contact.rb +0 -1
- data/lib/ppl/format/contact/age.rb +0 -1
- data/lib/ppl/format/contact/birthday.rb +0 -1
- data/lib/ppl/format/contact/email_addresses.rb +0 -1
- data/lib/ppl/format/contact/full.rb +0 -1
- data/lib/ppl/format/contact/nicknames.rb +0 -1
- data/lib/ppl/format/contact/organization.rb +0 -1
- data/lib/ppl/format/contact/phone_number.rb +0 -1
- data/lib/ppl/format/contact/postal_address.rb +0 -1
- data/lib/ppl/format/contact/postal_addresses.rb +0 -1
- data/lib/ppl/format/contact/urls.rb +0 -1
- data/lib/ppl/format/custom.rb +0 -1
- data/lib/ppl/format/custom/contact.rb +0 -1
- data/lib/ppl/format/custom/email_address.rb +0 -1
- data/lib/ppl/format/custom/phone_number.rb +0 -1
- data/lib/ppl/format/name.rb +0 -1
- data/lib/ppl/format/name/full_only.rb +0 -1
- data/lib/ppl/format/postal_address.rb +0 -1
- data/lib/ppl/format/postal_address/multi_line.rb +0 -1
- data/lib/ppl/format/postal_address/one_line.rb +0 -1
- data/lib/ppl/format/table.rb +0 -1
- data/lib/ppl/service/email_address.rb +0 -1
- data/lib/ppl/service/name.rb +0 -1
- data/lib/ppl/service/phone_number.rb +0 -1
- data/lib/ppl/service/postal_address.rb +0 -1
- data/{LICENSE → license} +0 -0
- data/makefile +18 -0
- data/package.json +23 -0
- data/ppl.gemspec +15 -13
- data/{README.md → readme.md} +12 -9
- data/site/_data/url.js +4 -0
- data/site/casts/hero.cast +189 -0
- data/site/development.njk +6 -0
- data/site/documentation.njk +6 -0
- data/site/index.njk +75 -0
- data/site/news.njk +6 -0
- data/site/style.scss +140 -0
- data/spec/ppl/adapter/color/colored_spec.rb +3 -4
- data/spec/ppl/adapter/color_spec.rb +0 -1
- data/spec/ppl/adapter/email_scraper/mail_spec.rb +13 -13
- data/spec/ppl/adapter/email_scraper_spec.rb +0 -1
- data/spec/ppl/adapter/output_spec.rb +7 -8
- data/spec/ppl/adapter/storage/disk_spec.rb +18 -19
- data/spec/ppl/adapter/storage/factory_spec.rb +3 -4
- data/spec/ppl/adapter/storage/git_spec.rb +31 -32
- data/spec/ppl/adapter/storage_spec.rb +3 -4
- data/spec/ppl/adapter/vcard/greencard_spec.rb +45 -45
- data/spec/ppl/adapter/vcard_spec.rb +0 -1
- data/spec/ppl/application/bootstrap_spec.rb +128 -129
- data/spec/ppl/application/command_spec.rb +8 -9
- data/spec/ppl/application/command_suite_spec.rb +7 -8
- data/spec/ppl/application/configuration_spec.rb +16 -17
- data/spec/ppl/application/input_spec.rb +2 -3
- data/spec/ppl/application/router_spec.rb +8 -9
- data/spec/ppl/application/shell_spec.rb +39 -40
- data/spec/ppl/command/add_spec.rb +6 -7
- data/spec/ppl/command/age_spec.rb +7 -8
- data/spec/ppl/command/attribute_spec.rb +22 -23
- data/spec/ppl/command/bday_spec.rb +11 -12
- data/spec/ppl/command/completion_spec.rb +7 -8
- data/spec/ppl/command/email_spec.rb +19 -20
- data/spec/ppl/command/external_spec.rb +7 -8
- data/spec/ppl/command/help_spec.rb +15 -16
- data/spec/ppl/command/init_spec.rb +5 -6
- data/spec/ppl/command/ls_spec.rb +12 -13
- data/spec/ppl/command/mutt_spec.rb +33 -34
- data/spec/ppl/command/mv_spec.rb +11 -12
- data/spec/ppl/command/name_spec.rb +17 -18
- data/spec/ppl/command/nick_spec.rb +1 -2
- data/spec/ppl/command/org_spec.rb +1 -2
- data/spec/ppl/command/phone_spec.rb +15 -16
- data/spec/ppl/command/post_spec.rb +29 -30
- data/spec/ppl/command/rm_spec.rb +3 -4
- data/spec/ppl/command/scrape_spec.rb +24 -25
- data/spec/ppl/command/shell_spec.rb +41 -42
- data/spec/ppl/command/show_spec.rb +4 -5
- data/spec/ppl/command/url_spec.rb +1 -2
- data/spec/ppl/command/version_spec.rb +4 -5
- data/spec/ppl/entity/address_book_spec.rb +1 -2
- data/spec/ppl/entity/contact_spec.rb +16 -17
- data/spec/ppl/entity/email_address_spec.rb +3 -4
- data/spec/ppl/entity/name_spec.rb +1 -2
- data/spec/ppl/entity/phone_number_spec.rb +5 -6
- data/spec/ppl/entity/postal_address_spec.rb +2 -3
- data/spec/ppl/format/address_book/ages_spec.rb +3 -4
- data/spec/ppl/format/address_book/birthdays_spec.rb +3 -4
- data/spec/ppl/format/address_book/email_addresses_spec.rb +3 -4
- data/spec/ppl/format/address_book/mutt_query_spec.rb +3 -4
- data/spec/ppl/format/address_book/names_spec.rb +3 -4
- data/spec/ppl/format/address_book/nicknames_spec.rb +4 -5
- data/spec/ppl/format/address_book/one_line_spec.rb +5 -6
- data/spec/ppl/format/address_book/organizations_spec.rb +3 -4
- data/spec/ppl/format/address_book/phone_numbers_spec.rb +3 -4
- data/spec/ppl/format/address_book/postal_addresses_spec.rb +2 -3
- data/spec/ppl/format/address_book/urls_spec.rb +3 -4
- data/spec/ppl/format/address_book_spec.rb +0 -1
- data/spec/ppl/format/contact/age_spec.rb +8 -9
- data/spec/ppl/format/contact/birthday_spec.rb +4 -5
- data/spec/ppl/format/contact/email_addresses_spec.rb +3 -4
- data/spec/ppl/format/contact/full_spec.rb +11 -12
- data/spec/ppl/format/contact/nicknames_spec.rb +4 -5
- data/spec/ppl/format/contact/organization_spec.rb +4 -5
- data/spec/ppl/format/contact/phone_number_spec.rb +4 -5
- data/spec/ppl/format/contact/postal_address_spec.rb +1 -2
- data/spec/ppl/format/contact/postal_addresses_spec.rb +3 -4
- data/spec/ppl/format/contact/urls_spec.rb +4 -5
- data/spec/ppl/format/contact_spec.rb +0 -1
- data/spec/ppl/format/custom/contact_spec.rb +13 -14
- data/spec/ppl/format/custom/email_address_spec.rb +3 -4
- data/spec/ppl/format/custom/phone_number_spec.rb +4 -5
- data/spec/ppl/format/custom_spec.rb +6 -7
- data/spec/ppl/format/name/full_only_spec.rb +4 -5
- data/spec/ppl/format/name_spec.rb +0 -1
- data/spec/ppl/format/postal_address/multi_line_spec.rb +10 -11
- data/spec/ppl/format/postal_address/one_line_spec.rb +9 -10
- data/spec/ppl/format/postal_address_spec.rb +0 -1
- data/spec/ppl/format/table_spec.rb +11 -11
- data/spec/ppl/service/email_address_spec.rb +13 -14
- data/spec/ppl/service/name_spec.rb +9 -10
- data/spec/ppl/service/phone_number_spec.rb +11 -12
- data/spec/ppl/service/postal_address_spec.rb +20 -21
- data/spec/spec_helper.rb +4 -0
- data/yarn.lock +3605 -0
- metadata +183 -22
- data/.travis.yml +0 -11
- data/COPYING +0 -339
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
describe Ppl::Entity::EmailAddress do
|
3
2
|
|
4
3
|
before(:each) do
|
@@ -7,20 +6,20 @@ describe Ppl::Entity::EmailAddress do
|
|
7
6
|
|
8
7
|
describe "#address" do
|
9
8
|
it "should return a value" do
|
10
|
-
@email_address.address.
|
9
|
+
expect(@email_address.address).to eq nil
|
11
10
|
end
|
12
11
|
end
|
13
12
|
|
14
13
|
describe "#preferred" do
|
15
14
|
it "should be false by default" do
|
16
|
-
@email_address.preferred.
|
15
|
+
expect(@email_address.preferred).to eq false
|
17
16
|
end
|
18
17
|
end
|
19
18
|
|
20
19
|
describe "#initialize" do
|
21
20
|
it "should accept an address" do
|
22
21
|
email = Ppl::Entity::EmailAddress.new("bob@example.org")
|
23
|
-
email.address.
|
22
|
+
expect(email.address).to eq "bob@example.org"
|
24
23
|
end
|
25
24
|
end
|
26
25
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
describe Ppl::Entity::Name do
|
3
2
|
|
4
3
|
before(:each) do
|
@@ -8,7 +7,7 @@ describe Ppl::Entity::Name do
|
|
8
7
|
describe "#to_s" do
|
9
8
|
it "returns the full name" do
|
10
9
|
@name.full = "Mr. Testing"
|
11
|
-
@name.to_s.
|
10
|
+
expect(@name.to_s).to eq "Mr. Testing"
|
12
11
|
end
|
13
12
|
end
|
14
13
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
describe Ppl::Entity::PhoneNumber do
|
3
2
|
|
4
3
|
before(:each) do
|
@@ -7,30 +6,30 @@ describe Ppl::Entity::PhoneNumber do
|
|
7
6
|
|
8
7
|
describe "#number" do
|
9
8
|
it "should return a value" do
|
10
|
-
@phone_number.number.
|
9
|
+
expect(@phone_number.number).to eq nil
|
11
10
|
end
|
12
11
|
end
|
13
12
|
|
14
13
|
describe "#preferred" do
|
15
14
|
it "should be false by default" do
|
16
|
-
@phone_number.preferred.
|
15
|
+
expect(@phone_number.preferred).to eq false
|
17
16
|
end
|
18
17
|
end
|
19
18
|
|
20
19
|
describe "#type" do
|
21
20
|
it "should return a value" do
|
22
|
-
@phone_number.type.
|
21
|
+
expect(@phone_number.type).to eq nil
|
23
22
|
end
|
24
23
|
end
|
25
24
|
|
26
25
|
describe "#initialize" do
|
27
26
|
it "should accept a number" do
|
28
27
|
phone = Ppl::Entity::PhoneNumber.new(12345)
|
29
|
-
phone.number.
|
28
|
+
expect(phone.number).to eq 12345
|
30
29
|
end
|
31
30
|
it "should accept a type" do
|
32
31
|
phone = Ppl::Entity::PhoneNumber.new(nil, "cell")
|
33
|
-
phone.type.
|
32
|
+
expect(phone.type).to eq "cell"
|
34
33
|
end
|
35
34
|
end
|
36
35
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
describe Ppl::Entity::PostalAddress do
|
3
2
|
|
4
3
|
before(:each) do
|
@@ -7,13 +6,13 @@ describe Ppl::Entity::PostalAddress do
|
|
7
6
|
|
8
7
|
describe "#preferred" do
|
9
8
|
it "should be false by default" do
|
10
|
-
@address.preferred.
|
9
|
+
expect(@address.preferred).to eq false
|
11
10
|
end
|
12
11
|
end
|
13
12
|
|
14
13
|
describe "#street" do
|
15
14
|
it "should return a value" do
|
16
|
-
@address.street.
|
15
|
+
expect(@address.street).to be nil
|
17
16
|
end
|
18
17
|
end
|
19
18
|
|
@@ -1,9 +1,8 @@
|
|
1
|
-
|
2
1
|
describe Ppl::Format::AddressBook::Ages do
|
3
2
|
describe "#initialize" do
|
4
3
|
it "should pass the colors through to the table" do
|
5
4
|
colors = {"id" => "blue"}
|
6
|
-
Ppl::Format::Table.
|
5
|
+
expect(Ppl::Format::Table).to receive(:new).with([:id, :age], colors)
|
7
6
|
format = Ppl::Format::AddressBook::Ages.new(colors)
|
8
7
|
end
|
9
8
|
end
|
@@ -25,7 +24,7 @@ describe Ppl::Format::AddressBook::Ages do
|
|
25
24
|
describe "#process" do
|
26
25
|
|
27
26
|
it "should at least show the contact's id" do
|
28
|
-
@table.
|
27
|
+
expect(@table).to receive(:add_row).with({
|
29
28
|
:id => "test:",
|
30
29
|
:age => "",
|
31
30
|
})
|
@@ -34,7 +33,7 @@ describe Ppl::Format::AddressBook::Ages do
|
|
34
33
|
|
35
34
|
it "should show an age if it's available" do
|
36
35
|
@contact.birthday = Date.parse("1970-01-01")
|
37
|
-
@table.
|
36
|
+
expect(@table).to receive(:add_row).with({
|
38
37
|
:id => "test:",
|
39
38
|
:age => "10",
|
40
39
|
})
|
@@ -1,9 +1,8 @@
|
|
1
|
-
|
2
1
|
describe Ppl::Format::AddressBook::Birthdays do
|
3
2
|
describe "#initialize" do
|
4
3
|
it "should pass the colors through to the table" do
|
5
4
|
colors = {"id" => "blue"}
|
6
|
-
Ppl::Format::Table.
|
5
|
+
expect(Ppl::Format::Table).to receive(:new).with([:id, :birthday], colors)
|
7
6
|
format = Ppl::Format::AddressBook::Birthdays.new(colors)
|
8
7
|
end
|
9
8
|
end
|
@@ -26,7 +25,7 @@ describe Ppl::Format::AddressBook::Birthdays do
|
|
26
25
|
describe "#process" do
|
27
26
|
|
28
27
|
it "should at least show the contact's id" do
|
29
|
-
@table.
|
28
|
+
expect(@table).to receive(:add_row).with({
|
30
29
|
:id => "test:",
|
31
30
|
:birthday => nil,
|
32
31
|
})
|
@@ -35,7 +34,7 @@ describe Ppl::Format::AddressBook::Birthdays do
|
|
35
34
|
|
36
35
|
it "should show the birthday if it's available" do
|
37
36
|
@contact.birthday = Date.parse("2001-02-03")
|
38
|
-
@table.
|
37
|
+
expect(@table).to receive(:add_row).with({
|
39
38
|
:id => "test:",
|
40
39
|
:birthday => "2001-02-03",
|
41
40
|
})
|
@@ -1,9 +1,8 @@
|
|
1
|
-
|
2
1
|
describe Ppl::Format::AddressBook::EmailAddresses do
|
3
2
|
describe "#initialize" do
|
4
3
|
it "should pass the colors through to the table" do
|
5
4
|
colors = {"id" => "blue"}
|
6
|
-
Ppl::Format::Table.
|
5
|
+
expect(Ppl::Format::Table).to receive(:new).with([:id, :email_addresses], colors)
|
7
6
|
format = Ppl::Format::AddressBook::EmailAddresses.new(colors)
|
8
7
|
end
|
9
8
|
end
|
@@ -26,7 +25,7 @@ describe Ppl::Format::AddressBook::EmailAddresses do
|
|
26
25
|
describe "#process" do
|
27
26
|
|
28
27
|
it "should at least show the contact's id" do
|
29
|
-
@table.
|
28
|
+
expect(@table).to receive(:add_row).with({
|
30
29
|
:id => "test:",
|
31
30
|
:email_addresses => "",
|
32
31
|
})
|
@@ -35,7 +34,7 @@ describe Ppl::Format::AddressBook::EmailAddresses do
|
|
35
34
|
|
36
35
|
it "should show an email address if it's available" do
|
37
36
|
@contact.email_addresses << Ppl::Entity::EmailAddress.new("jdoe@example.org")
|
38
|
-
@table.
|
37
|
+
expect(@table).to receive(:add_row).with({
|
39
38
|
:id => "test:",
|
40
39
|
:email_addresses => "jdoe@example.org",
|
41
40
|
})
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
describe Ppl::Format::AddressBook::MuttQuery do
|
3
2
|
|
4
3
|
before(:each) do
|
@@ -17,7 +16,7 @@ describe Ppl::Format::AddressBook::MuttQuery do
|
|
17
16
|
describe "#process" do
|
18
17
|
|
19
18
|
it "should list the given contacts" do
|
20
|
-
@table.
|
19
|
+
expect(@table).to receive(:add_row).with({
|
21
20
|
:email => "test@example.org",
|
22
21
|
:name => "Test Contact",
|
23
22
|
})
|
@@ -26,11 +25,11 @@ describe Ppl::Format::AddressBook::MuttQuery do
|
|
26
25
|
|
27
26
|
it "should list all of each contact's email addresses" do
|
28
27
|
@contact.email_addresses << Ppl::Entity::EmailAddress.new("test2@example.com")
|
29
|
-
@table.
|
28
|
+
expect(@table).to receive(:add_row).with({
|
30
29
|
:email => "test@example.org",
|
31
30
|
:name => "Test Contact",
|
32
31
|
})
|
33
|
-
@table.
|
32
|
+
expect(@table).to receive(:add_row).with({
|
34
33
|
:email => "test2@example.com",
|
35
34
|
:name => "Test Contact",
|
36
35
|
})
|
@@ -1,9 +1,8 @@
|
|
1
|
-
|
2
1
|
describe Ppl::Format::AddressBook::Names do
|
3
2
|
describe "#initialize" do
|
4
3
|
it "should pass the colors through to the table" do
|
5
4
|
colors = {"id" => "blue"}
|
6
|
-
Ppl::Format::Table.
|
5
|
+
expect(Ppl::Format::Table).to receive(:new).with([:id, :name], colors)
|
7
6
|
format = Ppl::Format::AddressBook::Names.new(colors)
|
8
7
|
end
|
9
8
|
end
|
@@ -26,7 +25,7 @@ describe Ppl::Format::AddressBook::Names do
|
|
26
25
|
describe "#process" do
|
27
26
|
|
28
27
|
it "should at least show the contact's id" do
|
29
|
-
@table.
|
28
|
+
expect(@table).to receive(:add_row).with({
|
30
29
|
:id => "test:",
|
31
30
|
:name => nil,
|
32
31
|
})
|
@@ -35,7 +34,7 @@ describe Ppl::Format::AddressBook::Names do
|
|
35
34
|
|
36
35
|
it "should show the name if it's available" do
|
37
36
|
@contact.name = "John Doe"
|
38
|
-
@table.
|
37
|
+
expect(@table).to receive(:add_row).with({
|
39
38
|
:id => "test:",
|
40
39
|
:name => "John Doe",
|
41
40
|
})
|
@@ -1,9 +1,8 @@
|
|
1
|
-
|
2
1
|
describe Ppl::Format::AddressBook::Nicknames do
|
3
2
|
describe "#initialize" do
|
4
3
|
it "should pass the colors through to the table" do
|
5
4
|
colors = {"id" => "blue"}
|
6
|
-
Ppl::Format::Table.
|
5
|
+
expect(Ppl::Format::Table).to receive(:new).with([:id, :nicknames], colors)
|
7
6
|
format = Ppl::Format::AddressBook::Nicknames.new(colors)
|
8
7
|
end
|
9
8
|
end
|
@@ -26,7 +25,7 @@ describe Ppl::Format::AddressBook::Nicknames do
|
|
26
25
|
describe "#process" do
|
27
26
|
|
28
27
|
it "should at least show the contact's id" do
|
29
|
-
@table.
|
28
|
+
expect(@table).to receive(:add_row).with({
|
30
29
|
:id => "test:",
|
31
30
|
:nicknames => "",
|
32
31
|
})
|
@@ -35,7 +34,7 @@ describe Ppl::Format::AddressBook::Nicknames do
|
|
35
34
|
|
36
35
|
it "should show a nickname if it's available" do
|
37
36
|
@contact.nicknames.push("Stupid")
|
38
|
-
@table.
|
37
|
+
expect(@table).to receive(:add_row).with({
|
39
38
|
:id => "test:",
|
40
39
|
:nicknames => "Stupid",
|
41
40
|
})
|
@@ -46,7 +45,7 @@ describe Ppl::Format::AddressBook::Nicknames do
|
|
46
45
|
|
47
46
|
describe "#disable_colors!" do
|
48
47
|
it "should turn off the table's colors" do
|
49
|
-
@table.
|
48
|
+
expect(@table).to receive(:disable_colors!)
|
50
49
|
@format.disable_colors!
|
51
50
|
end
|
52
51
|
end
|
@@ -1,9 +1,8 @@
|
|
1
|
-
|
2
1
|
describe Ppl::Format::AddressBook::OneLine do
|
3
2
|
describe "#initialize" do
|
4
3
|
it "should pass the colors through to the table" do
|
5
4
|
colors = {"id" => "blue"}
|
6
|
-
Ppl::Format::Table.
|
5
|
+
expect(Ppl::Format::Table).to receive(:new).with([:id, :name, :email], colors)
|
7
6
|
format = Ppl::Format::AddressBook::OneLine.new(colors)
|
8
7
|
end
|
9
8
|
end
|
@@ -26,7 +25,7 @@ describe Ppl::Format::AddressBook::OneLine do
|
|
26
25
|
describe "#process" do
|
27
26
|
|
28
27
|
it "should at least show the contact's id" do
|
29
|
-
@table.
|
28
|
+
expect(@table).to receive(:add_row).with({
|
30
29
|
:id => "test:",
|
31
30
|
:name => nil,
|
32
31
|
:email => nil,
|
@@ -37,7 +36,7 @@ describe Ppl::Format::AddressBook::OneLine do
|
|
37
36
|
it "should show all the info if it's available" do
|
38
37
|
@contact.name = "John Doe"
|
39
38
|
@contact.email_addresses << Ppl::Entity::EmailAddress.new("jdoe@example.org")
|
40
|
-
@table.
|
39
|
+
expect(@table).to receive(:add_row).with({
|
41
40
|
:id => "test:",
|
42
41
|
:name => "John Doe",
|
43
42
|
:email => "<jdoe@example.org>",
|
@@ -49,8 +48,8 @@ describe Ppl::Format::AddressBook::OneLine do
|
|
49
48
|
@contact.email_addresses << Ppl::Entity::EmailAddress.new("jdoe@example.org")
|
50
49
|
@contact.email_addresses << Ppl::Entity::EmailAddress.new("fred@testtest.es")
|
51
50
|
@contact.email_addresses[1].preferred = true
|
52
|
-
@table.
|
53
|
-
row[:email].
|
51
|
+
expect(@table).to receive(:add_row) do |row|
|
52
|
+
expect(row[:email]).to eq "<fred@testtest.es>"
|
54
53
|
end
|
55
54
|
@format.process(@address_book)
|
56
55
|
end
|
@@ -1,9 +1,8 @@
|
|
1
|
-
|
2
1
|
describe Ppl::Format::AddressBook::Organizations do
|
3
2
|
describe "#initialize" do
|
4
3
|
it "should pass the colors through to the table" do
|
5
4
|
colors = {"id" => "blue"}
|
6
|
-
Ppl::Format::Table.
|
5
|
+
expect(Ppl::Format::Table).to receive(:new).with([:id, :organizations], colors)
|
7
6
|
format = Ppl::Format::AddressBook::Organizations.new(colors)
|
8
7
|
end
|
9
8
|
end
|
@@ -26,7 +25,7 @@ describe Ppl::Format::AddressBook::Organizations do
|
|
26
25
|
describe "#process" do
|
27
26
|
|
28
27
|
it "should at least show the contact's id" do
|
29
|
-
@table.
|
28
|
+
expect(@table).to receive(:add_row).with({
|
30
29
|
:id => "test:",
|
31
30
|
:organizations => "",
|
32
31
|
})
|
@@ -35,7 +34,7 @@ describe Ppl::Format::AddressBook::Organizations do
|
|
35
34
|
|
36
35
|
it "should show the organization if it's available" do
|
37
36
|
@contact.organizations.push("Example Ltd")
|
38
|
-
@table.
|
37
|
+
expect(@table).to receive(:add_row).with({
|
39
38
|
:id => "test:",
|
40
39
|
:organizations => "Example Ltd",
|
41
40
|
})
|
@@ -1,9 +1,8 @@
|
|
1
|
-
|
2
1
|
describe Ppl::Format::AddressBook::PhoneNumbers do
|
3
2
|
describe "#initialize" do
|
4
3
|
it "should pass the colors through to the table" do
|
5
4
|
colors = {"id" => "blue"}
|
6
|
-
Ppl::Format::Table.
|
5
|
+
expect(Ppl::Format::Table).to receive(:new).with([:id, :phone_numbers], colors)
|
7
6
|
format = Ppl::Format::AddressBook::PhoneNumbers.new(colors)
|
8
7
|
end
|
9
8
|
end
|
@@ -26,7 +25,7 @@ describe Ppl::Format::AddressBook::PhoneNumbers do
|
|
26
25
|
describe "#process" do
|
27
26
|
|
28
27
|
it "should at least show the contact's id" do
|
29
|
-
@table.
|
28
|
+
expect(@table).to receive(:add_row).with({
|
30
29
|
:id => "test:",
|
31
30
|
:phone_numbers => "",
|
32
31
|
})
|
@@ -35,7 +34,7 @@ describe Ppl::Format::AddressBook::PhoneNumbers do
|
|
35
34
|
|
36
35
|
it "should show the phone number if it's available" do
|
37
36
|
@contact.phone_numbers << Ppl::Entity::PhoneNumber.new("01234567890")
|
38
|
-
@table.
|
37
|
+
expect(@table).to receive(:add_row).with({
|
39
38
|
:id => "test:",
|
40
39
|
:phone_numbers => "01234567890",
|
41
40
|
})
|
@@ -1,9 +1,8 @@
|
|
1
|
-
|
2
1
|
describe Ppl::Format::AddressBook::PostalAddresses do
|
3
2
|
describe "#initialize" do
|
4
3
|
it "should pass the colors through to the table" do
|
5
4
|
colors = {"id" => "blue"}
|
6
|
-
Ppl::Format::Table.
|
5
|
+
expect(Ppl::Format::Table).to receive(:new).with([:id, :address_ids], colors)
|
7
6
|
format = Ppl::Format::AddressBook::PostalAddresses.new(colors)
|
8
7
|
end
|
9
8
|
end
|
@@ -29,7 +28,7 @@ describe Ppl::Format::AddressBook::PostalAddresses do
|
|
29
28
|
describe "#process" do
|
30
29
|
|
31
30
|
it "shows the contact's and address' IDs" do
|
32
|
-
@table.
|
31
|
+
expect(@table).to receive(:add_row).with({
|
33
32
|
:id => "test:",
|
34
33
|
:address_ids => "home",
|
35
34
|
})
|
@@ -1,9 +1,8 @@
|
|
1
|
-
|
2
1
|
describe Ppl::Format::AddressBook::Urls do
|
3
2
|
describe "#initialize" do
|
4
3
|
it "should pass the colors through to the table" do
|
5
4
|
colors = {"id" => "blue"}
|
6
|
-
Ppl::Format::Table.
|
5
|
+
expect(Ppl::Format::Table).to receive(:new).with([:id, :urls], colors)
|
7
6
|
format = Ppl::Format::AddressBook::Urls.new(colors)
|
8
7
|
end
|
9
8
|
end
|
@@ -26,7 +25,7 @@ describe Ppl::Format::AddressBook::Urls do
|
|
26
25
|
describe "#process" do
|
27
26
|
|
28
27
|
it "should at least show the contact's id" do
|
29
|
-
@table.
|
28
|
+
expect(@table).to receive(:add_row).with({
|
30
29
|
:id => "test:",
|
31
30
|
:urls => "",
|
32
31
|
})
|
@@ -35,7 +34,7 @@ describe Ppl::Format::AddressBook::Urls do
|
|
35
34
|
|
36
35
|
it "should show a URL if it's available" do
|
37
36
|
@contact.urls.push "http://example.org/~jdoe"
|
38
|
-
@table.
|
37
|
+
expect(@table).to receive(:add_row).with({
|
39
38
|
:id => "test:",
|
40
39
|
:urls => "http://example.org/~jdoe",
|
41
40
|
})
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
describe Ppl::Format::Contact::Age do
|
3
2
|
|
4
3
|
before(:each) do
|
@@ -11,21 +10,21 @@ describe Ppl::Format::Contact::Age do
|
|
11
10
|
describe "#process" do
|
12
11
|
|
13
12
|
it "should return an empty string if the contact lacks a birth date" do
|
14
|
-
@color.
|
15
|
-
@contact.
|
16
|
-
@format.process(@contact).
|
13
|
+
allow(@color).to receive(:colorize)
|
14
|
+
expect(@contact).to receive(:age).and_return(nil)
|
15
|
+
expect(@format.process(@contact)).to eq ""
|
17
16
|
end
|
18
17
|
|
19
18
|
it "should return the contact's age if the birthdate is known" do
|
20
|
-
@contact.
|
21
|
-
@format.process(@contact).
|
19
|
+
expect(@contact).to receive(:age).and_return(10)
|
20
|
+
expect(@format.process(@contact)).to eq "10"
|
22
21
|
end
|
23
22
|
|
24
23
|
it "should colorize the string if configured to do so" do
|
25
|
-
@contact.
|
24
|
+
expect(@contact).to receive(:age).and_return(10)
|
26
25
|
@format.colors = { "age" => "blue" }
|
27
|
-
@color.
|
28
|
-
@format.process(@contact).
|
26
|
+
expect(@color).to receive(:colorize).and_return("age in blue")
|
27
|
+
expect(@format.process(@contact)).to eq "age in blue"
|
29
28
|
end
|
30
29
|
|
31
30
|
end
|