ppl 1.16.0 → 1.17.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e0078cdc91873e6cbc509e8ab7688372fef43c7b
4
- data.tar.gz: 4c5005c26f11a26b11a6adf4e99195f358c8f438
3
+ metadata.gz: 534e964077775b5213a6a424cbd7e7fafdd3bdc1
4
+ data.tar.gz: 591219daa582fb9f4f0ce4513407a11aca5c340e
5
5
  SHA512:
6
- metadata.gz: 814ba206fc2673082c196aceaea8cb26d9bbfb47e6b7db8d4784d8fd5c5c63fabfd0bdc0d9727ed5ad25313d1d7a276799f98e5df02ea66607c0719a3bbd5d65
7
- data.tar.gz: 59952d9c2d48c6395290c922126c06fc958760ffd17fc4911a869dbc8d12829af7ca169a8edf1f7bde3b4e2d4daeadbcf8a1d60847986d60cb7ac618f7f9c4ef
6
+ metadata.gz: a163c7310507391c86a9605dec4c07154ad9b7e91304948d09ba77dc72a4f92488ef7a679da6fc0b31d95e18260e98783ade8492491fa9f273018d05658cad6c
7
+ data.tar.gz: 5c23014db12338370ab46ee21098bbcb15ee9e2ef6cb3b4917ed8dcef59a7df6e58ac28b1611862ce8b1a0f4bdbaa2429b06657a1f18277a82a8d4f9d455ac03
data/completions/bash ADDED
@@ -0,0 +1,25 @@
1
+ _ppl()
2
+ {
3
+ local cur prev opts nick_cmds base
4
+ COMPREPLY=()
5
+ cur="${COMP_WORDS[COMP_CWORD]}"
6
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
7
+
8
+ # Complete options
9
+ opts="add age bday email init ls mutt mv name nick org phone post pull push remote rm shell show url version"
10
+ if [[ ${prev} == "ppl" ]]; then
11
+ COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
12
+ return 0
13
+ fi
14
+
15
+ # Complete nicknames
16
+ nick_cmds=([age]="" [bday]="" [email]="" [mv]="" [name]="" [nick]="" [org]="" [phone]="" [post]="" [rm]="" [show]="" [url]="")
17
+ if [[ $nick_cmds[${prev}] ]]; then
18
+ local nicknames=$(for x in `ppl nick | cut -d ':' -f 1`; do echo ${x} ; done )
19
+ COMPREPLY=( $(compgen -W "${nicknames}" -- ${cur}) )
20
+ return 0
21
+ fi
22
+ }
23
+
24
+ complete -F _ppl ppl
25
+
data/completions/zsh ADDED
@@ -0,0 +1,53 @@
1
+ #compdef ppl
2
+ #autoload
3
+
4
+ _ppl_contacts() {
5
+ contacts=(`ppl nick | cut -d ':' -f 1`)
6
+ }
7
+
8
+ local -a _1st_arguments
9
+ _1st_arguments=(
10
+ "add:Add a new contact"
11
+ "age:List or show contacts's ages"
12
+ "bday:List, show or change birthdays"
13
+ "email:Show or change a contact's email address"
14
+ "init:Create an empty address book"
15
+ "ls:List all contacts"
16
+ "mutt:Integration with mutt's query_command"
17
+ "mv:Rename a contact"
18
+ "name:List, show or change names"
19
+ "nick:List, show or change nicknames"
20
+ "org:List, show or change organizations"
21
+ "phone:List, show or change phone numbers"
22
+ "post:List, show or change postal addresses"
23
+ "pull:Execute 'git pull' in the address book directory"
24
+ "push:Execute 'git push' in the address book directory"
25
+ "remote:Execute 'git remote' in the address book directory"
26
+ "rm:Delete a contact"
27
+ "shell:Interactive mode"
28
+ "show:Display the full details of a contact"
29
+ "url:List, show or change URLs"
30
+ "version:Display ppl version information"
31
+ )
32
+
33
+ local expl
34
+ local -a contacts
35
+
36
+ _arguments \
37
+ '*:: :->subcmds' && return 0
38
+
39
+ if (( CURRENT == 1 )); then
40
+ _describe -t commands "ppl command" _1st_arguments
41
+ return
42
+ fi
43
+
44
+ # Commands which take nicknames
45
+ local -a nick_cmds
46
+ nick_cmds=(age bday email mv name nick org phone post rm show url)
47
+
48
+ # Complete nick names if appropriate
49
+ if (( CURRENT == 2 )) && [[ -n ${(M)nick_cmds:#${words[1]}} ]] ; then
50
+ _ppl_contacts
51
+ _wanted contacts expl 'current contacts' compadd -a contacts
52
+ fi
53
+
@@ -0,0 +1,8 @@
1
+
2
+ Feature: create address book
3
+
4
+ Scenario: success
5
+ Given I am in an empty directory
6
+ When I run "ppl init ./contacts"
7
+ Then "./contacts" should be a ppl address book
8
+
@@ -0,0 +1,6 @@
1
+
2
+ Then /^"([^"]+)" should be a ppl address book$/ do |directory|
3
+ git_directory = File.join(directory, ".git")
4
+ Dir.exist?(git_directory).should eq true
5
+ end
6
+
@@ -0,0 +1,11 @@
1
+
2
+ require "tmpdir"
3
+
4
+ Given /^I am in an empty directory$/ do
5
+ @directory = Dir.mktmpdir
6
+ Dir.chdir @directory
7
+ at_exit do
8
+ FileUtils.rm_rf @directory
9
+ end
10
+ end
11
+
@@ -0,0 +1,5 @@
1
+
2
+ When /^I run "(ppl [^"]+)"$/ do |command|
3
+ Kernel.system command
4
+ end
5
+
data/lib/ppl.rb CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  module Ppl
3
3
 
