sdoc_live 0.1.6 → 0.1.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d49bec64da362efab6cc71f5ab722679479610f07830183eaea7d5155ffa76e
4
- data.tar.gz: 1ce67dcb81729bc112d383bfa48df0160300ab9ffc02e702486df9b0fa26a667
3
+ metadata.gz: 1653429aed4ce0456d7df0c26da4d8ccdde41967cfd91ab2824c24c5da7dc975
4
+ data.tar.gz: a22e7b188e50c419cf7160dbc2c2b32160320ca46015306cf19e08efde37dc11
5
5
  SHA512:
6
- metadata.gz: 6cb026920418d5effac5b16378160f5bc4e6c5a101083c6f920a8d3eff6d2f89214d396cde03309001137609cd97e9b47b930c7c4157bac94dc01f3dd4e5c301
7
- data.tar.gz: aa5556dced2d25c494c12373817d4ecc498ca751647215ffc0bf5894f1170d39a25edb82b175bb43fc933c71846919cdd99bd313dd70fad8fe0bad51d9ef1b59
6
+ metadata.gz: 4c592cd42c497602bbb49b90e9f1603c407139e8c00e0f093f26bfc412a5c160b1de729ce70c4db14a5efbe89967e51eceda9bca695273f7e252c83e6dfd639a
7
+ data.tar.gz: 87c2c8adc1768ed43cba4aad88b425a16279920893ab5e326c63555e5653c1bce416980d868eb1e17d52162277ce80bc009466df465e38743ba266f8c081df79
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # SDoc Live
2
2
 
3
- Live SDoc generation for Rails — watches your source files and auto-regenerates API documentation on changes. Serves docs from `public/doc/` so they're available at `/doc/index.html` in development.
3
+ Live SDoc generation for Rails — watches your source files and auto-regenerates API documentation on changes. Serves docs via a mountable engine at a path you choose (e.g. `/doc`).
4
4
 
5
5
  ## Requirements
6
6
 
@@ -72,8 +72,8 @@ SdocLive.configure do |config|
72
72
  # Regex for file types that trigger regeneration (default: /\.rb$/)
73
73
  # config.watch_file_type_regex = /\.(rb|md)$/
74
74
 
75
- # Override the output directory (default: Rails.root.join("public", "doc"))
76
- # config.output_dir = Rails.root.join("public", "doc")
75
+ # Override the output directory (default: Rails.root.join("tmp", "doc"))
76
+ # config.output_dir = Rails.root.join("tmp", "doc")
77
77
 
78
78
  # Additional RDoc options passed to the SDoc generator
79
79
  # config.rdoc_options = ["--all", "--hyperlink-all"]
@@ -84,8 +84,8 @@ end if defined?(SdocLive)
84
84
 
85
85
  1. **Development**: Puma boots → forks a child process that runs `SdocLive::Generator#build_watch`
86
86
  2. The `listen` gem monitors `app/` and `lib/` for `.rb` file changes
87
- 3. On change, SDoc regenerates documentation into `public/doc/`
88
- 4. Docs are immediately available at `/doc/index.html`
87
+ 3. On change, SDoc regenerates documentation into `tmp/doc/`
88
+ 4. Docs are served by the mounted engine (e.g. at `/doc`)
89
89
  5. Clean subprocess management with bidirectional lifecycle monitoring (Puma ↔ SDoc)
90
90
 
91
91
  ## License
@@ -7,7 +7,7 @@ module SdocLive
7
7
  end
8
8
 
9
9
  initializer "sdoc_live.static" do |app|
10
- doc_root = (SdocLive.configuration.output_dir || app.root.join("public", "doc")).to_s
10
+ doc_root = (SdocLive.configuration.output_dir || app.root.join("tmp", "doc")).to_s
11
11
 
12
12
  SdocLive::Engine.routes.draw do
13
13
  doc_app = ::Rack::Static.new(
@@ -21,6 +21,22 @@ module SdocLive
21
21
  end
22
22
  end
23
23
 
24
+ initializer "sdoc_live.trailing_slash" do
25
+ SdocLive::Engine.middleware.use(Class.new do
26
+ def initialize(app)
27
+ @app = app
28
+ end
29
+
30
+ def call(env)
31
+ if env["PATH_INFO"] == ""
32
+ [301, { "location" => "#{ env['SCRIPT_NAME'] }/", "content-type" => "text/html" }, ["Redirecting..."]]
33
+ else
34
+ @app.call(env)
35
+ end
36
+ end
37
+ end)
38
+ end
39
+
24
40
  end
25
41
 
26
42
  end
@@ -10,7 +10,7 @@ module SdocLive
10
10
 
11
11
  config = SdocLive.configuration
12
12
 
13
- @output_dir = config.output_dir || @root.join("public", "doc")
13
+ @output_dir = config.output_dir || @root.join("tmp", "doc")
14
14
  @title = config.title
15
15
  @main_file = config.main_file
16
16
 
@@ -1,5 +1,5 @@
1
1
  module SdocLive
2
2
 
3
- VERSION = "0.1.6"
3
+ VERSION = "0.1.7"
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sdoc_live
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - 16554289+optimuspwnius@users.noreply.github.com