Skip to content

NameErrorの修正、EPUBダウンロードの接続先解決、およびWebUI小説削除の修正 - #116

Merged
ponponusa merged 1 commit into
developfrom
fix/3.1.5
May 24, 2026
Merged

NameErrorの修正、EPUBダウンロードの接続先解決、およびWebUI小説削除の修正#116
ponponusa merged 1 commit into
developfrom
fix/3.1.5

Conversation

@ponponusa

Copy link
Copy Markdown
Owner

概要

GitHub上のオープンな不具合 (#115, #114, #113) の修正、およびAI開発用のガイドラインである GEMINI.md の追加を行いました。

修正・変更内容

1. #115: CLI browser コマンドにおける NameError の修正

  • 問題: CLI実行時に Database クラスおよび Downloader クラスが事前に require されていないため NameError (uninitialized constant) が発生し停止する。
  • 対応:
    • lib/cli/commandbase.rbrequire "core/database" を追加。
    • lib/cli/command/browser.rbrequire "novel/downloader" を追加。

2. #114: WEBUIでのEPUBダウンロード接続先解決の動的化

  • 問題: server-bind のIPアドレスを変更してWebUIにアクセスした際、EPUBのダウンロードAPIエンドポイントが localhost 固定となっており ERR_CONNECTION_REFUSED で失敗する。
  • 対応:
    • frontend/src/lib/backend-config.ts を修正し、ブラウザからのアクセス時は window.location.hostname を用いて接続先を動的に決定するように変更。

3. #113: WebUI 小説個別削除エラーの修正

  • 問題: 小説リストの三点リーダーメニューから「削除」を選択すると、バックエンドに DELETE /api/v2/novels/:id が存在しないため削除に失敗する。
  • 対応:
    • frontend/src/lib/api.tsdeleteNovel 関数を修正し、実績のある一括削除用API removeNovels([id]) (POST /api/v2/novels/remove) を呼び出すようにフォールバック。

4. 開発ガイドライン GEMINI.md の追加

  • 開発環境の調査結果およびAntigravity/Gemini用の開発ガイドラインとして、GEMINI.md をルートおよび frontend/ 配下に新規作成。

検証結果

  • spec/cli/commandbase_spec.rb によるRSpecテストは全件正常パス (17 examples, 0 failures)。
  • npm run check によるフロントエンド型チェックは正常クリア (0 errors, 0 warnings)。

- browserコマンドでの uninitialized constant NameError を解消するため、Database と Downloader の require を追加 (#115)

- server-bind 変更時にWebUIからEPUBがダウンロードできなくなるバグを修正するため、接続先を window.location.hostname に基づいて動的に解決するよう修正 (#114)

- 三点リーダーからの小説個別削除が失敗するバグを修正するため、DELETEメソッドではなく実績のある一括削除用のPOST APIを呼び出すよう代替 (#113)

- 開発環境の調査結果とAntigravity/Gemini用の開発ガイドラインとして、GEMINI.md をルートおよびfrontend配下に作成
@ponponusa
ponponusa merged commit 1339722 into develop May 24, 2026
5 checks passed
@ponponusa
ponponusa deleted the fix/3.1.5 branch May 24, 2026 03:53

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 20b23b7678

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/cli/commandbase.rb

require "optparse"
require "termcolorlight"
require "core/database"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use root-relative require path for Database

CommandBase is loaded for every CLI command, but this new require "core/database" does not match this repo’s load-path convention (narou.rb only guarantees project root, and existing files require lib/...). In contexts where gem-managed lib is not on $LOAD_PATH (e.g. direct ruby narou.rb ... runs), this raises LoadError before any command executes. Switching to require "lib/core/database" keeps behavior consistent with the rest of the codebase and avoids startup failure.

Useful? React with 👍 / 👎.

#

require "lib/core/inventory"
require "novel/downloader"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Require Downloader via project root path

This command now uses require "novel/downloader", but other command files load it as require "lib/novel/downloader". If the runtime only has project root on $LOAD_PATH (the same mode supported by narou.rb), this path is unresolved and browser fails to load with LoadError. Using the existing lib/... require form avoids environment-dependent breakage.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant