docraptor 0.2.0 → 0.3.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: 6a54ab8664324ce2f630ba8a0838b7bd15c99c19
4
- data.tar.gz: b24824eb919e02bad8ba05790e1c4423a1158dfb
3
+ metadata.gz: 5cf8121ad1c5f8911cba244d047a3fed94092fce
4
+ data.tar.gz: a32b83320f951539542a1c6f8a65f8c26b342704
5
5
  SHA512:
6
- metadata.gz: 08e853b7a0eb1bb0ef8d7b2e390556ff786993e09b9579a397d15a4050f3823cf19e428b657ff87066153150970cfcf28bf7f86fc268f2bc41dd1e379919edff
7
- data.tar.gz: 116c4516a5342d4d3f3556c2d0cbf5b6e5717239bf5c5919958b81368dcbff640ad10e8408000eaf90c6c5c4f494ec6c6c1a52c1155e3bc364624265d30da949
6
+ metadata.gz: 36a53a768c5db547c22dccc043b5d9cd53aaef8fc9cfe6e3ec787219276c86a2d95362c2c93f0d56cc1ba40bfa8027df42f98ed9a117112631042214e0ee7032
7
+ data.tar.gz: 428af8015465729bf1de1ceca4cf2f8baf584c417b804a4a449b6fcc40645be188ec5a6344177c15bad8b07743f709efffcee4899a1db220e7b23ba3824cd3ea
@@ -0,0 +1 @@
1
+ 62fbcb9e8bec4a40569e51c7f316af85806628ee
@@ -1,3 +1,6 @@
1
+ ### 0.3.0 [March 11, 2016]
2
+ * Added support for prince_options[debug]
3
+
1
4
  ### 0.2.0 [January 29, 2016]
2
5
  * **BREAKING CHANGE**: Rename ClientApi to DocApi
3
6
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # DocRaptor Ruby Native Client Library
2
2
 
