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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b49a2cceb54b4ee3b05d5d4c27ee3cbda36ebfbc
4
- data.tar.gz: 6f0aa6699ffa9da4890b9526e8f166158e78d77a
3
+ metadata.gz: 54bd898c01b4596d0141c54a64caa74db1e2e00f
4
+ data.tar.gz: ed04641beeb4b1b57c2f65c652288e649a29d17d
5
5
  SHA512:
6
- metadata.gz: dea1764de2c16aa7630309ecbde9ef05c46d0ff0914a11beb9a29031e5013694c848bf9f8efd460ff4defa39eb261b6912caa157bdc4c3ce1a95fbceb64ca94d
7
- data.tar.gz: db473dff006d114dee4b99ca9bd20f9c9c3b748e29beb0eeef940c22ae3df14fadabf5359b37850396d7582147b2c1cd1275b3dc9e837c639623cac433fef28f
6
+ metadata.gz: 3f685cebc610e4a67c852d565533bfe28631959514884ec808deef38bb0444f4fe32efddcca8b1e87023a1e924ba7f87fe78e1871fb12ddb356fb21707dc2818
7
+ data.tar.gz: 96a9cef98cbf2344b281341b3fafe64b0c211e0f5923c91ee7e6376f891fcfe9ab9e62674c591818153ec9205a24b223aa2b7523ee7b5219be5e6fb7407a3270
data/.travis.yml CHANGED
@@ -1,8 +1,10 @@
1
-
2
1
  language: ruby
3
2
  rvm:
4
3
  - 1.9.3
5
4
  - 2.0.0
5
+ sudo: false
6
+ before_install:
7
+ - gem install bundler
6
8
  script:
7
9
  - bundle exec rspec spec
8
10
  - bundle exec cucumber
data/lib/ppl.rb CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  module Ppl
3
3
 
4
- Version = "2.4.0"
4
+ Version = "2.4.1"
5
5
 
6
6
  module Adapter
7
7
  end
@@ -126,4 +126,3 @@ require "ppl/service/postal_address"
126
126
  class String
127
127
  alias_method :each, :each_line
128
128
  end
129
-
@@ -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
- vcard = @repository.file_at(target, filename)
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.0"
5
- spec.date = "2016-01-12"
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.0.b6")
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
-
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
 
2
3
  describe Ppl::Adapter::EmailScraper::Mail do
3
4
 
@@ -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 = "asdfg"
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(:file_at).and_return("vcard contents")
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 = "asdfg"
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(:file_at).and_return("vcard contents")
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
@@ -1,14 +1,7 @@
1
-
2
1
  require "fakefs/safe"
3
2
  require "pathname"
4
3
 
5
4
  bin_file = Pathname.new(__FILE__).realpath
6
5
  $:.unshift File.expand_path("../../lib", bin_file)
7
6
 
8
- if ENV['CI']
9
- require "coveralls"
10
- Coveralls.wear!
11
- end
12
-
13
7
  require "ppl"
14
-
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.0
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: 2016-01-12 00:00:00.000000000 Z
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.17.0.b6
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.17.0.b6
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.4.5.1
386
+ rubygems_version: 2.6.11
401
387
  signing_key:
402
388
  specification_version: 4
403
389
  summary: The command line address book