ppl 3.0.0 → 4.0.3

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.
Files changed (334) hide show
  1. checksums.yaml +5 -5
  2. data/.editorconfig +16 -0
  3. data/.eleventy.js +86 -0
  4. data/.eleventyignore +1 -0
  5. data/.github/workflows/build.yml +61 -0
  6. data/.gitignore +3 -1
  7. data/Rakefile +1 -18
  8. data/{CODE_OF_CONDUCT.md → code_of_conduct.md} +1 -1
  9. data/features/step_definitions/ppl_steps.rb +27 -27
  10. data/gh-pages/Gemfile +2 -0
  11. data/gh-pages/_config.yml +5 -0
  12. data/gh-pages/_includes/changelog.html +23 -0
  13. data/gh-pages/_includes/development-sidebar.html +25 -0
  14. data/gh-pages/_includes/footer.html +22 -0
  15. data/gh-pages/_includes/header.html +43 -0
  16. data/gh-pages/_includes/news.html +36 -0
  17. data/gh-pages/_includes/tip.html +54 -0
  18. data/gh-pages/_layouts/changelog.html +1 -0
  19. data/gh-pages/_layouts/command.html +104 -0
  20. data/gh-pages/_layouts/configuration.html +71 -0
  21. data/gh-pages/_layouts/development.html +20 -0
  22. data/gh-pages/_layouts/frontpage.html +6 -0
  23. data/gh-pages/_layouts/integration.html +44 -0
  24. data/gh-pages/_layouts/news.html +2 -0
  25. data/gh-pages/_layouts/page.html +6 -0
  26. data/gh-pages/_layouts/tip.html +2 -0
  27. data/gh-pages/_posts/2012-01-15-first-post.md +16 -0
  28. data/gh-pages/_posts/2012-12-20-1.0.0.md +19 -0
  29. data/gh-pages/_posts/2012-12-20-1.1.0.md +28 -0
  30. data/gh-pages/_posts/2012-12-20-1.2.0.md +18 -0
  31. data/gh-pages/_posts/2012-12-21-1.3.0.md +20 -0
  32. data/gh-pages/_posts/2012-12-21-thank-you-for-your-all-your-feedback.md +26 -0
  33. data/gh-pages/_posts/2012-12-22-1.4.1.md +21 -0
  34. data/gh-pages/_posts/2012-12-22-1.5.0.md +17 -0
  35. data/gh-pages/_posts/2012-12-23-1.5.1.md +13 -0
  36. data/gh-pages/_posts/2012-12-23-1.5.2.md +15 -0
  37. data/gh-pages/_posts/2012-12-26-1.5.3.md +19 -0
  38. data/gh-pages/_posts/2012-12-27-1.6.0.md +18 -0
  39. data/gh-pages/_posts/2012-12-29-1.7.0.md +18 -0
  40. data/gh-pages/_posts/2013-01-05-1.8.0.md +18 -0
  41. data/gh-pages/_posts/2013-01-06-1.9.0.md +20 -0
  42. data/gh-pages/_posts/2013-01-10-1.10.0.md +18 -0
  43. data/gh-pages/_posts/2013-01-20-1.11.0.md +14 -0
  44. data/gh-pages/_posts/2013-02-16-1.12.0.md +14 -0
  45. data/gh-pages/_posts/2013-02-17-1.13.0.md +29 -0
  46. data/gh-pages/_posts/2013-02-17-1.14.0.md +15 -0
  47. data/gh-pages/_posts/2013-02-17-1.14.1.md +18 -0
  48. data/gh-pages/_posts/2013-02-17-two-months-in.md +27 -0
  49. data/gh-pages/_posts/2013-03-16-1.15.0.md +28 -0
  50. data/gh-pages/_posts/2013-03-16-coloured-output-released.md +27 -0
  51. data/gh-pages/_posts/2013-04-10-ruby-2.0-compatibility.md +28 -0
  52. data/gh-pages/_posts/2013-04-11-1.15.1.md +13 -0
  53. data/gh-pages/_posts/2013-04-12-1.16.0.md +22 -0
  54. data/gh-pages/_posts/2013-04-14-1.17.0.md +15 -0
  55. data/gh-pages/_posts/2013-04-14-1.17.1.md +20 -0
  56. data/gh-pages/_posts/2013-04-14-1.17.2.md +13 -0
  57. data/gh-pages/_posts/2013-04-15-sync-alias.md +31 -0
  58. data/gh-pages/_posts/2013-04-15-utf8-fixed-and-more.md +37 -0
  59. data/gh-pages/_posts/2013-04-16-1.18.0.md +15 -0
  60. data/gh-pages/_posts/2013-04-16-set-up-color-output.md +47 -0
  61. data/gh-pages/_posts/2013-04-19-1.19.0.md +13 -0
  62. data/gh-pages/_posts/2013-04-19-1.20.0.md +15 -0
  63. data/gh-pages/_posts/2013-04-20-1.21.0.md +16 -0
  64. data/gh-pages/_posts/2013-04-20-1.22.0.md +14 -0
  65. data/gh-pages/_posts/2013-04-20-1.22.1.md +13 -0
  66. data/gh-pages/_posts/2013-04-21-1.22.2.md +15 -0
  67. data/gh-pages/_posts/2013-04-21-1.23.0.md +35 -0
  68. data/gh-pages/_posts/2013-04-23-1.24.0.md +16 -0
  69. data/gh-pages/_posts/2013-04-24-1.25.0.md +21 -0
  70. data/gh-pages/_posts/2013-05-09-2.0.0.md +33 -0
  71. data/gh-pages/_posts/2013-05-09-version-2.0.0-released.md +32 -0
  72. data/gh-pages/_posts/2013-07-20-2.1.0.md +36 -0
  73. data/gh-pages/_posts/2013-07-20-2.2.0.md +20 -0
  74. data/gh-pages/_posts/2013-10-12-2.3.0.md +19 -0
  75. data/gh-pages/_posts/2014-03-30-2.3.1.md +25 -0
  76. data/gh-pages/_posts/2015-01-05-2.3.2.md +18 -0
  77. data/gh-pages/_posts/2015-12-03-get-involved.md +29 -0
  78. data/gh-pages/_posts/2015-12-05-2.3.3.md +16 -0
  79. data/gh-pages/_posts/2016-01-02-2.4.0.md +19 -0
  80. data/gh-pages/_posts/2017-05-01-2.4.1.md +12 -0
  81. data/gh-pages/_posts/2017-10-23-sleep-mode.md +18 -0
  82. data/gh-pages/_posts/2018-01-03-3.0.1.md +12 -0
  83. data/gh-pages/_stylesheets/ppl/color.less +119 -0
  84. data/gh-pages/_stylesheets/ppl/layout.less +54 -0
  85. data/gh-pages/_stylesheets/ppl/style.less +185 -0
  86. data/gh-pages/_stylesheets/ppl/typography.less +59 -0
  87. data/gh-pages/development/changelog/index.md +18 -0
  88. data/gh-pages/development/changelog/split.rb +51 -0
  89. data/gh-pages/development/index.html +32 -0
  90. data/gh-pages/development/roadmap/index.md +15 -0
  91. data/gh-pages/documentation/about/index.html +63 -0
  92. data/gh-pages/documentation/commands/add/index.md +43 -0
  93. data/gh-pages/documentation/commands/age/add/index.md +40 -0
  94. data/gh-pages/documentation/commands/age/index.md +38 -0
  95. data/gh-pages/documentation/commands/bday/index.md +44 -0
  96. data/gh-pages/documentation/commands/completion/index.md +38 -0
  97. data/gh-pages/documentation/commands/email/index.md +64 -0
  98. data/gh-pages/documentation/commands/grep/index.md +32 -0
  99. data/gh-pages/documentation/commands/init/index.md +28 -0
  100. data/gh-pages/documentation/commands/ls/index.md +55 -0
  101. data/gh-pages/documentation/commands/mutt/index.md +36 -0
  102. data/gh-pages/documentation/commands/mv/index.md +26 -0
  103. data/gh-pages/documentation/commands/name/index.md +45 -0
  104. data/gh-pages/documentation/commands/nick/index.md +44 -0
  105. data/gh-pages/documentation/commands/org/index.md +45 -0
  106. data/gh-pages/documentation/commands/phone/index.md +56 -0
  107. data/gh-pages/documentation/commands/post/index.md +61 -0
  108. data/gh-pages/documentation/commands/pull/index.md +39 -0
  109. data/gh-pages/documentation/commands/push/index.md +36 -0
  110. data/gh-pages/documentation/commands/remote/index.md +40 -0
  111. data/gh-pages/documentation/commands/rm/index.md +23 -0
  112. data/gh-pages/documentation/commands/scrape/index.md +38 -0
  113. data/gh-pages/documentation/commands/shell/index.md +39 -0
  114. data/gh-pages/documentation/commands/show/index.md +33 -0
  115. data/gh-pages/documentation/commands/url/index.md +44 -0
  116. data/gh-pages/documentation/commands/version/index.md +27 -0
  117. data/gh-pages/documentation/configuration/address_book/index.md +22 -0
  118. data/gh-pages/documentation/configuration/alias/index.md +45 -0
  119. data/gh-pages/documentation/configuration/color/index.md +47 -0
  120. data/gh-pages/documentation/configuration/color_age/index.md +20 -0
  121. data/gh-pages/documentation/configuration/color_bday/index.md +20 -0
  122. data/gh-pages/documentation/configuration/color_email/index.md +21 -0
  123. data/gh-pages/documentation/configuration/color_ls/index.md +21 -0
  124. data/gh-pages/documentation/configuration/color_name/index.md +20 -0
  125. data/gh-pages/documentation/configuration/color_nick/index.md +20 -0
  126. data/gh-pages/documentation/configuration/color_org/index.md +20 -0
  127. data/gh-pages/documentation/configuration/color_phone/index.md +22 -0
  128. data/gh-pages/documentation/configuration/color_post/index.md +20 -0
  129. data/gh-pages/documentation/configuration/color_url/index.md +20 -0
  130. data/gh-pages/documentation/configuration/index.html +8 -0
  131. data/gh-pages/documentation/index.html +183 -0
  132. data/gh-pages/documentation/integration/bash/index.md +23 -0
  133. data/gh-pages/documentation/integration/google/index.md +26 -0
  134. data/gh-pages/documentation/integration/index.html +8 -0
  135. data/gh-pages/documentation/integration/mutt/index.md +35 -0
  136. data/gh-pages/documentation/integration/zsh/index.md +19 -0
  137. data/gh-pages/documentation/quick-start/index.html +88 -0
  138. data/gh-pages/documentation/tips/index.html +9 -0
  139. data/gh-pages/index.html +108 -0
  140. data/gh-pages/news/index.html +9 -0
  141. data/gh-pages/robots.txt +3 -0
  142. data/gh-pages/stylesheets/flatstrap.css +10 -0
  143. data/gh-pages/stylesheets/ppl.scss +235 -0
  144. data/gh-pages/wiki.png +0 -0
  145. data/lib/ppl.rb +4 -1
  146. data/lib/ppl/adapter/color.rb +0 -1
  147. data/lib/ppl/adapter/color/colored.rb +0 -1
  148. data/lib/ppl/adapter/email_scraper.rb +0 -1
  149. data/lib/ppl/adapter/email_scraper/mail.rb +4 -5
  150. data/lib/ppl/adapter/storage.rb +0 -1
  151. data/lib/ppl/adapter/storage/disk.rb +0 -1
  152. data/lib/ppl/adapter/storage/factory.rb +0 -1
  153. data/lib/ppl/adapter/vcard.rb +0 -1
  154. data/lib/ppl/adapter/vcard/vpim.rb +5 -1
  155. data/lib/ppl/application/bootstrap.rb +0 -1
  156. data/lib/ppl/application/command.rb +0 -1
  157. data/lib/ppl/application/command_suite.rb +0 -1
  158. data/lib/ppl/application/configuration.rb +0 -1
  159. data/lib/ppl/application/input.rb +0 -1
  160. data/lib/ppl/application/output.rb +0 -1
  161. data/lib/ppl/application/router.rb +0 -1
  162. data/lib/ppl/application/shell.rb +0 -1
  163. data/lib/ppl/command/add.rb +0 -1
  164. data/lib/ppl/command/age.rb +0 -1
  165. data/lib/ppl/command/attribute.rb +0 -1
  166. data/lib/ppl/command/bday.rb +0 -1
  167. data/lib/ppl/command/completion.rb +0 -1
  168. data/lib/ppl/command/email.rb +0 -1
  169. data/lib/ppl/command/external.rb +0 -1
  170. data/lib/ppl/command/help.rb +0 -1
  171. data/lib/ppl/command/init.rb +0 -1
  172. data/lib/ppl/command/ls.rb +0 -1
  173. data/lib/ppl/command/mutt.rb +0 -1
  174. data/lib/ppl/command/mv.rb +0 -1
  175. data/lib/ppl/command/name.rb +0 -1
  176. data/lib/ppl/command/nick.rb +0 -1
  177. data/lib/ppl/command/org.rb +0 -1
  178. data/lib/ppl/command/phone.rb +0 -1
  179. data/lib/ppl/command/post.rb +0 -1
  180. data/lib/ppl/command/rm.rb +0 -1
  181. data/lib/ppl/command/scrape.rb +0 -1
  182. data/lib/ppl/command/shell.rb +0 -1
  183. data/lib/ppl/command/show.rb +0 -1
  184. data/lib/ppl/command/url.rb +0 -1
  185. data/lib/ppl/command/version.rb +0 -1
  186. data/lib/ppl/entity/address_book.rb +0 -1
  187. data/lib/ppl/entity/contact.rb +0 -1
  188. data/lib/ppl/entity/email_address.rb +0 -1
  189. data/lib/ppl/entity/name.rb +0 -1
  190. data/lib/ppl/entity/phone_number.rb +0 -1
  191. data/lib/ppl/entity/postal_address.rb +0 -1
  192. data/lib/ppl/error/completion_not_found.rb +0 -1
  193. data/lib/ppl/error/contact_not_found.rb +0 -1
  194. data/lib/ppl/error/incorrect_usage.rb +0 -1
  195. data/lib/ppl/error/invalid_vcard.rb +1 -0
  196. data/lib/ppl/error/postal_address_not_found.rb +0 -1
  197. data/lib/ppl/format/address_book.rb +0 -1
  198. data/lib/ppl/format/address_book/ages.rb +0 -1
  199. data/lib/ppl/format/address_book/birthdays.rb +0 -1
  200. data/lib/ppl/format/address_book/email_addresses.rb +0 -1
  201. data/lib/ppl/format/address_book/mutt_query.rb +0 -1
  202. data/lib/ppl/format/address_book/names.rb +0 -1
  203. data/lib/ppl/format/address_book/nicknames.rb +0 -1
  204. data/lib/ppl/format/address_book/one_line.rb +0 -1
  205. data/lib/ppl/format/address_book/organizations.rb +0 -1
  206. data/lib/ppl/format/address_book/phone_numbers.rb +0 -1
  207. data/lib/ppl/format/address_book/postal_addresses.rb +0 -1
  208. data/lib/ppl/format/address_book/urls.rb +0 -1
  209. data/lib/ppl/format/contact.rb +0 -1
  210. data/lib/ppl/format/contact/age.rb +0 -1
  211. data/lib/ppl/format/contact/birthday.rb +0 -1
  212. data/lib/ppl/format/contact/email_addresses.rb +0 -1
  213. data/lib/ppl/format/contact/full.rb +0 -1
  214. data/lib/ppl/format/contact/nicknames.rb +0 -1
  215. data/lib/ppl/format/contact/organization.rb +0 -1
  216. data/lib/ppl/format/contact/phone_number.rb +0 -1
  217. data/lib/ppl/format/contact/postal_address.rb +0 -1
  218. data/lib/ppl/format/contact/postal_addresses.rb +0 -1
  219. data/lib/ppl/format/contact/urls.rb +0 -1
  220. data/lib/ppl/format/custom.rb +0 -1
  221. data/lib/ppl/format/custom/contact.rb +0 -1
  222. data/lib/ppl/format/custom/email_address.rb +0 -1
  223. data/lib/ppl/format/custom/phone_number.rb +0 -1
  224. data/lib/ppl/format/name.rb +0 -1
  225. data/lib/ppl/format/name/full_only.rb +0 -1
  226. data/lib/ppl/format/postal_address.rb +0 -1
  227. data/lib/ppl/format/postal_address/multi_line.rb +0 -1
  228. data/lib/ppl/format/postal_address/one_line.rb +0 -1
  229. data/lib/ppl/format/table.rb +0 -1
  230. data/lib/ppl/service/email_address.rb +0 -1
  231. data/lib/ppl/service/name.rb +0 -1
  232. data/lib/ppl/service/phone_number.rb +0 -1
  233. data/lib/ppl/service/postal_address.rb +0 -1
  234. data/{LICENSE → license} +0 -0
  235. data/makefile +18 -0
  236. data/package.json +23 -0
  237. data/ppl.gemspec +15 -13
  238. data/{README.md → readme.md} +12 -9
  239. data/site/_data/url.js +4 -0
  240. data/site/casts/hero.cast +189 -0
  241. data/site/development.njk +6 -0
  242. data/site/documentation.njk +6 -0
  243. data/site/index.njk +75 -0
  244. data/site/news.njk +6 -0
  245. data/site/style.scss +140 -0
  246. data/spec/ppl/adapter/color/colored_spec.rb +3 -4
  247. data/spec/ppl/adapter/color_spec.rb +0 -1
  248. data/spec/ppl/adapter/email_scraper/mail_spec.rb +13 -13
  249. data/spec/ppl/adapter/email_scraper_spec.rb +0 -1
  250. data/spec/ppl/adapter/output_spec.rb +7 -8
  251. data/spec/ppl/adapter/storage/disk_spec.rb +18 -19
  252. data/spec/ppl/adapter/storage/factory_spec.rb +3 -4
  253. data/spec/ppl/adapter/storage/git_spec.rb +31 -32
  254. data/spec/ppl/adapter/storage_spec.rb +3 -4
  255. data/spec/ppl/adapter/vcard/greencard_spec.rb +45 -45
  256. data/spec/ppl/adapter/vcard_spec.rb +0 -1
  257. data/spec/ppl/application/bootstrap_spec.rb +128 -129
  258. data/spec/ppl/application/command_spec.rb +8 -9
  259. data/spec/ppl/application/command_suite_spec.rb +7 -8
  260. data/spec/ppl/application/configuration_spec.rb +16 -17
  261. data/spec/ppl/application/input_spec.rb +2 -3
  262. data/spec/ppl/application/router_spec.rb +8 -9
  263. data/spec/ppl/application/shell_spec.rb +39 -40
  264. data/spec/ppl/command/add_spec.rb +6 -7
  265. data/spec/ppl/command/age_spec.rb +7 -8
  266. data/spec/ppl/command/attribute_spec.rb +22 -23
  267. data/spec/ppl/command/bday_spec.rb +11 -12
  268. data/spec/ppl/command/completion_spec.rb +7 -8
  269. data/spec/ppl/command/email_spec.rb +19 -20
  270. data/spec/ppl/command/external_spec.rb +7 -8
  271. data/spec/ppl/command/help_spec.rb +15 -16
  272. data/spec/ppl/command/init_spec.rb +5 -6
  273. data/spec/ppl/command/ls_spec.rb +12 -13
  274. data/spec/ppl/command/mutt_spec.rb +33 -34
  275. data/spec/ppl/command/mv_spec.rb +11 -12
  276. data/spec/ppl/command/name_spec.rb +17 -18
  277. data/spec/ppl/command/nick_spec.rb +1 -2
  278. data/spec/ppl/command/org_spec.rb +1 -2
  279. data/spec/ppl/command/phone_spec.rb +15 -16
  280. data/spec/ppl/command/post_spec.rb +29 -30
  281. data/spec/ppl/command/rm_spec.rb +3 -4
  282. data/spec/ppl/command/scrape_spec.rb +24 -25
  283. data/spec/ppl/command/shell_spec.rb +41 -42
  284. data/spec/ppl/command/show_spec.rb +4 -5
  285. data/spec/ppl/command/url_spec.rb +1 -2
  286. data/spec/ppl/command/version_spec.rb +4 -5
  287. data/spec/ppl/entity/address_book_spec.rb +1 -2
  288. data/spec/ppl/entity/contact_spec.rb +16 -17
  289. data/spec/ppl/entity/email_address_spec.rb +3 -4
  290. data/spec/ppl/entity/name_spec.rb +1 -2
  291. data/spec/ppl/entity/phone_number_spec.rb +5 -6
  292. data/spec/ppl/entity/postal_address_spec.rb +2 -3
  293. data/spec/ppl/format/address_book/ages_spec.rb +3 -4
  294. data/spec/ppl/format/address_book/birthdays_spec.rb +3 -4
  295. data/spec/ppl/format/address_book/email_addresses_spec.rb +3 -4
  296. data/spec/ppl/format/address_book/mutt_query_spec.rb +3 -4
  297. data/spec/ppl/format/address_book/names_spec.rb +3 -4
  298. data/spec/ppl/format/address_book/nicknames_spec.rb +4 -5
  299. data/spec/ppl/format/address_book/one_line_spec.rb +5 -6
  300. data/spec/ppl/format/address_book/organizations_spec.rb +3 -4
  301. data/spec/ppl/format/address_book/phone_numbers_spec.rb +3 -4
  302. data/spec/ppl/format/address_book/postal_addresses_spec.rb +2 -3
  303. data/spec/ppl/format/address_book/urls_spec.rb +3 -4
  304. data/spec/ppl/format/address_book_spec.rb +0 -1
  305. data/spec/ppl/format/contact/age_spec.rb +8 -9
  306. data/spec/ppl/format/contact/birthday_spec.rb +4 -5
  307. data/spec/ppl/format/contact/email_addresses_spec.rb +3 -4
  308. data/spec/ppl/format/contact/full_spec.rb +11 -12
  309. data/spec/ppl/format/contact/nicknames_spec.rb +4 -5
  310. data/spec/ppl/format/contact/organization_spec.rb +4 -5
  311. data/spec/ppl/format/contact/phone_number_spec.rb +4 -5
  312. data/spec/ppl/format/contact/postal_address_spec.rb +1 -2
  313. data/spec/ppl/format/contact/postal_addresses_spec.rb +3 -4
  314. data/spec/ppl/format/contact/urls_spec.rb +4 -5
  315. data/spec/ppl/format/contact_spec.rb +0 -1
  316. data/spec/ppl/format/custom/contact_spec.rb +13 -14
  317. data/spec/ppl/format/custom/email_address_spec.rb +3 -4
  318. data/spec/ppl/format/custom/phone_number_spec.rb +4 -5
  319. data/spec/ppl/format/custom_spec.rb +6 -7
  320. data/spec/ppl/format/name/full_only_spec.rb +4 -5
  321. data/spec/ppl/format/name_spec.rb +0 -1
  322. data/spec/ppl/format/postal_address/multi_line_spec.rb +10 -11
  323. data/spec/ppl/format/postal_address/one_line_spec.rb +9 -10
  324. data/spec/ppl/format/postal_address_spec.rb +0 -1
  325. data/spec/ppl/format/table_spec.rb +11 -11
  326. data/spec/ppl/service/email_address_spec.rb +13 -14
  327. data/spec/ppl/service/name_spec.rb +9 -10
  328. data/spec/ppl/service/phone_number_spec.rb +11 -12
  329. data/spec/ppl/service/postal_address_spec.rb +20 -21
  330. data/spec/spec_helper.rb +4 -0
  331. data/yarn.lock +3605 -0
  332. metadata +183 -22
  333. data/.travis.yml +0 -11
  334. data/COPYING +0 -339
