sdoc_live 0.1.4 → 0.1.6

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: 8f55bea568a0fd9f0191b2832b85ad06e3c501341d11c8eccdeb5d949eb3516f
4
- data.tar.gz: f87b928a857fc38826555f17ab4420e2b587ae1b4ad91d475566a77c5a9785d4
3
+ metadata.gz: 0d49bec64da362efab6cc71f5ab722679479610f07830183eaea7d5155ffa76e
4
+ data.tar.gz: 1ce67dcb81729bc112d383bfa48df0160300ab9ffc02e702486df9b0fa26a667
5
5
  SHA512:
6
- metadata.gz: 64a0cee8ce5a58d35f5b4ba65b700e1eb81c9edc2dbce32dfc4eef291dbdf3165009e5281276dfc02e33fa5a74fc393c263633b8afa42064607a1f7e6db7e9b8
7
- data.tar.gz: e9bf7b47a392ecd02e6fefcdcb667d70cb536de2ae737473514c25585e7332e55e5ec6e8f8da67f96224d7cede0cbfaace0deabdfdeb911d3189bcdef3cc99e3
6
+ metadata.gz: 6cb026920418d5effac5b16378160f5bc4e6c5a101083c6f920a8d3eff6d2f89214d396cde03309001137609cd97e9b47b930c7c4157bac94dc01f3dd4e5c301
7
+ data.tar.gz: aa5556dced2d25c494c12373817d4ecc498ca751647215ffc0bf5894f1170d39a25edb82b175bb43fc933c71846919cdd99bd313dd70fad8fe0bad51d9ef1b59
data/README.md CHANGED
@@ -26,7 +26,15 @@ Then run `bundle install`.
26
26
 
27
27
  ## Usage
28
28
 
29
- ### 1. Puma Plugin (Development Watch Mode)
29
+ ### 1. Mount the Engine
30
+
31
+ Add to your `config/routes.rb`:
32
+
33
+ ```ruby
34
+ mount SdocLive::Engine, at: "/doc"
35
+ ```
36
+
37
+ ### 2. Puma Plugin (Development Watch Mode)
30
38
 
31
39
  Add to your `config/puma.rb`:
32
40
 
@@ -38,9 +46,7 @@ end
38
46
 
39
47
  This watches `app/` and `lib/` for `.rb` file changes and automatically regenerates SDoc documentation.
40
48
 
41
- Docs are served at `/doc/index.html` via Rails' `public/` directory.
42
-
43
- ### 2. Rake Task (Manual / Deploy)
49
+ ### 3. Rake Task (Manual / Deploy)
44
50
 
45
51
  ```bash
46
52
  rake sdoc:build
@@ -8,7 +8,7 @@ Puma::Plugin.create do
8
8
  @log_writer = launcher.log_writer
9
9
  @puma_pid = $PROCESS_ID
10
10
 
11
- launcher.events.on_booted do
11
+ launcher.events.after_booted do
12
12
 
13
13
  @sdoc_pid = fork do
14
14
 
@@ -37,7 +37,7 @@ Puma::Plugin.create do
37
37
 
38
38
  end
39
39
 
40
- launcher.events.on_stopped { stop_sdoc }
40
+ launcher.events.after_stopped { stop_sdoc }
41
41
  end
42
42
 
43
43
  private
@@ -6,6 +6,21 @@ module SdocLive
6
6
  load File.expand_path("../tasks/sdoc_live.rake", __dir__)
7
7
  end
8
8
 
9
+ initializer "sdoc_live.static" do |app|
10
+ doc_root = (SdocLive.configuration.output_dir || app.root.join("public", "doc")).to_s
11
+
12
+ SdocLive::Engine.routes.draw do
13
+ doc_app = ::Rack::Static.new(
14
+ ->(_) { [404, { "content-type" => "text/plain" }, ["Not Found"]] },
15
+ urls: ["/"],
16
+ root: doc_root,
17
+ index: "index.html"
18
+ )
19
+
20
+ mount doc_app, at: "/"
21
+ end
22
+ end
23
+
9
24
  end
10
25
 
11
26
  end
@@ -1,5 +1,5 @@
1
1
  module SdocLive
2
2
 
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.6"
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.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - 16554289+optimuspwnius@users.noreply.github.com