api_doc_server 1.0.0 → 1.0.1

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: d153ce9988919aa20da7fead9e36657a14311387
4
- data.tar.gz: 02bd746a5e8697e37abe58d217305ca2414d07df
3
+ metadata.gz: a5f0df4a4bc61096e1c91918177d99ef021a980c
4
+ data.tar.gz: 9f781d62a6e6f0d1c8beefbc8c0c3ae3e1de2787
5
5
  SHA512:
6
- metadata.gz: 43a99eb1c040c5106afc36363183927b28c6254179bc3ec6be7de34d39077197774df6e18e41a1709de322f5a408f3a1350e88987ca3c1377be8b4f7123a43f5
7
- data.tar.gz: c2122e5452de3df800716fb884c9443aff9944960e767159e200facf44c9fd631c9bb29b1a8d6ae2b07b0198c534563d04371c388c2fae14220685fe00d13cde
6
+ metadata.gz: ebd3e5cee4e41c724653c7d93926919eadffbecb25435734d08dde985d7c2a565fdbee109198035b0d2d5c4de1510d95d356d65e43d9222f715e38ae26d9853b
7
+ data.tar.gz: 4e24aa199b6045d367a21a7b455fbb0fb6fbf4727123ddcbb21101d70941a233b19235219da7d0a22b76fa85def7da504738c50cc6c078a02d0597971bdbc232
@@ -2,7 +2,12 @@
2
2
 
3
3
  ## master
4
4
 
5
- ## 1.0
5
+ ## 1.0.1
6
+
7
+ - Remove undesired path: e.g. api_docs/docs/v1 is now api_docs/v1
8
+ - Fix authentication_proc intended usage to use instance_exec
9
+
10
+ ## 1.0.0
6
11
 
7
12
  - Use ReDoc 1.19.1 (not SwaggerUI)
8
13
  - Run tests in random order
data/README.md CHANGED
@@ -44,7 +44,7 @@ Set admin username and password in an initializer:
44
44
  # config/initializers/api_doc_server.rb
45
45
 
46
46
  ApiDocServer.configure do |config|
47
- config.authentication_proc = proc do |controller|
47
+ config.authentication_proc = proc
48
48
  authenticate_or_request_with_http_basic do |username, password|
49
49
  User.find_by(name: username, password: password)
50
50
  end
@@ -11,7 +11,7 @@ module ApiDocServer
11
11
  protected
12
12
 
13
13
  def authenticate_admin
14
- ApiDocServer.configuration.authentication_proc.call(self)
14
+ instance_exec(&ApiDocServer.configuration.authentication_proc)
15
15
  end
16
16
  end
17
17
  end
@@ -2,12 +2,7 @@
2
2
 
3
3
  ApiDocServer::Engine.routes.draw do
4
4
  scope format: false do
5
- resources :docs, only: %i(index show) do
6
- collection do
7
- get 'oauth2', to: 'docs#oauth2', format: false
8
- end
9
- end
10
-
5
+ resources :docs, path: '/', only: %i(index show)
11
6
  root to: 'docs#index'
12
7
  end
13
8
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ApiDocServer
4
- VERSION = '1.0.0' unless const_defined?(:VERSION)
4
+ VERSION = '1.0.1' unless const_defined?(:VERSION)
5
5
  def self.version
6
6
  VERSION
7
7
  end
@@ -19,7 +19,7 @@ module ApiDocServer
19
19
  end
20
20
 
21
21
  test 'default config options should work successfully' do
22
- get '/swagger/docs/v1'
22
+ get '/swagger/v1'
23
23
  assert_response :success
24
24
  assert_match("url='api_docs/v1/swagger.yaml'", @response.body)
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_doc_server
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Fleischer