@@ -1,4 +1,3 @@
1
-
2
1
  describe Ppl::Application::Command do
3
2
 
4
3
  before(:each) do
@@ -15,7 +14,7 @@ describe Ppl::Application::Command do
15
14
  it "should accept a storage adapter" do
16
15
  storage = double(Ppl::Adapter::Storage)
17
16
  @command.storage = storage
18
- @command.storage.should be storage
17
+ expect(@command.storage).to be storage
19
18
  end
20
19
  end
21
20
 
@@ -31,7 +30,7 @@ describe Ppl::Application::Command do
31
30
  add_property :some_property
32
31
  some_property "a value"
33
32
  end
34
- TestCommand456.some_property.should eq "a value"
33
+ expect(TestCommand456.some_property).to eq "a value"
35
34
  end
36
35
 
37
36
  it "should expose properties as instance variables too" do
@@ -40,7 +39,7 @@ describe Ppl::Application::Command do
40
39
  some_property "a value"
41
40
  end
42
41
  instance = TestCommand789.new
43
- instance.some_property.should eq "a value"
42
+ expect(instance.some_property).to eq "a value"
44
43
  end
45
44
 
46
45
  it "should allow properties to be overwritten by instance variables" do
@@ -50,21 +49,21 @@ describe Ppl::Application::Command do
50
49
  end
