dox 2.0.0.beta2 → 2.0.0.beta3
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 +4 -4
 - data/README.md +24 -17
 - data/lib/dox/formatters/multipart.rb +2 -0
 - data/lib/dox/formatters/plain.rb +5 -1
 - data/lib/dox/version.rb +1 -1
 - metadata +8 -7
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 19d606ce8e741ff8f4844e0a0f2bff86cda870356417fb20254dad8030865f21
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 3d57f29f50c860c4d5781e5990b398e984461d8b8239b3b82885d5df89fc8414
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 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 : 
     | 
| 
       283 
     | 
    
         
            -
               
     | 
| 
       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 
     | 
    
         
            -
             
     | 
| 
       294 
     | 
    
         
            -
                 
     | 
| 
      
 285 
     | 
    
         
            +
              task :json, [:version, :docs_path, :host] => :environment do |_, args|
         
     | 
| 
      
 286 
     | 
    
         
            +
                require 'rspec/core/rake_task'
         
     | 
| 
      
 287 
     | 
    
         
            +
                version = args[:version] || :v1
         
     | 
| 
       295 
288 
     | 
    
         | 
| 
       296 
     | 
    
         
            -
                 
     | 
| 
       297 
     | 
    
         
            -
                   
     | 
| 
      
 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 
     | 
    
         
            -
                 
     | 
| 
       301 
     | 
    
         
            -
             
     | 
| 
       302 
     | 
    
         
            -
             
     | 
| 
      
 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 
     | 
    
         
             
            ```
         
     | 
    
        data/lib/dox/formatters/plain.rb
    CHANGED
    
    | 
         @@ -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
         
     | 
    
        data/lib/dox/version.rb
    CHANGED
    
    
    
        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. 
     | 
| 
      
 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- 
     | 
| 
      
 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 
     | 
    
         
            -
             
     | 
| 
       260 
     | 
    
         
            -
             
     | 
| 
      
 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: []
         
     |