markdowndocs 0.2.2 → 0.2.3
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/app/controllers/markdowndocs/application_controller.rb +29 -31
- data/lib/markdowndocs/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1a94678490cfbf0ad5351412ccb04dcf9938d0bfae47184b333a18f06d8a605c
|
|
4
|
+
data.tar.gz: 9214f78fe1209a67c633909bbe8abd2e09af3fc229e3aee016cbb59604e79b77
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 24d803af2159fc9deedb4a2b681d2689b4329a88fb384391e820df9adeff787ca9c2206bfae41f511340b0b78d4c0066f1639b0f48462ab42fcb2e80b021ec90
|
|
7
|
+
data.tar.gz: '02359d490827c09532c4e063e6fc1596cbdaa89b0632404fe18d40cdb16513780f4b19029e60e9b3619174f8f3cc1f4186b91f476b7d799a3d833e41ee4f7b35'
|
|
@@ -4,37 +4,19 @@ module Markdowndocs
|
|
|
4
4
|
class ApplicationController < ::ApplicationController
|
|
5
5
|
protect_from_forgery with: :exception
|
|
6
6
|
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def root_url(*args)
|
|
23
|
-
main_app.root_url(*args)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def method_missing(method, *args, &block)
|
|
27
|
-
if main_app.respond_to?(method)
|
|
28
|
-
main_app.send(method, *args, &block)
|
|
29
|
-
else
|
|
30
|
-
super
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def respond_to_missing?(method, include_private = false)
|
|
35
|
-
main_app.respond_to?(method, include_private) || super
|
|
36
|
-
end
|
|
37
|
-
end
|
|
7
|
+
# Fix route helper isolation caused by isolate_namespace.
|
|
8
|
+
#
|
|
9
|
+
# The problem: host app route helpers (about_path, contact_path, etc.)
|
|
10
|
+
# exist in the view context but resolve against the engine's namespace,
|
|
11
|
+
# so about_path returns "/docs/about" instead of "/about".
|
|
12
|
+
#
|
|
13
|
+
# method_missing doesn't help because the methods already exist —
|
|
14
|
+
# they just resolve wrong. We need to override them explicitly.
|
|
15
|
+
#
|
|
16
|
+
# This before_action builds a helper module on first request (when
|
|
17
|
+
# routes are fully loaded) that defines every host app route helper
|
|
18
|
+
# as a delegation to main_app.
|
|
19
|
+
before_action :ensure_host_route_helpers
|
|
38
20
|
|
|
39
21
|
# Support Rails 8 built-in authentication (allow_unauthenticated_access)
|
|
40
22
|
# without requiring it — works with any auth system or none at all
|
|
@@ -44,5 +26,21 @@ module Markdowndocs
|
|
|
44
26
|
|
|
45
27
|
# Resume session if the host app supports it (Rails 8 auth)
|
|
46
28
|
before_action :resume_session, if: -> { respond_to?(:resume_session, true) }
|
|
29
|
+
|
|
30
|
+
private
|
|
31
|
+
|
|
32
|
+
def ensure_host_route_helpers
|
|
33
|
+
return if self.class.instance_variable_get(:@host_routes_delegated)
|
|
34
|
+
|
|
35
|
+
helper_module = Module.new do
|
|
36
|
+
Rails.application.routes.named_routes.names.each do |name|
|
|
37
|
+
define_method(:"#{name}_path") { |*args, **kwargs| main_app.send(:"#{name}_path", *args, **kwargs) }
|
|
38
|
+
define_method(:"#{name}_url") { |*args, **kwargs| main_app.send(:"#{name}_url", *args, **kwargs) }
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
self.class.helper(helper_module)
|
|
43
|
+
self.class.instance_variable_set(:@host_routes_delegated, true)
|
|
44
|
+
end
|
|
47
45
|
end
|
|
48
46
|
end
|
data/lib/markdowndocs/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: markdowndocs
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dave Chmura
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: rails
|
|
@@ -112,7 +111,6 @@ metadata:
|
|
|
112
111
|
homepage_uri: https://github.com/dschmura/markdowndocs
|
|
113
112
|
source_code_uri: https://github.com/dschmura/markdowndocs
|
|
114
113
|
changelog_uri: https://github.com/dschmura/markdowndocs/blob/main/CHANGELOG.md
|
|
115
|
-
post_install_message:
|
|
116
114
|
rdoc_options: []
|
|
117
115
|
require_paths:
|
|
118
116
|
- lib
|
|
@@ -127,8 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
127
125
|
- !ruby/object:Gem::Version
|
|
128
126
|
version: '0'
|
|
129
127
|
requirements: []
|
|
130
|
-
rubygems_version: 3.
|
|
131
|
-
signing_key:
|
|
128
|
+
rubygems_version: 3.6.9
|
|
132
129
|
specification_version: 4
|
|
133
130
|
summary: A drop-in markdown documentation site for Rails apps
|
|
134
131
|
test_files: []
|