rails-markup 1.4.6 → 1.4.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 +4 -4
- data/README.md +3 -3
- data/config/routes.rb +1 -1
- data/lib/generators/rails_markup/install_generator.rb +39 -5
- data/lib/rails_markup/cli.rb +7 -7
- data/lib/rails_markup/mcp_server.rb +2 -2
- data/lib/rails_markup/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 66260d5eb5dfb34aee5daa7f51a9a0649a1f241d6dfc3d0bf55fba7435727491
|
|
4
|
+
data.tar.gz: c4461eba4189f4351502bbf2fbcdef57387d6183570ef19c950538edb97c91ee
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a74b3f974b9124593cd889a78702ebeb466a83f9ca9763102499a4898246b0b0cecca3b53a5af77754d848188cd161f5e90c50a10d6d5b4962b309e343309850
|
|
7
|
+
data.tar.gz: d1f9f8910a108fe314da756afedaf9bd0b46d8d780603adb034d960e17e34cbf4823a2ede9832afb4199ebdf1042d071ef89586051fd5e3731ba878acb1a4457
|
data/README.md
CHANGED
|
@@ -81,14 +81,14 @@ The generator creates:
|
|
|
81
81
|
| `config/initializers/rails_markup.rb` | Configuration |
|
|
82
82
|
| `app/controllers/rails_markup_auth_controller.rb` | Auth controller |
|
|
83
83
|
| `bin/markup` | CLI wrapper |
|
|
84
|
-
| Route mount | Engine at `/admin/
|
|
84
|
+
| Route mount | Engine at `/admin/rails-markup` |
|
|
85
85
|
| Toolbar injection | Admin-gated `render "rails_markup/shared/toolbar"` in your layout |
|
|
86
86
|
|
|
87
87
|
### Generator options
|
|
88
88
|
|
|
89
89
|
```bash
|
|
90
90
|
rails generate rails_markup:install \
|
|
91
|
-
--mount-path=/admin/
|
|
91
|
+
--mount-path=/admin/rails-markup \
|
|
92
92
|
--base-controller=Admin::BaseController \
|
|
93
93
|
--layout=application
|
|
94
94
|
```
|
|
@@ -169,7 +169,7 @@ end
|
|
|
169
169
|
|
|
170
170
|
## Dashboard
|
|
171
171
|
|
|
172
|
-
Visit `/admin/
|
|
172
|
+
Visit `/admin/rails-markup` for the full dashboard:
|
|
173
173
|
|
|
174
174
|
- **List view** — status filters, search, author filter, load-more pagination
|
|
175
175
|
- **Board view** — kanban with drag-and-drop status transitions
|
data/config/routes.rb
CHANGED
|
@@ -30,7 +30,7 @@ RailsMarkup::Engine.routes.draw do
|
|
|
30
30
|
|
|
31
31
|
# External API (token-authenticated, used by MCP/CLI tools)
|
|
32
32
|
# Paths: /external/pending, /external/:id, /external/:id/{action}
|
|
33
|
-
# Full URL (with mount): /admin/
|
|
33
|
+
# Full URL (with mount): /admin/rails-markup/external/pending
|
|
34
34
|
namespace :external, defaults: { format: :json } do
|
|
35
35
|
get "pending", to: "annotations#pending"
|
|
36
36
|
get ":id", to: "annotations#show", constraints: { id: /\d+/ }
|
|
@@ -12,8 +12,8 @@ module RailsMarkup
|
|
|
12
12
|
|
|
13
13
|
desc "Install Rails Markup: create migration, initializer, auth controller, toolbar, and mount engine routes."
|
|
14
14
|
|
|
15
|
-
class_option :mount_path, type: :string, default:
|
|
16
|
-
desc: "Path to mount the Rails Markup engine"
|
|
15
|
+
class_option :mount_path, type: :string, default: nil,
|
|
16
|
+
desc: "Path to mount the Rails Markup engine (leave blank to be prompted)"
|
|
17
17
|
class_option :base_controller, type: :string, default: "ApplicationController",
|
|
18
18
|
desc: "Base controller class for authentication"
|
|
19
19
|
class_option :layout, type: :string, default: "application",
|
|
@@ -59,7 +59,7 @@ module RailsMarkup
|
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
def mount_engine
|
|
62
|
-
mount_path =
|
|
62
|
+
mount_path = resolved_mount_path
|
|
63
63
|
route_line = %{mount RailsMarkup::Engine, at: "#{mount_path}" if defined?(RailsMarkup::Engine)}
|
|
64
64
|
route route_line
|
|
65
65
|
end
|
|
@@ -140,7 +140,7 @@ module RailsMarkup
|
|
|
140
140
|
dev_url = detect_dev_url
|
|
141
141
|
env_updates = {
|
|
142
142
|
"RAILS_MARKUP_DEV_URL" => dev_url,
|
|
143
|
-
"RAILS_MARKUP_MOUNT_PATH" =>
|
|
143
|
+
"RAILS_MARKUP_MOUNT_PATH" => resolved_mount_path
|
|
144
144
|
}
|
|
145
145
|
config.update_env(env_updates)
|
|
146
146
|
say_status :create, ".mcp.json (dev URL: #{dev_url})", :green
|
|
@@ -159,7 +159,7 @@ module RailsMarkup
|
|
|
159
159
|
say ""
|
|
160
160
|
say "Next steps:"
|
|
161
161
|
say " 1. Run migrations: rails db:migrate"
|
|
162
|
-
say " 2. Visit dashboard: #{
|
|
162
|
+
say " 2. Visit dashboard: #{resolved_mount_path}"
|
|
163
163
|
say " 3. Configure auth in config/initializers/rails_markup.rb"
|
|
164
164
|
say ""
|
|
165
165
|
dev_url = detect_dev_url
|
|
@@ -180,6 +180,40 @@ module RailsMarkup
|
|
|
180
180
|
|
|
181
181
|
private
|
|
182
182
|
|
|
183
|
+
def resolved_mount_path
|
|
184
|
+
@resolved_mount_path ||= begin
|
|
185
|
+
explicit = options[:mount_path]
|
|
186
|
+
return normalize_mount_path(explicit) if explicit && !explicit.strip.empty?
|
|
187
|
+
|
|
188
|
+
prompt_mount_path
|
|
189
|
+
end
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
def prompt_mount_path
|
|
193
|
+
return "/rails-markup" unless interactive_prompt_available?
|
|
194
|
+
|
|
195
|
+
if yes?("Choose a nested prefix before /rails-markup? (for example /admin/rails-markup or /dashboard/rails-markup)")
|
|
196
|
+
prefix = ask("Prefix segment (leave blank for admin)")
|
|
197
|
+
prefix = "admin" if prefix.to_s.strip.empty?
|
|
198
|
+
normalize_mount_path("#{prefix}/rails-markup")
|
|
199
|
+
else
|
|
200
|
+
"/rails-markup"
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
def interactive_prompt_available?
|
|
205
|
+
$stdin.tty? && $stdout.tty?
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
def normalize_mount_path(path)
|
|
209
|
+
value = path.to_s.strip
|
|
210
|
+
value = value.sub(%r{\A/+}, "")
|
|
211
|
+
value = value.sub(%r{/+\z}, "")
|
|
212
|
+
value = "/#{value}"
|
|
213
|
+
value = value.gsub(%r{/+}, "/")
|
|
214
|
+
value == "/" ? "/rails-markup" : value
|
|
215
|
+
end
|
|
216
|
+
|
|
183
217
|
def migration_version
|
|
184
218
|
"[#{ActiveRecord::Migration.current_version}]"
|
|
185
219
|
end
|
data/lib/rails_markup/cli.rb
CHANGED
|
@@ -110,7 +110,7 @@ module RailsMarkup
|
|
|
110
110
|
method_option :prod_url, type: :string, desc: "Production URL (RAILS_MARKUP_PROD_URL)"
|
|
111
111
|
method_option :prod_token, type: :string, desc: "Production API token (RAILS_MARKUP_PROD_TOKEN)"
|
|
112
112
|
method_option :dev_url, type: :string, desc: "Dev URL (RAILS_MARKUP_DEV_URL)"
|
|
113
|
-
method_option :mount_path, type: :string, desc: "Engine mount path (RAILS_MARKUP_MOUNT_PATH)"
|
|
113
|
+
method_option :mount_path, type: :string, desc: "Engine mount path (RAILS_MARKUP_MOUNT_PATH; e.g. /admin/rails-markup)"
|
|
114
114
|
method_option :global, type: :boolean, default: false, desc: "Write to ~/.claude/settings.json"
|
|
115
115
|
method_option :codex, type: :boolean, default: false, desc: "Write to ~/.codex/config.toml"
|
|
116
116
|
def configure
|
|
@@ -209,7 +209,7 @@ module RailsMarkup
|
|
|
209
209
|
method_option :production, type: :boolean, default: false, desc: "Watch production"
|
|
210
210
|
method_option :url, type: :string, desc: "Override base URL"
|
|
211
211
|
method_option :token, type: :string, desc: "Override API token"
|
|
212
|
-
method_option :mount_path, type: :string, desc: "Engine mount path"
|
|
212
|
+
method_option :mount_path, type: :string, desc: "Engine mount path (e.g. /admin/rails-markup)"
|
|
213
213
|
method_option :interval, type: :numeric, default: 5, desc: "Poll interval in seconds"
|
|
214
214
|
def watch
|
|
215
215
|
env = resolve_env(options[:production])
|
|
@@ -259,7 +259,7 @@ module RailsMarkup
|
|
|
259
259
|
method_option :production, type: :boolean, default: false, desc: "Fetch from production"
|
|
260
260
|
method_option :url, type: :string, desc: "Override base URL"
|
|
261
261
|
method_option :token, type: :string, desc: "Override API token"
|
|
262
|
-
method_option :mount_path, type: :string, desc: "Engine mount path"
|
|
262
|
+
method_option :mount_path, type: :string, desc: "Engine mount path (e.g. /admin/rails-markup)"
|
|
263
263
|
def pending
|
|
264
264
|
env = resolve_env(options[:production])
|
|
265
265
|
return unless env
|
|
@@ -433,7 +433,7 @@ module RailsMarkup
|
|
|
433
433
|
desc: "Environment to fetch from"
|
|
434
434
|
method_option :url, type: :string, desc: "Override base URL"
|
|
435
435
|
method_option :token, type: :string, desc: "Override API token"
|
|
436
|
-
method_option :mount_path, type: :string, desc: "Engine mount path (default: /admin/
|
|
436
|
+
method_option :mount_path, type: :string, desc: "Engine mount path (default: /admin/rails-markup; e.g. /admin/rails-markup)"
|
|
437
437
|
def fetch(env_arg = nil)
|
|
438
438
|
production = env_arg == "production" || options[:production] || options[:environment] == "production"
|
|
439
439
|
env = resolve_env(production)
|
|
@@ -571,7 +571,7 @@ module RailsMarkup
|
|
|
571
571
|
sections << " --prod-url URL Production URL"
|
|
572
572
|
sections << " --prod-token TOKEN Production API token"
|
|
573
573
|
sections << " --dev-url URL Development URL"
|
|
574
|
-
sections << " --mount-path PATH Engine mount path"
|
|
574
|
+
sections << " --mount-path PATH Engine mount path (e.g. /admin/rails-markup)"
|
|
575
575
|
sections << " --global Write to ~/.claude/settings.json"
|
|
576
576
|
sections << " --codex Write to ~/.codex/config.toml"
|
|
577
577
|
sections << " setup-production --url URL Generate token + configure production"
|
|
@@ -671,7 +671,7 @@ module RailsMarkup
|
|
|
671
671
|
if production
|
|
672
672
|
base_url = options[:url] || mcp_env["RAILS_MARKUP_PROD_URL"]
|
|
673
673
|
token = options[:token] || mcp_env["RAILS_MARKUP_PROD_TOKEN"]
|
|
674
|
-
mount = options[:mount_path] || mcp_env["RAILS_MARKUP_MOUNT_PATH"] || "/admin/
|
|
674
|
+
mount = options[:mount_path] || mcp_env["RAILS_MARKUP_MOUNT_PATH"] || "/admin/rails-markup"
|
|
675
675
|
|
|
676
676
|
unless base_url
|
|
677
677
|
say "No production URL. Set it via:", :red
|
|
@@ -695,7 +695,7 @@ module RailsMarkup
|
|
|
695
695
|
else
|
|
696
696
|
base_url = options[:url] || mcp_env["RAILS_MARKUP_DEV_URL"]
|
|
697
697
|
token = options[:token] || mcp_env["RAILS_MARKUP_DEV_TOKEN"]
|
|
698
|
-
mount = options[:mount_path] || mcp_env["RAILS_MARKUP_MOUNT_PATH"] || "/admin/
|
|
698
|
+
mount = options[:mount_path] || mcp_env["RAILS_MARKUP_MOUNT_PATH"] || "/admin/rails-markup"
|
|
699
699
|
|
|
700
700
|
unless base_url
|
|
701
701
|
say "No dev URL. Set it via:", :red
|
|
@@ -17,7 +17,7 @@ module RailsMarkup
|
|
|
17
17
|
# RAILS_MARKUP_DEV_URL — local Rails server URL (auto-detected on install)
|
|
18
18
|
# RAILS_MARKUP_PROD_URL — production URL
|
|
19
19
|
# RAILS_MARKUP_PROD_TOKEN — production API token
|
|
20
|
-
# RAILS_MARKUP_MOUNT_PATH — engine mount path (default: /admin/
|
|
20
|
+
# RAILS_MARKUP_MOUNT_PATH — engine mount path (default: /admin/rails-markup)
|
|
21
21
|
class McpServer
|
|
22
22
|
class ToolError < StandardError; end
|
|
23
23
|
class TargetError < ToolError; end
|
|
@@ -184,7 +184,7 @@ module RailsMarkup
|
|
|
184
184
|
end
|
|
185
185
|
|
|
186
186
|
def mount_path
|
|
187
|
-
config_value("RAILS_MARKUP_MOUNT_PATH") || "/admin/
|
|
187
|
+
config_value("RAILS_MARKUP_MOUNT_PATH") || "/admin/rails-markup"
|
|
188
188
|
end
|
|
189
189
|
|
|
190
190
|
def prod_url
|
data/lib/rails_markup/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails-markup
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.4.
|
|
4
|
+
version: 1.4.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- InventList
|
|
@@ -184,7 +184,7 @@ post_install_message: |
|
|
|
184
184
|
rails db:migrate
|
|
185
185
|
|
|
186
186
|
Options:
|
|
187
|
-
--mount-path=/admin/
|
|
187
|
+
--mount-path=/admin/rails-markup (engine route)
|
|
188
188
|
--base-controller=AdminController (auth parent class)
|
|
189
189
|
--layout=application (toolbar injection)
|
|
190
190
|
rdoc_options: []
|