dox 2.0.0.beta2 → 2.0.0.beta3

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
  SHA256:
3
- metadata.gz: dafc7bfd7720a7ee11971214fd0f482a83b58716d400bd6a566dfbcc4f557147
4
- data.tar.gz: 47f3effad46183ad8b6869d2f4c84f12bff4ecb99d067cedc63742b8ad004696
3
+ metadata.gz: 19d606ce8e741ff8f4844e0a0f2bff86cda870356417fb20254dad8030865f21
4
+ data.tar.gz: 3d57f29f50c860c4d5781e5990b398e984461d8b8239b3b82885d5df89fc8414
5
5
  SHA512:
6
- metadata.gz: 0ffb07d32e950510576d6899fdaadd19ee422345dc731aae9d1e07a0cc83d5c3af812dc4265badd991b6b1b601a44d4762d0ddbcb6aae7120d56fa349a5dec49
7
- data.tar.gz: 36776866e234e06fcfe984af6f419c344041d8a143e1c13ad7e179c4ee72f87ac99cd6174d51dc144984644836044c64e6243a2d5a3c6cb3b0eb737813ffd4a6
6
+ metadata.gz: 3c520ed0ca05c9b2eab780ef3feef96a937277912ad97e460ded62cd4dfa2c455675a937ccb299b8776140b6f38657aacc67c3430e6c3e0004f7e2af53a20da3
7
+ data.tar.gz: 7b288f580fa957a06764cc9d0df09c6fb6d914d43743b4fe58ee0666f614e96ad34cdf9a0f90069d5805fa7360e124f922d658d7c485811e5c9a3afe01ca7d3c
data/README.md CHANGED
@@ -279,27 +279,34 @@ Documentation is generated in 2 steps:
279
279
  It's recommendable to write a few rake tasks to make things easier. Here's an example:
280
280
 
281
281
  ```ruby
282
- namespace :api do
283
- namespace :doc do
284
- desc 'Generate API documentation markdown'
285
- task :json do
286
- require 'rspec/core/rake_task'
287
-
288
- RSpec::Core::RakeTask.new(:api_spec) do |t|
289
- t.pattern = 'spec/controllers/api/v1/'
290
- t.rspec_opts = "-f Dox::Formatter --order defined --tag dox --out public/api/docs/v1/docs.json"
291
- end
282
+ namespace :dox do
283
+ desc 'Generate API documentation markdown'
292
284
 
293
- Rake::Task['api_spec'].invoke
294
- end
285
+ task :json, [:version, :docs_path, :host] => :environment do |_, args|
286
+ require 'rspec/core/rake_task'
287
+ version = args[:version] || :v1
295
288
 
296
- task html: :json do
297
- `redoc-cli bundle -o public/api/docs/v2/index.html spec/api_doc/v1/schemas/docs.json`
289
+ RSpec::Core::RakeTask.new(:api_spec) do |t|
290
+ t.pattern = "spec/requests/api/#{version}"
291
+ t.rspec_opts =
292
+ "-f Dox::Formatter --tag dox --order defined --out spec/docs/#{version}/apispec.json"
298
293
  end
299
294
 
300
- task open: :html do
301
- `open public/api/docs/v1/index.html`
302
- end
295
+ Rake::Task['api_spec'].invoke
296
+ end
297
+
298
+ task :html, [:version, :docs_path, :host] => :json do |_, args|
299
+ version = args[:version] || :v1
300
+ docs_path = args[:docs_path] || "api/#{version}/docs"
301
+
302
+ `yarn run redoc-cli bundle -o public/#{docs_path}/index.html spec/docs/#{version}/apispec.json`
303
+ end
304
+
305
+ task :open, [:version, :docs_path, :host] => :html do |_, args|
306
+ version = args[:version] || :v1
307
+ docs_path = args[:docs_path] || "api/#{version}/docs"
308
+
309
+ `open public/#{docs_path}/index.html`
303
310
  end
304
311
  end
305
312
  ```
@@ -1,3 +1,5 @@
1
+ require 'rack'
2
+
1
3
  module Dox
2
4
  module Formatters
3
5
  class Multipart
@@ -2,7 +2,11 @@ module Dox
2
2
  module Formatters
3
3
  class Plain < Dox::Formatters::Base
4
4
  def format
5
- body
5
+ return body if body.encoding == Encoding::UTF_8
6
+
7
+ body.encode(Encoding::UTF_8)
8
+ rescue Encoding::UndefinedConversionError
9
+ "#{body.encoding} stream"
6
10
  end
7
11
  end
8
12
  end
@@ -1,3 +1,3 @@
1
1
  module Dox
2
- VERSION = '2.0.0.beta2'.freeze
2
+ VERSION = '2.0.0.beta3'.freeze
3
3
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dox
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta2
4
+ version: 2.0.0.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Melita Kokot
8
8
  - Vedran Hrnčić
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-08-12 00:00:00.000000000 Z
12
+ date: 2020-11-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -179,7 +179,7 @@ dependencies:
179
179
  - - ">="
180
180
  - !ruby/object:Gem::Version
181
181
  version: '0'
182
- description:
182
+ description:
183
183
  email:
184
184
  - melita.kokot@gmail.com
185
185
  - vrabac266@gmail.com
@@ -241,7 +241,7 @@ licenses:
241
241
  - MIT
242
242
  metadata:
243
243
  allowed_push_host: https://rubygems.org
244
- post_install_message:
244
+ post_install_message:
245
245
  rdoc_options: []
246
246
  require_paths:
247
247
  - lib
@@ -256,8 +256,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
256
  - !ruby/object:Gem::Version
257
257
  version: 1.3.1
258
258
  requirements: []
259
- rubygems_version: 3.0.3
260
- signing_key:
259
+ rubyforge_project:
260
+ rubygems_version: 2.7.6.2
261
+ signing_key:
261
262
  specification_version: 4
262
263
  summary: Generates API documentation for rspec in OpenAPI format.
263
264
  test_files: []