51
50
  instance = TestCommand901.new
52
51
  instance.some_property = "different"
53
- instance.some_property.should eq "different"
52
+ expect(instance.some_property).to eq "different"
54
53
  end
55
54
  end
56
55
 
57
56
  describe "#name=" do
58
57
  it "should allow the name to be set as an instance variable" do
59
58
  @command.name = "testing"
60
- @command.name.should eq "testing"
59
+ expect(@command.name).to eq "testing"
61
60
  end
62
61
  end
63
62
 
64
63
  describe "#description=" do
65
64
  it "should allow the description to be set as an instance variable" do
66
65
  @command.description = "testing"
67
- @command.description.should eq "testing"
66
+ expect(@command.description).to eq "testing"
68
67
  end
69
68
  end
70
69
 
@@ -74,7 +73,7 @@ describe Ppl::Application::Command do
74
73
  name "new_for_test"
75
74
  end
76
75
  command = TestCommand123.new
77
- command.name.should eq "new_for_test"
76
+ expect(command.name).to eq "new_for_test"
78
77
  end
79
78
  end
80
79
 
@@ -84,7 +83,7 @@ describe Ppl::Application::Command do
84
83
  description "desc_for_test"
85
84
  end
86
85
  command = TestCommand123.new
87
- command.description.should eq "desc_for_test"
86
+ expect(command.description).to eq "desc_for_test"
88
87
  end