3
- This is a Ruby gem for using [DocRaptor API](http://docraptor.com/documentation) to convert HTML to PDF and XLSX.
3
+ This is a Ruby gem for using [DocRaptor API](https://docraptor.com/documentation) to convert [HTML to PDF and XLSX](https://docraptor.com).
4
4
 
5
5
 
6
6
  ## Installation
@@ -50,7 +50,7 @@ We have guides for doing some of the common things:
50
50
 
51
51
  * [Headers and Footers](https://docraptor.com/documentation/style#pdf-headers-footers) including page skipping
52
52
  * [CSS Media Selector](https://docraptor.com/documentation/api#api_basic_pdf) to make the page look exactly as it does in your browser
53
- * [Protected Content](https://docraptor.com/documentation/api#api_advanced_pdf) to secure your URLs so only DocRaptor can access them
53
+ * Protect content with [HTTP authentication](https://docraptor.com/documentation/api#api_http_user) or [proxies](https://docraptor.com/documentation/api#api_http_proxy) so only DocRaptor can access them
54
54
 
55
55
 
56
56
  ## More Help
@@ -1,7 +1,7 @@
1
1
  swagger: '2.0'
2
2
 
3
3
  info:
4
- version: "0.0.1"
4
+ version: "1.1.0"
5
5
  title: DocRaptor v1
6
6
 
7
7
  host: docraptor.com
@@ -277,6 +277,9 @@ definitions:
277
277
  disallow_modify:
278
278
  type: boolean
279
279
  description: Disallow modification of this PDF.
280
+ debug:
281
+ type: boolean
282
+ description: Enable Prince debug mode.
280
283
  input:
281
284
  type: string
282
285
  description: Specify the input format.
@@ -5,10 +5,10 @@ require 'docraptor/version'
5
5
  require 'docraptor/configuration'
6
6
 
7
7
  # Models
8
- require 'docraptor/models/doc'
9
- require 'docraptor/models/prince_options'
10
8
  require 'docraptor/models/async_doc'
11
9
  require 'docraptor/models/async_doc_status'
10
+ require 'docraptor/models/doc'
11
+ require 'docraptor/models/prince_options'
12
12
 
13
13
  # APIs
14
14
  require 'docraptor/api/doc_api'
@@ -8,7 +8,7 @@ module DocRaptor
8
8
  @api_client = api_client
9
9
  end
10
10
 
11
- #
11
+ #
12
12
  # Creates a document asynchronously. You must use a callback url or the the returned status id and the status api to find out when it completes. Then use the download api to get the document.
13
13
  # @param doc The document to be created.
14
14
  # @param [Hash] opts the optional parameters
@@ -18,7 +18,7 @@ module DocRaptor
18
18
  return data
19
19
  end
20
20
 
21
- #
21
+ #
22
22
  # Creates a document asynchronously. You must use a callback url or the the returned status id and the status api to find out when it completes. Then use the download api to get the document.
23
23
  # @param doc The document to be created.
24
24
  # @param [Hash] opts the optional parameters
@@ -27,12 +27,12 @@ module DocRaptor
27
27
  if @api_client.config.debugging
28
28
  @api_client.config.logger.debug "Calling API: DocApi#create_async_doc ..."
29
29
  end
30
-
30
+
31
31
  # verify the required parameter 'doc' is set
32
32
  fail "Missing the required parameter 'doc' when calling create_async_doc" if doc.nil?
33
-
33
+
34
34
  # resource path
35
- path = "/async_docs".sub('{format}','json')
35
+ local_var_path = "/async_docs".sub('{format}','json')
36
36
 
37
37
  # query parameters
38
38
  query_params = {}
@@ -53,9 +53,9 @@ module DocRaptor
53
53
 
54
54
  # http body (model)
55
55
  post_body = @api_client.object_to_http_body(doc)
56
-
56
+
57
57
  auth_names = ['basicAuth']
58
- data, status_code, headers = @api_client.call_api(:POST, path,
58
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
59
59
  :header_params => header_params,
60
60
  :query_params => query_params,
61
61
  :form_params => form_params,
@@ -68,7 +68,7 @@ module DocRaptor
68
68
  return data, status_code, headers
69
69
  end
70
70
 
71
- #
71
+ #
72
72
  # Creates a document synchronously.
73
73
  # @param doc The document to be created.
74
74
  # @param [Hash] opts the optional parameters
@@ -78,7 +78,7 @@ module DocRaptor
78
78
  return data
79
79
  end
80
80
 
81
- #
81
+ #
82
82
  # Creates a document synchronously.
83
83
  # @param doc The document to be created.
84
84
  # @param [Hash] opts the optional parameters
@@ -87,12 +87,12 @@ module DocRaptor
87
87
  if @api_client.config.debugging
88
88
  @api_client.config.logger.debug "Calling API: DocApi#create_doc ..."
89
89
  end
90
-
90
+
91
91
  # verify the required parameter 'doc' is set
92
92
  fail "Missing the required parameter 'doc' when calling create_doc" if doc.nil?
93
-
93
+
94
94
  # resource path
95
- path = "/docs".sub('{format}','json')
95
+ local_var_path = "/docs".sub('{format}','json')
96
96
 
97
97
  # query parameters
98
98
  query_params = {}
@@ -113,9 +113,9 @@ module DocRaptor
113
113
 
114
114
  # http body (model)
115
115
  post_body = @api_client.object_to_http_body(doc)
116
-
116
+
117
117
  auth_names = ['basicAuth']
118
- data, status_code, headers = @api_client.call_api(:POST, path,
118
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
119
119
  :header_params => header_params,
120
120
  :query_params => query_params,
121
121
  :form_params => form_params,
@@ -128,7 +128,7 @@ module DocRaptor
128
128
  return data, status_code, headers
129
129
  end
130
130
 
131
- #
131
+ #
132
132
  # Downloads a document.
133
133
  # @param id The download_id returned from status request or a callback.
134
134
  # @param [Hash] opts the optional parameters
@@ -138,7 +138,7 @@ module DocRaptor
138
138
  return data
139
139
  end
140
140
 
141
- #
141
+ #
142
142
  # Downloads a document.
143
143
  # @param id The download_id returned from status request or a callback.
144
144
  # @param [Hash] opts the optional parameters
@@ -147,12 +147,12 @@ module DocRaptor
147
147
  if @api_client.config.debugging
148
148
  @api_client.config.logger.debug "Calling API: DocApi#get_async_doc ..."
149
149
  end
150
-
150
+
151
151
  # verify the required parameter 'id' is set
152
152
  fail "Missing the required parameter 'id' when calling get_async_doc" if id.nil?
153
-
153
+
154
154
  # resource path
155
- path = "/download/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
155
+ local_var_path = "/download/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
156
156
 
157
157
  # query parameters
158
158
  query_params = {}
@@ -173,9 +173,9 @@ module DocRaptor
173
173
 
174
174
  # http body (model)
175
175
  post_body = nil
176
-
176
+
177
177
  auth_names = ['basicAuth']
178
- data, status_code, headers = @api_client.call_api(:GET, path,
178
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
179
179
  :header_params => header_params,
180
180
  :query_params => query_params,
181
181
  :form_params => form_params,
@@ -188,7 +188,7 @@ module DocRaptor
188
188
  return data, status_code, headers
189
189
  end
190
190
 
191
- #
191
+ #
192
192
  # Check on the status of an asynchronously created document.
193
193
  # @param id The status_id returned when creating an asynchronous document.
194
194
  # @param [Hash] opts the optional parameters
@@ -198,7 +198,7 @@ module DocRaptor
198
198
  return data
199
199
  end
200
200
 
201
- #
201
+ #
202
202
  # Check on the status of an asynchronously created document.
203
203
  # @param id The status_id returned when creating an asynchronous document.
204
204
  # @param [Hash] opts the optional parameters
@@ -207,12 +207,12 @@ module DocRaptor
207
207
  if @api_client.config.debugging
208
208
  @api_client.config.logger.debug "Calling API: DocApi#get_async_doc_status ..."
209
209
  end
210
-
210
+
211
211
  # verify the required parameter 'id' is set
212
212
  fail "Missing the required parameter 'id' when calling get_async_doc_status" if id.nil?
213
-
213
+
214
214
  # resource path
215
- path = "/status/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
215
+ local_var_path = "/status/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
216
216
 
217
217
  # query parameters
218
218
  query_params = {}
@@ -233,9 +233,9 @@ module DocRaptor
233
233
 
234
234
  # http body (model)
235
235
  post_body = nil
236
-
236
+
237
237
  auth_names = ['basicAuth']
238
- data, status_code, headers = @api_client.call_api(:GET, path,
238
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
239
239
  :header_params => header_params,
240
240
  :query_params => query_params,
241
241
  :form_params => form_params,
@@ -63,9 +63,9 @@ module DocRaptor
63
63
  query_params = opts[:query_params] || {}
64
64
  form_params = opts[:form_params] || {}
65
65
 
66
-
66
+
67
67
  update_params_for_auth! header_params, query_params, opts[:auth_names]
68
-
68
+
69
69
 
70
70
  req_opts = {
71
71
  :method => http_method,
@@ -150,7 +150,7 @@ module DocRaptor
150
150
  # parse date time (expecting ISO 8601 format)
151
151
  Date.parse data
152
152
  when 'Object'
153
- # generic object, return directly
153
+ # generic object (usually a Hash), return directly
154
154
  data
155
155
  when /\AArray<(.+)>\z/
156
156
  # e.g. Array<Pet>
@@ -8,9 +8,9 @@ module DocRaptor
8
8
  # Attribute mapping from ruby-style variable name to JSON key.
9
9
  def self.attribute_map
10
10
  {
11
-
11
+
12
12
  :'status_id' => :'status_id'
13
-
13
+
14
14
  }
15
15
  end
16
16
 
@@ -18,7 +18,7 @@ module DocRaptor
18
18
  def self.swagger_types
19
19
  {
20
20
  :'status_id' => :'String'
21
-
21
+
22
22
  }
23
23
  end
24
24
 
@@ -28,11 +28,11 @@ module DocRaptor
28
28
  # convert string to symbol for hash key
29
29
  attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
30
30
 
31
-
31
+
32
32
  if attributes[:'status_id']
33
33
  self.status_id = attributes[:'status_id']
34
34
  end
35
-
35
+
36
36
  end
37
37
 
38
38
  # Check equality by comparing each attribute.
@@ -85,11 +85,14 @@ module DocRaptor
85
85
  when :Float
86
86
  value.to_f
87
87
  when :BOOLEAN
88
- if value =~ /^(true|t|yes|y|1)$/i
88
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
89
89
  true
90
90
  else
91
91
  false
92
92
  end
93
+ when :Object
94
+ # generic object (usually a Hash), return directly
95
+ value
93
96
  when /\AArray<(?<inner_type>.+)>\z/
94
97
  inner_type = Regexp.last_match[:inner_type]
95
98
  value.map { |v| _deserialize(inner_type, v) }
@@ -23,19 +23,19 @@ module DocRaptor
23
23
  # Attribute mapping from ruby-style variable name to JSON key.
24
24
  def self.attribute_map
25
25
  {
26
-
26
+
27
27
  :'status' => :'status',
28
-
28
+
29
29
  :'download_url' => :'download_url',
30
-
30
+
31
31
  :'download_id' => :'download_id',
32
-
32
+
33
33
  :'message' => :'message',
34
-
34
+
35
35
  :'number_of_pages' => :'number_of_pages',
36
-
36
+
37
37
  :'validation_errors' => :'validation_errors'
38
-
38
+
39
39
  }
40
40
  end
41
41
 
@@ -48,7 +48,7 @@ module DocRaptor
48
48
  :'message' => :'String',
49
49
  :'number_of_pages' => :'Integer',
50
50
  :'validation_errors' => :'String'
51
-
51
+
52
52
  }
53
53
  end
54
54
 
@@ -58,31 +58,31 @@ module DocRaptor
58
58
  # convert string to symbol for hash key
59
59
  attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
60
60
 
61
-
61
+
62
62
  if attributes[:'status']
63
63
  self.status = attributes[:'status']
64
64
  end
65
-
65
+
66
66
  if attributes[:'download_url']
67
67
  self.download_url = attributes[:'download_url']
68
68
  end
69
-
69
+
70
70
  if attributes[:'download_id']
71
71
  self.download_id = attributes[:'download_id']
72
72
  end
73
-
73
+
74
74
  if attributes[:'message']
75
75
  self.message = attributes[:'message']
76
76
  end
77
-
77
+
78
78
  if attributes[:'number_of_pages']
79
79
  self.number_of_pages = attributes[:'number_of_pages']
80
80
  end
81
-
81
+
82
82
  if attributes[:'validation_errors']
83
83
  self.validation_errors = attributes[:'validation_errors']
84
84
  end
85
-
85
+
86
86
  end
87
87
 
88
88
  # Check equality by comparing each attribute.
@@ -140,11 +140,14 @@ module DocRaptor
140
140
  when :Float
141
141
  value.to_f
142
142
  when :BOOLEAN
143
- if value =~ /^(true|t|yes|y|1)$/i
143
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
144
144
  true
145
145
  else
146
146
  false
147
147
  end
148
+ when :Object
149
+ # generic object (usually a Hash), return directly
150
+ value
148
151
  when /\AArray<(?<inner_type>.+)>\z/
149
152
  inner_type = Regexp.last_match[:inner_type]
150
153
  value.map { |v| _deserialize(inner_type, v) }
@@ -43,33 +43,33 @@ module DocRaptor
43
43
  # Attribute mapping from ruby-style variable name to JSON key.
44
44
  def self.attribute_map
45
45
  {
46
-
46
+
47
47
  :'name' => :'name',
48
-
48
+
49
49
  :'document_type' => :'document_type',
50
-
50
+
51
51
  :'document_content' => :'document_content',
52
-
52
+
53
53
  :'document_url' => :'document_url',
54
-
54
+
55
55
  :'test' => :'test',
56
-
56
+
57
57
  :'strict' => :'strict',
58
-
58
+
59
59
  :'ignore_resource_errors' => :'ignore_resource_errors',
60
-
60
+
61
61
  :'tag' => :'tag',
62
-
62
+
63
63
  :'help' => :'help',
64
-
64
+
65
65
  :'javascript' => :'javascript',
66
-
66
+
67
67
  :'referrer' => :'referrer',
68
-
68
+
69
69
  :'callback_url' => :'callback_url',
70
-
70
+
71
71
  :'prince_options' => :'prince_options'
72
-
72
+
73
73
  }
74
74
  end
75
75
 
@@ -89,7 +89,7 @@ module DocRaptor
89
89
  :'referrer' => :'String',
90
90
  :'callback_url' => :'String',
91
91
  :'prince_options' => :'PrinceOptions'
92
-
92
+
93
93
  }
94
94
  end
95
95
 
@@ -99,69 +99,69 @@ module DocRaptor
99
99
  # convert string to symbol for hash key
100
100
  attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
101
101
 
102
-
102
+
103
103
  if attributes[:'name']
104
104
  self.name = attributes[:'name']
105
105
  end
106
-
106
+
107
107
  if attributes[:'document_type']
108
108
  self.document_type = attributes[:'document_type']
109
109
  end
110
-
110
+
111
111
  if attributes[:'document_content']
112
112
  self.document_content = attributes[:'document_content']
113
113
  end
114
-
114
+
115
115
  if attributes[:'document_url']
116
116
  self.document_url = attributes[:'document_url']
117
117
  end
118
-
118
+
119
119
  if attributes[:'test']
120
120
  self.test = attributes[:'test']
121
121
  else
122
122
  self.test = true
123
123
  end
124
-
124
+
125
125
  if attributes[:'strict']
126
126
  self.strict = attributes[:'strict']
127
127
  else
128
128
  self.strict = "none"
129
129
  end
130
-
130
+
131
131
  if attributes[:'ignore_resource_errors']
132
132
  self.ignore_resource_errors = attributes[:'ignore_resource_errors']
133
133
  else
134
134
  self.ignore_resource_errors = true
135
135
  end
136
-
136
+
137
137
  if attributes[:'tag']
138
138
  self.tag = attributes[:'tag']
139
139
  end
140
-
140
+
141
141
  if attributes[:'help']
142
142
  self.help = attributes[:'help']
143
143
  else
144
144
  self.help = false
145
145
  end
146
-
146
+
147
147
  if attributes[:'javascript']
148
148
  self.javascript = attributes[:'javascript']
149
149
  else
150
150
  self.javascript = false
151
151
  end
152
-
152
+
153
153
  if attributes[:'referrer']
154
154
  self.referrer = attributes[:'referrer']
155
155
  end
156
-
156
+
157
157
  if attributes[:'callback_url']
158
158
  self.callback_url = attributes[:'callback_url']
159
159
  end
160
-
160
+
161
161
  if attributes[:'prince_options']
162
162
  self.prince_options = attributes[:'prince_options']
163
163
  end
164
-
164
+
165
165
  end
166
166
 
167
167
  # Custom attribute writer method checking allowed values (enum).
@@ -244,11 +244,14 @@ module DocRaptor
244
244
  when :Float
245
245
  value.to_f
246
246
  when :BOOLEAN
247
- if value =~ /^(true|t|yes|y|1)$/i
247
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
248
248
  true
249
249
  else
250
250
  false
251
251
  end
252
+ when :Object
253
+ # generic object (usually a Hash), return directly
254
+ value
252
255
  when /\AArray<(?<inner_type>.+)>\z/
253
256
  inner_type = Regexp.last_match[:inner_type]
254
257
  value.map { |v| _deserialize(inner_type, v) }
@@ -68,6 +68,9 @@ module DocRaptor
68
68
  # Disallow modification of this PDF.
69
69
  attr_accessor :disallow_modify
70
70
 
71
+ # Enable Prince debug mode.
72
+ attr_accessor :debug
73
+
71
74
  # Specify the input format.
72
75
  attr_accessor :input
73
76
 
@@ -86,61 +89,63 @@ module DocRaptor
86
89
  # Attribute mapping from ruby-style variable name to JSON key.
87
90
  def self.attribute_map
88
91
  {
89
-
92
+
90
93
  :'baseurl' => :'baseurl',
91
-
94
+
92
95
  :'no_xinclude' => :'no_xinclude',
93
-
96
+
94
97
  :'no_network' => :'no_network',
95
-
98
+
96
99
  :'http_user' => :'http_user',
97
-
100
+
98
101
  :'http_password' => :'http_password',
99
-
102
+
100
103
  :'http_proxy' => :'http_proxy',
101
-
104
+
102
105
  :'http_timeout' => :'http_timeout',
103
-
106
+
104
107
  :'insecure' => :'insecure',
105
-
108
+
106
109
  :'media' => :'media',
107
-
110
+
108
111
  :'no_author_style' => :'no_author_style',
109
-
112
+
110
113
  :'no_default_style' => :'no_default_style',
111
-
114
+
112
115
  :'no_embed_fonts' => :'no_embed_fonts',
113
-
116
+
114
117
  :'no_subset_fonts' => :'no_subset_fonts',
115
-
118
+
116
119
  :'no_compress' => :'no_compress',
117
-
120
+
118
121
  :'encrypt' => :'encrypt',
119
-
122
+
120
123
  :'key_bits' => :'key_bits',
121
-
124
+
122
125
  :'user_password' => :'user_password',
123
-
126
+
124
127
  :'owner_password' => :'owner_password',
125
-
128
+
126
129
  :'disallow_print' => :'disallow_print',
127
-
130
+
128
131
  :'disallow_copy' => :'disallow_copy',
129
-
132
+
130
133
  :'disallow_annotate' => :'disallow_annotate',
131
-
134
+
132
135
  :'disallow_modify' => :'disallow_modify',
133
-
136
+
137
+ :'debug' => :'debug',
138
+
134
139
  :'input' => :'input',
135
-
140
+
136
141
  :'version' => :'version',
137
-
142
+
138
143
  :'javascript' => :'javascript',
139
-
144
+
140
145
  :'css_dpi' => :'css_dpi',
141
-
146
+
142
147
  :'profile' => :'profile'
143
-
148
+
144
149
  }
145
150
  end
146
151
 
@@ -169,12 +174,13 @@ module DocRaptor
169
174
  :'disallow_copy' => :'BOOLEAN',
170
175
  :'disallow_annotate' => :'BOOLEAN',
171
176
  :'disallow_modify' => :'BOOLEAN',
177
+ :'debug' => :'BOOLEAN',
172
178
  :'input' => :'String',
173
179
  :'version' => :'String',
174
180
  :'javascript' => :'BOOLEAN',
175
181
  :'css_dpi' => :'Integer',
176
182
  :'profile' => :'String'
177
-
183
+
178
184
  }
179
185
  end
180
186
 
@@ -184,119 +190,123 @@ module DocRaptor
184
190
  # convert string to symbol for hash key
185
191
  attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
186
192
 
187
-
193
+
188
194
  if attributes[:'baseurl']
189
195
  self.baseurl = attributes[:'baseurl']
190
196
  end
191
-
197
+
192
198
  if attributes[:'no_xinclude']
193
199
  self.no_xinclude = attributes[:'no_xinclude']
194
200
  end
195
-
201
+
196
202
  if attributes[:'no_network']
197
203
  self.no_network = attributes[:'no_network']
198
204
  end
199
-
205
+
200
206
  if attributes[:'http_user']
201
207
  self.http_user = attributes[:'http_user']
202
208
  end
203
-
209
+
204
210
  if attributes[:'http_password']
205
211
  self.http_password = attributes[:'http_password']
206
212
  end
207
-
213
+
208
214
  if attributes[:'http_proxy']
209
215
  self.http_proxy = attributes[:'http_proxy']
210
216
  end
211
-
217
+
212
218
  if attributes[:'http_timeout']
213
219
  self.http_timeout = attributes[:'http_timeout']
214
220
  end
215
-
221
+
216
222
  if attributes[:'insecure']
217
223
  self.insecure = attributes[:'insecure']
218
224
  end
219
-
225
+
220
226
  if attributes[:'media']
221
227
  self.media = attributes[:'media']
222
228
  else
223
229
  self.media = "print"
224
230
  end
225
-
231
+
226
232
  if attributes[:'no_author_style']
227
233
  self.no_author_style = attributes[:'no_author_style']
228
234
  end
229
-
235
+
230
236
  if attributes[:'no_default_style']
231
237
  self.no_default_style = attributes[:'no_default_style']
232
238
  end
233
-
239
+
234
240
  if attributes[:'no_embed_fonts']
235
241
  self.no_embed_fonts = attributes[:'no_embed_fonts']
236
242
  end
237
-
243
+
238
244
  if attributes[:'no_subset_fonts']
239
245
  self.no_subset_fonts = attributes[:'no_subset_fonts']
240
246
  end
241
-
247
+
242
248
  if attributes[:'no_compress']
243
249
  self.no_compress = attributes[:'no_compress']
244
250
  end
245
-
251
+
246
252
  if attributes[:'encrypt']
247
253
  self.encrypt = attributes[:'encrypt']
248
254
  end
249
-
255
+
250
256
  if attributes[:'key_bits']
251
257
  self.key_bits = attributes[:'key_bits']
252
258
  end
253
-
259
+
254
260
  if attributes[:'user_password']
255
261
  self.user_password = attributes[:'user_password']
256
262
  end
257
-
263
+
258
264
  if attributes[:'owner_password']
259
265
  self.owner_password = attributes[:'owner_password']
260
266
  end
261
-
267
+
262
268
  if attributes[:'disallow_print']
263
269
  self.disallow_print = attributes[:'disallow_print']
264
270
  end
265
-
271
+
266
272
  if attributes[:'disallow_copy']
267
273
  self.disallow_copy = attributes[:'disallow_copy']
268
274
  end
269
-
275
+
270
276
  if attributes[:'disallow_annotate']
271
277
  self.disallow_annotate = attributes[:'disallow_annotate']
272
278
  end
273
-
279
+
274
280
  if attributes[:'disallow_modify']
275
281
  self.disallow_modify = attributes[:'disallow_modify']
276
282
  end
277
-
283
+
284
+ if attributes[:'debug']
285
+ self.debug = attributes[:'debug']
286
+ end
287
+
278
288
  if attributes[:'input']
279
289
  self.input = attributes[:'input']
280
290
  else
281
291
  self.input = "html"
282
292
  end
283
-
293
+
284
294
  if attributes[:'version']
285
295
  self.version = attributes[:'version']
286
296
  end
287
-
297
+
288
298
  if attributes[:'javascript']
289
299
  self.javascript = attributes[:'javascript']
290
300
  end
291
-
301
+
292
302
  if attributes[:'css_dpi']
293
303
  self.css_dpi = attributes[:'css_dpi']
294
304
  end
295
-
305
+
296
306
  if attributes[:'profile']
297
307
  self.profile = attributes[:'profile']
298
308
  end
299
-
309
+
300
310
  end
301
311
 
302
312
  # Custom attribute writer method checking allowed values (enum).
@@ -334,6 +344,7 @@ module DocRaptor
334
344
  disallow_copy == o.disallow_copy &&
335
345
  disallow_annotate == o.disallow_annotate &&
336
346
  disallow_modify == o.disallow_modify &&
347
+ debug == o.debug &&
337
348
  input == o.input &&
338
349
  version == o.version &&
339
350
  javascript == o.javascript &&
@@ -348,7 +359,7 @@ module DocRaptor
348
359
 
349
360
  # Calculate hash code according to all attributes.
350
361
  def hash
351
- [baseurl, no_xinclude, no_network, http_user, http_password, http_proxy, http_timeout, insecure, media, no_author_style, no_default_style, no_embed_fonts, no_subset_fonts, no_compress, encrypt, key_bits, user_password, owner_password, disallow_print, disallow_copy, disallow_annotate, disallow_modify, input, version, javascript, css_dpi, profile].hash
362
+ [baseurl, no_xinclude, no_network, http_user, http_password, http_proxy, http_timeout, insecure, media, no_author_style, no_default_style, no_embed_fonts, no_subset_fonts, no_compress, encrypt, key_bits, user_password, owner_password, disallow_print, disallow_copy, disallow_annotate, disallow_modify, debug, input, version, javascript, css_dpi, profile].hash
352
363
  end
353
364
 
354
365
  # build the object from hash
@@ -384,11 +395,14 @@ module DocRaptor
384
395
  when :Float
385
396
  value.to_f
386
397
  when :BOOLEAN
387
- if value =~ /^(true|t|yes|y|1)$/i
398
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
388
399
  true
389
400
  else
390
401
  false
391
402
  end
403
+ when :Object
404
+ # generic object (usually a Hash), return directly
405
+ value
392
406
  when /\AArray<(?<inner_type>.+)>\z/
393
407
  inner_type = Regexp.last_match[:inner_type]
394
408
  value.map { |v| _deserialize(inner_type, v) }
@@ -1,3 +1,3 @@
1
1
  module DocRaptor
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -0,0 +1,6 @@
1
+ #!/bin/sh
2
+ set -e
3
+ cd "`dirname \"$0\"`/.."
4
+
5
+ echo "Removing trailing whitespace..."
6
+ find lib -name "*.rb" -type f -exec sed -E -i '' 's/[[:space:]]+$//g' {} +
@@ -6,9 +6,8 @@ if [ ! -d "swagger-codegen" ]; then
6
6
  git clone https://github.com/swagger-api/swagger-codegen
7
7
  fi
8
8
 
9
+ SWAGGER_CODGEN_REVISION=$(cat .swagger-revision)
9
10
  cd swagger-codegen
10
-
11
- SWAGGER_CODGEN_REVISION="f42f9acf3564264f84b970c894574da1e4c7c053" # v2.1.5+
12
11
  if [[ `cat .git/HEAD` != "$SWAGGER_CODGEN_REVISION" ]]; then
13
12
  git fetch
14
13
  git checkout $SWAGGER_CODGEN_REVISION
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "gemName": "docraptor",
3
3
  "moduleName": "DocRaptor",
4
- "gemVersion": "0.2.0"
4
+ "gemVersion": "0.3.0"
5
5
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docraptor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elijah Miller
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-30 00:00:00.000000000 Z
12
+ date: 2016-03-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: typhoeus
@@ -240,6 +240,7 @@ extensions: []
240
240
  extra_rdoc_files: []
241
241
  files:
242
242
  - ".gitignore"
243
+ - ".swagger-revision"
243
244
  - CHANGELOG.md
244
245
  - Gemfile
245
246
  - LICENSE
@@ -261,6 +262,7 @@ files:
261
262
  - lib/docraptor/version.rb
262
263
  - script/clean
263
264
  - script/generate_language
265
+ - script/post_generate_language
264
266
  - script/swagger
265
267
  - script/test
266
268
  - script/update_from_upstream