4
- Version = "1.16.0"
4
+ Version = "1.17.0"
5
5
 
6
6
  module Adapter
7
7
  end
@@ -7,19 +7,9 @@ class Ppl::Application::Shell
7
7
 
8
8
  def run(input, output)
9
9
  outcome = false
10
- begin
11
10
  command = select_command(input)
12
11
  prepare_command(command, input)
13
12
  outcome = execute_command(command, input, output)
14
- rescue Ppl::Error::ContactNotFound
15
- output.error("ppl: Contact '#{$!}' not found")
16
- rescue OptionParser::InvalidOption, OptionParser::MissingArgument, Ppl::Error::IncorrectUsage
17
- output.error($!)
18
- output.error(@optparse.to_s)
19
- rescue
20
- output.error("ppl: " + $!.message)
21
- outcome = false
22
- end
23
13
  return outcome
24
14
  end
25
15
 
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.16.0"
6
- spec.date = "2013-04-12"
5
+ spec.version = "1.17.0"
6
+ spec.date = "2013-04-14"
7
7
 
8
8
  spec.required_ruby_version = ">= 1.9.3"
9
9
 
@@ -15,8 +15,9 @@ 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("greencard", "0.0.3")
18
+ spec.add_dependency("greencard", "0.0.5")
19
19
 
20
+ spec.add_development_dependency("cucumber")
20
21
  spec.add_development_dependency("rspec")
21
22
  spec.add_development_dependency("rake")
22
23
  spec.add_development_dependency("fakefs")
@@ -254,5 +254,17 @@ describe Ppl::Adapter::Vcard::GreenCard, "#decode" do
254
254
  contact.nicknames.first.should eq "Happy"
255
255
  end
256
256
 
257
+ it "should not choke on utf8" do
258
+ vcard = [
259
+ "BEGIN:VCARD",
260
+ "VERSION:3.0",
261
+ "N:;Straße;;;",
262
+ "FN:Straße",
263
+ "END:VCARD",
264
+ ].join("\n")
265
+ contact = @adapter.decode(vcard)
266
+ contact.name.should eq "Straße"
267
+ end
268
+
257
269
  end
258
270
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ppl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.0
4
+ version: 1.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henry Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-12 00:00:00.000000000 Z
11
+ date: 2013-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored
@@ -72,14 +72,28 @@ dependencies:
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 0.0.3
75
+ version: 0.0.5
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 0.0.3
82
+ version: 0.0.5
83
+ - !ruby/object:Gem::Dependency
84
+ name: cucumber
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'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: rspec
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +150,12 @@ files:
136
150
  - Gemfile
137
151
  - README.md
138
152
  - bin/ppl
153
+ - completions/bash
154
+ - completions/zsh
155
+ - features/init/create_repository.feature
156
+ - features/step_definitions/address_book_steps.rb
157
+ - features/step_definitions/cwd_steps.rb
158
+ - features/step_definitions/ppl_steps.rb
139
159
  - lib/ppl.rb
140
160
  - lib/ppl/adapter/color.rb
141
161
  - lib/ppl/adapter/color/colored.rb