ppl 2.4.0 → 2.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -1
- data/lib/ppl.rb +1 -2
- data/lib/ppl/adapter/storage/git.rb +4 -3
- data/ppl.gemspec +3 -5
- data/spec/ppl/adapter/email_scraper/mail_spec.rb +1 -0
- data/spec/ppl/adapter/storage/git_spec.rb +17 -5
- data/spec/spec_helper.rb +0 -7
- metadata +7 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54bd898c01b4596d0141c54a64caa74db1e2e00f
|
4
|
+
data.tar.gz: ed04641beeb4b1b57c2f65c652288e649a29d17d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f685cebc610e4a67c852d565533bfe28631959514884ec808deef38bb0444f4fe32efddcca8b1e87023a1e924ba7f87fe78e1871fb12ddb356fb21707dc2818
|
7
|
+
data.tar.gz: 96a9cef98cbf2344b281341b3fafe64b0c211e0f5923c91ee7e6376f891fcfe9ab9e62674c591818153ec9205a24b223aa2b7523ee7b5219be5e6fb7407a3270
|
data/.travis.yml
CHANGED
data/lib/ppl.rb
CHANGED
@@ -24,7 +24,7 @@ class Ppl::Adapter::Storage::Git < Ppl::Adapter::Storage
|
|
24
24
|
def load_address_book
|
25
25
|
address_book = Ppl::Entity::AddressBook.new
|
26
26
|
|
27
|
-
head = @repository.lookup(@repository.head.target)
|
27
|
+
head = @repository.lookup(@repository.head.target.oid)
|
28
28
|
head.tree.each do |file|
|
29
29
|
extension = file[:name].slice(-4..-1)
|
30
30
|
if extension != ".vcf"
|
@@ -77,7 +77,7 @@ class Ppl::Adapter::Storage::Git < Ppl::Adapter::Storage
|
|
77
77
|
end
|
78
78
|
|
79
79
|
if !head.nil?
|
80
|
-
parents = [ @repository.lookup( @repository.head.target ).oid ]
|
80
|
+
parents = [ @repository.lookup( @repository.head.target.oid ).oid ]
|
81
81
|
update_ref = "HEAD"
|
82
82
|
else
|
83
83
|
parents = []
|
@@ -118,7 +118,8 @@ class Ppl::Adapter::Storage::Git < Ppl::Adapter::Storage
|
|
118
118
|
def read_contact_from_disk(id)
|
119
119
|
filename = id + ".vcf"
|
120
120
|
target = @repository.head.target
|
121
|
-
|
121
|
+
blob = @repository.blob_at(target.oid, filename)
|
122
|
+
vcard = blob.nil? ? nil : blob.content
|
122
123
|
contact = nil
|
123
124
|
|
124
125
|
if !vcard.nil?
|
data/ppl.gemspec
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
|
3
3
|
spec.name = "ppl"
|
4
|
-
spec.version = "2.4.
|
5
|
-
spec.date = "
|
4
|
+
spec.version = "2.4.1"
|
5
|
+
spec.date = "2017-05-01"
|
6
6
|
|
7
7
|
spec.required_ruby_version = ">= 1.9.3"
|
8
8
|
|
@@ -14,10 +14,9 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.add_dependency("inifile", "2.0.2")
|
15
15
|
spec.add_dependency("mail", "2.5.3")
|
16
16
|
spec.add_dependency("morphine", "0.1.1")
|
17
|
-
spec.add_dependency("rugged", "0.
|
17
|
+
spec.add_dependency("rugged", "~> 0.24.0")
|
18
18
|
spec.add_dependency("greencard", "0.0.5")
|
19
19
|
|
20
|
-
spec.add_development_dependency("coveralls")
|
21
20
|
spec.add_development_dependency("cucumber")
|
22
21
|
spec.add_development_dependency("rspec")
|
23
22
|
spec.add_development_dependency("rake")
|
@@ -33,4 +32,3 @@ Gem::Specification.new do |spec|
|
|
33
32
|
spec.homepage = "http://ppladdressbook.org"
|
34
33
|
|
35
34
|
end
|
36
|
-
|
@@ -12,6 +12,7 @@ describe Ppl::Adapter::Storage::Git do
|
|
12
12
|
@repo = double(Rugged::Repository)
|
13
13
|
@commit = double(Rugged::Commit)
|
14
14
|
@vcard = double(Ppl::Adapter::Vcard)
|
15
|
+
@target = double(Rugged::Commit)
|
15
16
|
|
16
17
|
Rugged::Repository.stub(:new).and_return(@repo)
|
17
18
|
|
@@ -50,7 +51,8 @@ describe Ppl::Adapter::Storage::Git do
|
|
50
51
|
|
51
52
|
@files = [{:name => "test.vcf"}]
|
52
53
|
|
53
|
-
@commit.should_receive(:target)
|
54
|
+
@commit.should_receive(:target).and_return(@target)
|
55
|
+
@target.should_receive(:oid)
|
54
56
|
@repo.should_receive(:lookup).and_return(@head)
|
55
57
|
@repo.should_receive(:head).and_return(@commit)
|
56
58
|
|
@@ -82,11 +84,16 @@ describe Ppl::Adapter::Storage::Git do
|
|
82
84
|
describe "#load_contact" do
|
83
85
|
|
84
86
|
it "should return a contact" do
|
87
|
+
target = OpenStruct.new
|
88
|
+
target.oid = "asdfg"
|
85
89
|
head = OpenStruct.new
|
86
|
-
head.target =
|
90
|
+
head.target = target
|
91
|
+
|
92
|
+
blob = OpenStruct.new
|
93
|
+
blob.content = 'vcard contents'
|
87
94
|
|
88
95
|
@repo.should_receive(:head).and_return(head)
|
89
|
-
@repo.should_receive(:
|
96
|
+
@repo.should_receive(:blob_at).and_return(blob)
|
90
97
|
@vcard.should_receive(:decode).and_return(@contact)
|
91
98
|
@contact.should_receive(:id=).with("test")
|
92
99
|
|
@@ -94,11 +101,16 @@ describe Ppl::Adapter::Storage::Git do
|
|
94
101
|
end
|
95
102
|
|
96
103
|
it "handles encoding errors gracefully" do
|
104
|
+
target = OpenStruct.new
|
105
|
+
target.oid = "asdfg"
|
97
106
|
head = OpenStruct.new
|
98
|
-
head.target =
|
107
|
+
head.target = target
|
108
|
+
|
109
|
+
blob = OpenStruct.new
|
110
|
+
blob.content = 'vcard contents'
|
99
111
|
|
100
112
|
@repo.should_receive(:head).and_return(head)
|
101
|
-
@repo.should_receive(:
|
113
|
+
@repo.should_receive(:blob_at).and_return(blob)
|
102
114
|
@vcard.should_receive(:decode).and_raise(GreenCard::InvalidEncodingError)
|
103
115
|
expect{ @git.load_contact("test") }.to raise_error(Ppl::Error::InvalidVcard)
|
104
116
|
end
|
data/spec/spec_helper.rb
CHANGED
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: 2.4.
|
4
|
+
version: 2.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henry Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colored
|
@@ -70,16 +70,16 @@ dependencies:
|
|
70
70
|
name: rugged
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.24.0
|
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.
|
82
|
+
version: 0.24.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: greencard
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,20 +94,6 @@ dependencies:
|
|
94
94
|
- - '='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 0.0.5
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: coveralls
|
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
97
|
- !ruby/object:Gem::Dependency
|
112
98
|
name: cucumber
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -397,7 +383,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
397
383
|
version: '0'
|
398
384
|
requirements: []
|
399
385
|
rubyforge_project:
|
400
|
-
rubygems_version: 2.
|
386
|
+
rubygems_version: 2.6.11
|
401
387
|
signing_key:
|
402
388
|
specification_version: 4
|
403
389
|
summary: The command line address book
|