doc_raptor 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog.md +4 -0
- data/lib/doc_raptor.rb +5 -4
- metadata +4 -4
data/Changelog.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# DocRaptor gem Change Log
|
2
2
|
|
3
|
+
## doc_raptor 0.2.1
|
4
|
+
* bug: there were certain envs where .blank? wasn't defined. So,
|
5
|
+
pulling in the core_ext from activesupport
|
6
|
+
|
3
7
|
## doc_raptor 0.2.0
|
4
8
|
* tests!
|
5
9
|
* added a create! method which will raise an exception when doc creation fails
|
data/lib/doc_raptor.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "httparty"
|
2
2
|
require "tempfile"
|
3
|
+
require File.expand_path(File.dirname(__FILE__) + "/core_ext/object/blank")
|
3
4
|
|
4
5
|
module DocRaptorError
|
5
6
|
class NoApiKeyProvidedError < RuntimeError; end
|
@@ -32,7 +33,7 @@ end
|
|
32
33
|
|
33
34
|
class DocRaptor
|
34
35
|
include HTTParty
|
35
|
-
|
36
|
+
|
36
37
|
def self.api_key(key = nil)
|
37
38
|
default_options[:api_key] = key ? key : default_options[:api_key] || ENV["DOCRAPTOR_API_KEY"]
|
38
39
|
default_options[:api_key] || raise(DocRaptorError::NoApiKeyProvidedError.new("No API key provided"))
|
@@ -51,7 +52,7 @@ class DocRaptor
|
|
51
52
|
raise DocRaptorError::NoContentError.new("must supply :document_content or :document_url")
|
52
53
|
end
|
53
54
|
|
54
|
-
default_options = {
|
55
|
+
default_options = {
|
55
56
|
:name => "default",
|
56
57
|
:document_type => "pdf",
|
57
58
|
:test => false,
|
@@ -99,7 +100,7 @@ class DocRaptor
|
|
99
100
|
response
|
100
101
|
end
|
101
102
|
end
|
102
|
-
|
103
|
+
|
103
104
|
def self.list_docs!(options = { })
|
104
105
|
raise ArgumentError.new "please pass in an options hash" unless options.is_a? Hash
|
105
106
|
self.list_docs(options.merge({:raise_exception_on_failure => true}))
|
@@ -107,7 +108,7 @@ class DocRaptor
|
|
107
108
|
|
108
109
|
def self.list_docs(options = { })
|
109
110
|
raise ArgumentError.new "please pass in an options hash" unless options.is_a? Hash
|
110
|
-
default_options = {
|
111
|
+
default_options = {
|
111
112
|
:page => 1,
|
112
113
|
:per_page => 100,
|
113
114
|
:raise_exception_on_failure => false
|
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:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Kuehl
|
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements: []
|
80
80
|
|
81
81
|
rubyforge_project:
|
82
|
-
rubygems_version: 1.
|
82
|
+
rubygems_version: 1.6.0
|
83
83
|
signing_key:
|
84
84
|
specification_version: 3
|
85
85
|
summary: wrap up the api for DocRaptor nicely
|