sabredav_client 0.1.7 → 0.2.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: ca4f23c31aaa106ff42d110c689f13678be60ef6
4
- data.tar.gz: fa738aebd39edc84d711511f69377ed7f2461d40
3
+ metadata.gz: 363ae122753b55ddb7fe3d7897c682f39f86849b
4
+ data.tar.gz: de214b5738f31a69ece0ec8a7de7aa914031609f
5
5
  SHA512:
6
- metadata.gz: 8c214b59a07ae43d0fba3c1381c33f6d9447c42fa3e6bc8444867d096dde1d49afefaf4619a3d0e3411097fada80275f505e545a1fff051fd080f25c4c672edd
7
- data.tar.gz: d6f19be3cd325f08eef0959431e242c8b9e01f55213a9849e647efd8b0012c412943ab0aa17095ddadcc15043458b3ca7f16d75ca97c8cb8bb4a81d4176f5c03
6
+ metadata.gz: 8d4dfdd3e7e5cea5237aafe5063f11ce18d60bbf3477486130b86c5fd2266e538ed471e88889c58c2c407a2e8e6f3b8d076a6826999ca77cac4e6ec9636f8bad
7
+ data.tar.gz: 3582369abd6dc9117b6c3ab9fdfc5f0c2e7a00082c18443a2da060c2bd39f83f67b643ff134a73068ab5c25e7df5f667446f7fbc4cd09a6e8f48c9f6fdebd420
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sabredav_client (0.1.6)
4
+ sabredav_client (0.1.7)
5
5
  builder (~> 3.2)
6
6
  net-http-digest_auth (~> 1.4)
7
7
 
@@ -12,7 +12,14 @@ module SabredavClient
12
12
  res = req.run
13
13
 
14
14
  SabredavClient::Errors::errorhandling(res)
15
- res.body
15
+
16
+ etag = res.header["etag"]
17
+ etag = %Q/#{etag.gsub(/\A['"]+|['"]+\Z/, "")}/ unless etag.nil?
18
+
19
+ {
20
+ ics: res.body,
21
+ etag: etag
22
+ }
16
23
  end
17
24
 
18
25
  def find_multiple(starts: "", ends: "")
@@ -1,3 +1,3 @@
1
1
  module SabredavClient
2
- VERSION="0.1.7"
2
+ VERSION="0.2.0"
3
3
  end
@@ -54,10 +54,15 @@ describe SabredavClient::Events do
54
54
  it "one event" do
55
55
  uid = "47732F70-1793-47B3-80FA-57E3C5ECA0E5"
56
56
  uri = "#{uid}.ics"
57
- FakeWeb.register_uri(:get, "http://user@localhost:5232/user/calendar/#{uri}", :body => File.open("spec/fixtures/event.ics"))
57
+
58
+ etag = "6341a7e8f9a1f775dd07c55b17ff27b7"
59
+
60
+ expected_result = {etag: etag, ics: File.open("spec/fixtures/event.ics").read}
61
+
62
+ FakeWeb.register_uri(:get, "http://user@localhost:5232/user/calendar/#{uri}", body: File.open("spec/fixtures/event.ics"), etag: etag )
58
63
  r = events.find(uri)
59
64
 
60
- expect(r).to be_a(String)
65
+ expect(r).to eq(expected_result)
61
66
  end
62
67
 
63
68
  it "two events" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sabredav_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Schwartau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-31 00:00:00.000000000 Z
11
+ date: 2016-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder