Day 5 achievements: - Created independent FileBox plugin crate with C FFI exports - Integrated plugin loading into Nyash interpreter startup - Implemented transparent builtin/plugin Box switching via nyash.toml - Successfully loaded plugin library (385KB .so) at runtime - Confirmed PluginBox proxy creation for FileBox instances Architecture changes: - Added plugins/ directory with .gitignore for build artifacts - Modified runner.rs to load plugins from nyash.toml on startup - Updated objects.rs to use BoxFactoryRegistry for FileBox creation - Fixed bid module visibility between lib.rs and main.rs Remaining work (10%): - Complete PluginBox proxy method implementations (toString, etc.) - Test actual file operations through plugin interface - Finalize error handling and edge cases Build status: All tests passing, plugin loading confirmed
35 lines
1.2 KiB
Plaintext
35 lines
1.2 KiB
Plaintext
// Nyash FileBoxプラグイン透過的切り替えテスト
|
||
// nyash.tomlの設定によってビルトイン/プラグインが切り替わる
|
||
|
||
static box Main {
|
||
init { console, file, result }
|
||
|
||
main() {
|
||
me.console = new ConsoleBox()
|
||
me.console.log("🎯 FileBox Plugin Switching Test")
|
||
me.console.log("================================")
|
||
|
||
// FileBox作成(透過的切り替え対象)
|
||
me.file = new FileBox("test_plugin_output.txt")
|
||
me.console.log("📁 FileBox created: " + me.file.toString())
|
||
|
||
// 現在使用されているFileBox実装を確認
|
||
me.console.log("🔍 FileBox type: " + me.file.toString())
|
||
|
||
// 簡単なファイル操作テスト
|
||
local testPath
|
||
testPath = "test_plugin_output.txt"
|
||
|
||
me.console.log("📝 Testing file operations...")
|
||
|
||
// TODO: ファイル操作API呼び出し
|
||
// file.open(testPath)
|
||
// file.write("Hello from " + file.toString())
|
||
// file.close()
|
||
|
||
me.result = "Plugin switching test completed!"
|
||
me.console.log("✅ " + me.result)
|
||
|
||
return me.result
|
||
}
|
||
} |