89
88
  end
90
89
 
@@ -1,4 +1,3 @@
1
-
2
1
  describe Ppl::Application::CommandSuite do
3
2
 
4
3
  before(:each) do
@@ -17,23 +16,23 @@ describe Ppl::Application::CommandSuite do
17
16
  describe "#add_command" do
18
17
  it "should accept a command" do
19
18
  @command_suite.add_command(Ppl::Application::Command.new)
20
- @command_suite.count.should be 3
19
+ expect(@command_suite.count).to be 3
21
20
  end
22
21
  end
23
22
 
24
23
  describe "#find_command" do
25
24
  it "should find a command matching the given name" do
26
- @command_suite.find_command("foo").should be @foo_command
25
+ expect(@command_suite.find_command("foo")).to be @foo_command
27
26
  end
28
27
  it "should return nil if no commands match the given name" do
29
- @command_suite.find_command("baz").should be nil
28
+ expect(@command_suite.find_command("baz")).to be nil
30
29
  end
31
30
  end
32
31
 
33
32
  describe "#each" do
34
33
  it "should yield commands" do
35
- @command_suite
36
- .should_receive(:each)
34
+ expect(@command_suite)
35
+ .to receive(:each)
37
36
  .and_yield(@foo_command)
38
37
  .and_yield(@bar_command)
