panda_doc 0.3.0 → 0.3.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d46e1363f6a1b416eb2f04311fe60934c973faa3
4
- data.tar.gz: 43e4790a1cf556272115627686f3af5975a076a8
3
+ metadata.gz: 2f95c9c2752d6b0bdeffecd9f8b6669d06ca6b31
4
+ data.tar.gz: b04ffe46de32eed2ca87f0e13dca926a2f1b4ad6
5
5
  SHA512:
6
- metadata.gz: e812108468ec7cf00312452b9d84b53fb6802e10335193c1b038885f37fbf47d8388654802dbda4af1aa451ddc47819ecdcd4a2fe4cf8aa605e9af5a6a70ede3
7
- data.tar.gz: 7f4f4463daa0c61ae96220847fb272b182851c13afb9c656f37926a6538c208923fb341cba3a8d35fd2ffad3d9bc4a39a26c13f3cf7ff7506b7e2471059f5d71
6
+ metadata.gz: 00d186c0446b3f9dbd5b1510251004e433e54511183c1ee65ae43d366a2e396e56ee4f6c774be2ac339e106ec70f353d6a88734982a2764cef6331f3c539c030
7
+ data.tar.gz: a9401c21796993eee4206a246f9a0a2958753e625e97017e5cb53a409af9ccf67bb701d569a6c195a34cf28da88ca1f8683b985cc828131e001fcad5585d4fbb
data/CHANGELOG.md CHANGED
@@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.3.1][] (2016-03-04)
8
+
9
+ New:
10
+
11
+ - Add Document.download("uuid") shortcut.
12
+
13
+ ```ruby
14
+ response = PandaDoc::Document.download("uuid")
15
+ file = File.open("document.pdf", "w") do |f|
16
+ response.body
17
+ end
18
+ ```
19
+
7
20
  ## [0.3.0][] (2016-02-20)
8
21
 
9
22
  ### API change:
@@ -58,7 +71,8 @@ Fixes:
58
71
 
59
72
  - Initial release
60
73
 
61
- [Unreleased]: https://github.com/opti/panda_doc/compare/v0.3.0...HEAD
74
+ [Unreleased]: https://github.com/opti/panda_doc/compare/v0.3.1...HEAD
75
+ [0.3.1]: https://github.com/opti/panda_doc/compare/v0.3.0...v0.3.1
62
76
  [0.3.0]: https://github.com/opti/panda_doc/compare/v0.2.0...v0.3.0
63
77
  [0.2.0]: https://github.com/opti/panda_doc/compare/v0.1.0...v0.2.0
64
78
  [0.1.0]: https://github.com/opti/panda_doc/compare/v0.0.2...v0.1.0
@@ -17,14 +17,28 @@ module PandaDoc
17
17
  )
18
18
  end
19
19
 
20
+ def download(uuid)
21
+ stream(ApiClient.request(:get, "/documents/#{uuid}/download"))
22
+ end
23
+
20
24
  private
21
25
 
22
26
  def respond(response, type: :document)
23
- fail FailureResult.new(response) unless response.success?
27
+ failure(response)
24
28
 
25
29
  SuccessResult.new(
26
30
  ResponseFactory.new(type).build.from_hash(response.body)
27
31
  )
28
32
  end
33
+
34
+ def stream(response)
35
+ failure(response)
36
+
37
+ SuccessResult.new(response)
38
+ end
39
+
40
+ def failure(response)
41
+ fail FailureResult.new(response) unless response.success?
42
+ end
29
43
  end
30
44
  end
@@ -1,3 +1,3 @@
1
1
  module PandaDoc
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panda_doc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Pstyga
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-20 00:00:00.000000000 Z
11
+ date: 2016-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday