doc_raptor 0.1.2 → 0.1.3

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.
Files changed (3) hide show
  1. data/README.md +1 -1
  2. data/lib/doc_raptor.rb +13 -1
  3. metadata +6 -6
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  DocRaptor
2
2
  ==========
3
3
 
4
- This is a Ruby gem providing a simple wrapper around the DocRaptor API.
4
+ This is a Ruby gem providing a simple wrapper around the DocRaptor API. DocRaptor is a web service that allows you to convert [html to pdf](http://docraptor.com) or html to xls.
5
5
 
6
6
 
7
7
  ## Usage ######################################################################
data/lib/doc_raptor.rb CHANGED
@@ -26,18 +26,30 @@ class DocRaptor
26
26
  response = post("/docs", :body => {:doc => options}, :basic_auth => { :username => api_key })
27
27
 
28
28
  if block_given?
29
+ ret_val = nil
29
30
  Tempfile.open("docraptor") do |f|
30
31
  f.sync = true
31
32
  f.write(response.body)
32
33
  f.rewind
33
34
 
34
- yield f, response
35
+ ret_val = yield f, response
35
36
  end
37
+ ret_val
36
38
  else
37
39
  response
38
40
  end
39
41
  end
40
42
 
43
+ def self.list_docs(options = { })
44
+ default_options = {
45
+ :page => 1,
46
+ :per_page => 100
47
+ }
48
+ options = default_options.merge(options)
49
+
50
+ get("/docs", :query => options, :basic_auth => { :username => api_key })
51
+ end
52
+
41
53
  base_uri ENV["DOCRAPTOR_URL"] || "https://docraptor.com/"
42
54
  api_key ENV["DOCRAPTOR_API_KEY"]
43
55
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doc_raptor
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
5
- prerelease: false
4
+ hash: 29
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Kuehl
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-20 00:00:00 -04:00
18
+ date: 2011-01-29 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  requirements: []
77
77
 
78
78
  rubyforge_project:
79
- rubygems_version: 1.3.7
79
+ rubygems_version: 1.4.2
80
80
  signing_key:
81
81
  specification_version: 3
82
82
  summary: wrap up the api for DocRaptor nicely