39
38
  @command_suite.each do |c| end
@@ -43,8 +42,8 @@ describe Ppl::Application::CommandSuite do
43
42
  describe "#sort_by_name" do
44
43
  it "should sort the commands alphabetically by name" do
45
44
  @command_suite.sort_by_name
46
- @command_suite[0].name.should eq "bar"
47
- @command_suite[1].name.should eq "foo"
45
+ expect(@command_suite[0].name).to eq "bar"
46
+ expect(@command_suite[1].name).to eq "foo"
48
47
  end
49
48
  end
50
49
 
@@ -1,4 +1,3 @@
1
-
2
1
  describe Ppl::Application::Configuration do
3
2
 
4
3
  before(:each) do
@@ -12,44 +11,44 @@ describe Ppl::Application::Configuration do
12
11
 
13
12
  describe "#address_book_path" do
14
13
  it "should default to the current working directory" do
15
- @config.address_book_path.should eq Dir.pwd
14
+ expect(@config.address_book_path).to eq Dir.pwd
16
15
  end
17
16
  it "should be configurable by the user's config file" do
18
- @config.stub(:user_configuration) do
17
+ allow(@config).to receive(:user_configuration) do
19
18
  {"address book" => {"path" => "/contacts"}}
20
19
  end
21
- @config.address_book_path.should eq "/contacts"
20
+ expect(@config.address_book_path).to eq "/contacts"
22
21
  end
23
22
  end
24
23
 
25
24
  describe "#aliases" do
26
25
  it "should return a hash" do
27
- @config.aliases.should be_a(Hash)
26
+ expect(@config.aliases).to be_a(Hash)
28
27
  end
29
28
  end
30
29
 
31
30
  describe "#color_enabled" do
32
31
 
33
32
  it "should return true if color is explicitly enabled" do
34
- @config.stub(:user_configuration).and_return({
33
+ allow(@config).to receive(:user_configuration).and_return({
35
34
  "color" => {
36
35
  "cmd" => "true",
37
36
  },
38
37
  })
39
- @config.color_enabled("cmd").should eq true
38
+ expect(@config.color_enabled("cmd")).to eq true
40
39
  end
41
40
 
42
41
  it "should return false if color is not explicitly enabled" do
43
- @config.color_enabled("cmd").should eq false
42
+ expect(@config.color_enabled("cmd")).to eq false
44
43
  end
45
44
 
46
45
  it "should return false if color is explicitly disabled" do
47
- @config.stub(:user_configuration).and_return({
46
+ allow(@config).to receive(:user_configuration).and_return({
48
47
  "color" => {
49
48
  "cmd" => "false",
50
49
  },
51
50
  })
52
- @config.color_enabled("cmd").should eq false
51
+ expect(@config.color_enabled("cmd")).to eq false
53
52
  end
54
53
 
55
54
  end
@@ -57,8 +56,8 @@ describe Ppl::Application::Configuration do
57
56
  describe "#command_colors" do
58
57
 
59
58
  before(:each) do
60
- @config.stub(:color_enabled).and_return(true)
61
- @config.stub(:user_configuration).and_return({
59
+ allow(@config).to receive(:color_enabled).and_return(true)
60
+ allow(@config).to receive(:user_configuration).and_return({
62
61
  "color \"ls\"" => {
63
62
  "id" => "blue",
64
63
  },
@@ -66,19 +65,19 @@ describe Ppl::Application::Configuration do
66
65
  end
67
66
 
68
67
  it "should return the colors configured for the given command" do
69
- @config.command_colors("ls").should eq({
68
+ expect(@config.command_colors("ls")).to eq({
70
69
  "id" => "blue",
71
70
  })
72
71
  end
73
72
 
74
73
  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({})
74
+ allow(@config).to receive(:color_enabled).and_return(false)
75
+ expect(@config.command_colors("ls")).to eq({})
77
76
  end
78
77
 
79
78
  it "should return nil if no colors are configured for the given command" do
80
- @config.stub(:user_configuration).and_return({})
81
- @config.command_colors("show").should eq(nil)
79
+ allow(@config).to receive(:user_configuration).and_return({})
80
+ expect(@config.command_colors("show")).to eq(nil)
82
81
  end
83
82
 
84
83
  end
@@ -1,4 +1,3 @@
1
-
2
1
  describe Ppl::Application::Input do
3
2
 
4
3
  before(:each) do
@@ -7,13 +6,13 @@ describe Ppl::Application::Input do
7
6
 
8
7
  describe "#arguments" do
9
8
  it "should be an array" do
10
- @input.arguments.should be_an(Array)
9
+ expect(@input.arguments).to be_an(Array)
11
10
  end
12
11
  end
13
12
 
14
13
  describe "#options" do
15
14
  it "should be a hash" do
16
- @input.options.should be_a(Hash)
15
+ expect(@input.options).to be_a(Hash)
17
16
  end
18
17
  end
19
18
 
@@ -1,4 +1,3 @@
1
-
2
1
  describe Ppl::Application::Router do
3
2
 
4
3
  before(:each) do
@@ -21,35 +20,35 @@ describe Ppl::Application::Router do
21
20
  describe "#default=" do
22
21
  it "should accept the name of the default command" do
23
22
  @router.default = "one"
24
- @router.default.should eq "one"
23
+ expect(@router.default).to eq "one"
25
24
  end
26
25
  end
27
26
 
28
27
  describe "#route" do
29
28
 
30
29
  it "should return the command whose name matches the given argument" do
31
- @router.route("two").should be @cmd_two
30
+ expect(@router.route("two")).to be @cmd_two
32
31
  end
33
32
 
34
33
  it "should return nil if no matching command can be found" do
35
- @router.route("three").should be nil
34
+ expect(@router.route("three")).to be nil
36
35
  end
37
36
 
38
37
  it "should fall back to the default command if the given one isn't found" do
39
38
  @router.default = "one"
40
- @router.route("three").should be @cmd_one
39
+ expect(@router.route("three")).to be @cmd_one
41
40
  end
42
41
 
43
42
  it "should apply the aliases if the argument doesn't match a command" do
44
43
  @router.aliases = {"t" => "two"}
45
- @router.route("t").should be @cmd_two
44
+ expect(@router.route("t")).to be @cmd_two
46
45
  end
47
46
 
48
47
  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")
48
+ expect(@external).to receive(:name=).with("t")
49
+ expect(@external).to receive(:command=).with("two")
51
50
  @router.aliases = {"t" => "!two"}
52
- @router.route("t").should be @external
51
+ expect(@router.route("t")).to be @external
53
52
  end
54
53
 
55
54
  end
@@ -1,4 +1,3 @@
1
-
2
1
  describe Ppl::Application::Shell do
3
2
 
4
3
  before(:each) do
@@ -16,94 +15,94 @@ describe Ppl::Application::Shell do
16
15
 
17
16
  it "should return false if the given command isn't found" do
18
17
  @input.arguments = ["foo"]
19
- @router
20
- .should_receive(:route)
18
+ expect(@router)
19
+ .to receive(:route)
21
20
  .with("foo")
22
21
  .and_return(nil)
23
- @shell.run(@input, @output).should eq false
22
+ expect(@shell.run(@input, @output)).to eq false
24
23
  end
25
24
 
26
25
  it "should execute the given command" do
27
26
  @input.arguments = ["foo"]
28
- @router
29
- .should_receive(:route)
27
+ expect(@router)
28
+ .to receive(:route)
30
29
  .with("foo")
31
30
  .and_return(@command)
32
31
 
33
- @command.should_receive(:options)
34
- @command
35
- .should_receive(:execute)
32
+ expect(@command).to receive(:options)
33
+ expect(@command)
34
+ .to receive(:execute)
36
35
  .and_return(true)
37
36
 
38
- @shell.run(@input, @output).should eq true
37
+ expect(@shell.run(@input, @output)).to eq true
39
38
  end
40
39
 
41
40
  it "should not pass the command name in the input to the command itself" do
42
41
  @input.arguments = ["mv", "foo", "bar"]
43
- @router
44
- .should_receive(:route)
42
+ expect(@router)
43
+ .to receive(:route)
45
44
  .with("mv")
46
45
  .and_return(@command)
47
46
 
48
- @command.should_receive(:options)
49
- @command.should_receive(:execute) do |input, output|
50
- input.arguments.should eq ["foo", "bar"]
47
+ expect(@command).to receive(:options)
48
+ expect(@command).to receive(:execute) do |input, output|
49
+ expect(input.arguments).to eq ["foo", "bar"]
51
50
  end
52
51
  @shell.run(@input, @output)
53
52
  end
54
53
 
55
54
  it "should return false if the command throws an exception" do
56
- @command.should_receive(:options)
57
- @command
58
- .should_receive(:execute)
55
+ expect(@command).to receive(:options)
56
+ expect(@command)
57
+ .to receive(:execute)
59
58
  .and_raise(StandardError)
60
59
 
61
- @router
62
- .should_receive(:route)
60
+ expect(@router)
61
+ .to receive(:route)
63
62
  .and_return(@command)
64
63
 
65
- @output.should_receive(:error)
64
+ expect(@output).to receive(:error)
66
65
 
67
66
  @shell.run(@input, @output)
68
67
  end
69
68
 
70
69
  it "should not do any option parsing for Ppl::Command::External instances" do
71
70
  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)
71
+ allow(external).to receive(:execute).and_return(true)
72
+ expect(@shell).to receive(:select_command).and_return(external)
73
+ expect(external).not_to receive(:options)
75
74
  @shell.run(@input, @output)
76
75
  end
77
76
 
78
77
  it "should send exception messages to stderr" do
79
- @command.should_receive(:options)
80
- @command.should_receive(:execute) { raise "Pool's Closed" }
81
- @router.should_receive(:route).and_return(@command)
82
- @output.should_receive(:error).with("ppl: Pool's Closed")
78
+ expect(@command).to receive(:options)
79
+ expect(@command).to receive(:execute) { raise "Pool's Closed" }
80
+ expect(@router).to receive(:route).and_return(@command)
81
+ expect(@output).to receive(:error).with("ppl: Pool's Closed")
83
82
  @shell.run(@input, @output)
84
83
  end
85
84
 
86
85
  it "should handle ContactNotFound errors nicely" do
87
- @command.stub(:options)
88
- @command.should_receive(:execute) { raise Ppl::Error::ContactNotFound, "example" }
89
- @router.should_receive(:route).and_return(@command)
90
- @output.should_receive(:error).with("ppl: Contact 'example' not found")
86
+ allow(@command).to receive(:options)
87
+ expect(@command).to receive(:execute) { raise Ppl::Error::ContactNotFound, "example" }
88
+ expect(@router).to receive(:route).and_return(@command)
89
+ expect(@output).to receive(:error).with("ppl: Contact 'example' not found")
91
90
  @shell.run(@input, @output)
92
91
  end
93
92
 
94
93
  it "should handle CompletionNotFound errors nicely" do
95
- @command.stub(:options)
96
- @command.should_receive(:execute) { raise Ppl::Error::CompletionNotFound, "example" }
97
- @router.should_receive(:route).and_return(@command)
98
- @output.should_receive(:error).with("ppl: No completion function available for 'example'")
94
+ allow(@command).to receive(:options)
95
+ expect(@command).to receive(:execute) { raise Ppl::Error::CompletionNotFound, "example" }
96
+ expect(@router).to receive(:route).and_return(@command)
97
+ expect(@output).to receive(:error).with("ppl: No completion function available for 'example'")
99
98
  @shell.run(@input, @output)
100
99
  end
101
100
 
102
101
  it "should handle PostalAddressNotFound errors nicely" do
103
- @command.stub(:options)
104
- @command.should_receive(:execute) { raise Ppl::Error::PostalAddressNotFound, "example" }
105
- @router.should_receive(:route).and_return(@command)
106
- @output.should_receive(:error).with("ppl: Postal address 'example' not found")
102
+ allow(@command).to receive(:options)
103
+ expect(@command).to receive(:execute) { raise Ppl::Error::PostalAddressNotFound, "example" }
104
+ expect(@router).to receive(:route).and_return(@command)
105
+ expect(@output).to receive(:error).with("ppl: Postal address 'example' not found")
107
106
  @shell.run(@input, @output)
108
107
  end
109
108
 
@@ -1,4 +1,3 @@
1
-
2
1
  describe Ppl::Command::Add do
3
2
 
4
3
  before(:each) do
@@ -13,7 +12,7 @@ describe Ppl::Command::Add do
13
12
 
14
13
  describe "#name" do
15
14
  it "should be 'add'" do
16
- @command.name.should eq "add"
15
+ expect(@command.name).to eq "add"
17
16
  end
18
17
  end
19
18
 
@@ -29,12 +28,12 @@ describe Ppl::Command::Add do
29
28
  end
30
29
 
31
30
  it "should save a new contact" do
32
- @storage.should_receive(:save_contact) do |contact|
33
- contact.id.should eq "john"
34
- contact.name.should be_a(Ppl::Entity::Name)
31
+ expect(@storage).to receive(:save_contact) do |contact|
32
+ expect(contact.id).to eq "john"
33
+ expect(contact.name).to be_a(Ppl::Entity::Name)
35
34
  end
36
- @name_service
37
- .should_receive(:parse)
35
+ expect(@name_service)
36
+ .to receive(:parse)
38
37
  .with("John Doe")
39
38
  .and_return(Ppl::Entity::Name.new)
40
39
  @input.arguments = ["john", "John Doe"]