agent_homedir 0.3.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ee8a28fc460970a2dc5a65b37a2877da91c2973b22afc538103762c4fe3b8683
4
+ data.tar.gz: 16881f4dbdb024aa13854e52b6370f74aa069eb466521ff6321e587a4996cfeb
5
+ SHA512:
6
+ metadata.gz: 063acae100046992dee4bf5c52489d67390841d94dabc96cdfe96c5bf4d4974bd805f80e5a9ffe4edc82ae3d5eab623a8d7911ae63d95bad11dbe552759aecb8
7
+ data.tar.gz: c5b17c6b90ba6cc5182c8e7161bb5640c45a529cc33975aaaba1ffc162d8cbc0ea95bcab6c33c86f6d2178b3fb3098863e2fc4c9d1622041c91481544f775662
data/CHANGELOG.md ADDED
@@ -0,0 +1,40 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ ## [0.3.0] - 2026-08-25
6
+
7
+ ### Changed
8
+
9
+ - Renamed the gem from `agents_homedir` to `agent_homedir`.
10
+ - Moved the public API from `AgentsHomedir` to `Agent::Homedir` for the planned
11
+ `Agent::` gem family.
12
+ - Renamed the immutable data class from `AgentsHomedir::Agent` to
13
+ `Agent::Homedir::Entry`.
14
+
15
+ ### Deprecated
16
+
17
+ - Deprecated the old `agents_homedir` gem in favor of `agent_homedir`.
18
+
19
+ ## [0.2.0] - 2026-08-25
20
+
21
+ ### Added
22
+
23
+ - Added `bin/prepare_release` to run tests, regenerate documentation, create
24
+ `llm.txt`, and build the release artifact in one fail-fast workflow.
25
+ - Added generated Markdown API documentation and an LLM-oriented entry point.
26
+ - Added regression coverage for documentation generation, release command
27
+ ordering, failure handling, and packaged documentation links.
28
+ - Added the usage demo image to the README.
29
+
30
+ ### Changed
31
+
32
+ - Included `llm.txt` and every linked API document in the packaged gem.
33
+ - Corrected the gem author email metadata.
34
+
35
+ ## [0.1.0] - 2026-08-25
36
+
37
+ ### Added
38
+
39
+ - Initial release with home-directory resolution for supported AI coding
40
+ agents, immutable agent values, environment overrides, and OS-aware defaults.
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 Lucian Ghinda
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,177 @@
1
+ # Agent::Homedir
2
+
3
+ Find the home folder an AI coding agent uses, without reading contents.
4
+
5
+ <img width="1400" height="850" alt="agent_homedir-demo" src="https://github.com/user-attachments/assets/62fa43bc-5df6-42c0-af2c-1f25ea7070a1" />
6
+
7
+
8
+ ## Installation
9
+
10
+ Use Ruby 3.2 or newer. The gem ships with one runtime dependency: Zeitwerk 2.8.
11
+
12
+ Add this line to your application's **Gemfile**:
13
+
14
+ ```ruby
15
+ gem "agent_homedir"
16
+ ```
17
+
18
+ Then run:
19
+
20
+ ```sh
21
+ bundle install
22
+ ```
23
+
24
+ Or install it directly:
25
+
26
+ ```sh
27
+ gem install agent_homedir
28
+ ```
29
+
30
+ ## Quick Start
31
+
32
+ Get a home path:
33
+
34
+ ```ruby
35
+ require "agent_homedir"
36
+
37
+ Agent::Homedir.home(:claude_code)
38
+ ```
39
+
40
+ Check installation:
41
+
42
+ ```ruby
43
+ require "agent_homedir"
44
+
45
+ Agent::Homedir.installed?(:codex)
46
+ ```
47
+
48
+ Expect a `Pathname` and a boolean.
49
+
50
+ The module facade is snapshotted on first access.
51
+ That snapshots `ENV` and `HOME` for the rest of the process.
52
+ If you need a different snapshot, instantiate `Agent::Homedir::Resolver` directly.
53
+
54
+ ## Usage
55
+
56
+ Fetch an agent:
57
+
58
+ ```ruby
59
+ require "agent_homedir"
60
+
61
+ agent = Agent::Homedir[:codex]
62
+
63
+ agent.name
64
+ agent.label
65
+ agent.home
66
+ ```
67
+
68
+ Discover the catalog:
69
+
70
+ ```ruby
71
+ require "agent_homedir"
72
+
73
+ Agent::Homedir.names
74
+ Agent::Homedir.agents
75
+ Agent::Homedir.installed
76
+ ```
77
+
78
+ Expect ordered, frozen arrays.
79
+
80
+ ### Supported agents
81
+
82
+ Use these names with every lookup method:
83
+
84
+ | Agent | Name |
85
+ | --- | --- |
86
+ | Claude Code | `:claude_code` |
87
+ | Codex CLI | `:codex` |
88
+ | Gemini CLI | `:gemini` |
89
+ | Antigravity CLI | `:antigravity_cli` |
90
+ | Antigravity IDE | `:antigravity_ide` |
91
+ | Antigravity App | `:antigravity_app` |
92
+ | Qwen Code | `:qwen` |
93
+ | Pi | `:pi` |
94
+ | Amp | `:amp` |
95
+ | OpenCode | `:opencode` |
96
+ | Cursor | `:cursor` |
97
+ | Cursor IDE | `:cursor_ide` |
98
+ | GitHub Copilot CLI | `:github_copilot_cli` |
99
+ | VS Code Copilot Chat | `:vscode_copilot_chat` |
100
+ | Cline | `:cline` |
101
+ | Cline for VS Code | `:cline_vscode` |
102
+ | Grok Build | `:grok_build` |
103
+ | Vibe | `:vibe` |
104
+ | Muse Code | `:muse` |
105
+ | Prime Agent | `:prime_agent` |
106
+ | DeepSeek Harness | `:deepseek_harness` |
107
+ | Hermes Agent | `:hermes` |
108
+ | Factory Droid | `:factory_droid` |
109
+ | Devin CLI | `:devin_cli` |
110
+ | Devin Desktop | `:devin_desktop` |
111
+
112
+ Inspect agent facts:
113
+
114
+ ```ruby
115
+ require "agent_homedir"
116
+
117
+ agent = Agent::Homedir[:claude_code]
118
+
119
+ agent.env_override
120
+ agent.verified_on
121
+ agent.candidates
122
+ ```
123
+
124
+ Resolution order:
125
+
126
+ - Use a nonblank native override.
127
+ - Use the first existing directory candidate.
128
+ - Use the first candidate otherwise.
129
+
130
+ Agent facts:
131
+
132
+ - `name` is a `Symbol`.
133
+ - `label` is a `String`.
134
+ - `home` returns a `Pathname`.
135
+ - `installed?` returns a boolean.
136
+ - `candidates` returns an ordered, frozen array of `Pathname` objects.
137
+ - `env_override` is a `String` or `nil`.
138
+ - `verified_on` is a `Date` or `nil`.
139
+
140
+ Errors:
141
+
142
+ - Catch `Agent::Homedir::UnknownAgent` to list valid names.
143
+ - Catch `Agent::Homedir::HomeNotResolvable` for missing, blank, or nonabsolute `HOME`.
144
+
145
+ ## Testing
146
+
147
+ Pass `env`, `home`, and `os` explicitly.
148
+ Instantiate a fresh resolver when you need a different environment snapshot.
149
+ Do not stub global `ENV`.
150
+
151
+ ```ruby
152
+ require "agent_homedir"
153
+
154
+ resolver = Agent::Homedir::Resolver.new(
155
+ env: { "CODEX_HOME" => "custom/codex" },
156
+ home: "/Users/me",
157
+ os: :linux
158
+ )
159
+
160
+ resolver.home(:codex)
161
+ # => #<Pathname:/Users/me/custom/codex>
162
+ ```
163
+
164
+ ## Contributing
165
+
166
+ Activate Ruby 3.2 or newer.
167
+
168
+ Run the tests before sending a change.
169
+
170
+ ```sh
171
+ bundle install
172
+ bundle exec rake test
173
+ ```
174
+
175
+ ## License
176
+
177
+ MIT
@@ -0,0 +1,24 @@
1
+ # Class Agent::Homedir::Entry <a id="class-Agent-Homedir-Entry"></a>
2
+
3
+ | | |
4
+ | --- | --- |
5
+ | **Inherits** | Object |
6
+ | **Defined in** | lib/agent/homedir/entry.rb |
7
+
8
+ ## Public Instance Methods
9
+ ### `candidates()` <a id="method-i-candidates"></a> <a id="candidates-instance_method"></a>
10
+ Not documented.
11
+
12
+ ### `home()` <a id="method-i-home"></a> <a id="home-instance_method"></a>
13
+ Not documented.
14
+
15
+ ### `initialize(name:, label:, env_override:, verified_on:, resolver:)` <a id="method-i-initialize"></a> <a id="initialize-instance_method"></a>
16
+ Equality and hash intentionally cover only public facts. Resolver-specific
17
+ caches should key by resolver and agent name.
18
+ - **@return** [Entry] a new instance of Entry
19
+
20
+ ### `installed?()` <a id="method-i-installed-3F"></a> <a id="installed?-instance_method"></a>
21
+ - **@return** [Boolean]
22
+
23
+ ### `with(**changes)` <a id="method-i-with"></a> <a id="with-instance_method"></a>
24
+ Not documented.
@@ -0,0 +1,6 @@
1
+ # Class Agent::Homedir::Error <a id="class-Agent-Homedir-Error"></a>
2
+
3
+ | | |
4
+ | --- | --- |
5
+ | **Inherits** | StandardError |
6
+ | **Defined in** | lib/agent/homedir/error.rb |
@@ -0,0 +1,6 @@
1
+ # Class Agent::Homedir::HomeNotResolvable <a id="class-Agent-Homedir-HomeNotResolvable"></a>
2
+
3
+ | | |
4
+ | --- | --- |
5
+ | **Inherits** | [Agent::Homedir::Error](Error.md) |
6
+ | **Defined in** | lib/agent/homedir/home_not_resolvable.rb |
@@ -0,0 +1,45 @@
1
+ # Class Agent::Homedir::Resolver <a id="class-Agent-Homedir-Resolver"></a>
2
+
3
+ | | |
4
+ | --- | --- |
5
+ | **Inherits** | Object |
6
+ | **Defined in** | lib/agent/homedir/resolver.rb |
7
+
8
+ ## Constants
9
+ ### `VALID_OSES` <a id="constant-VALID_OSES"></a> <a id="VALID_OSES-constant"></a>
10
+ Not documented.
11
+
12
+ ### `WINDOWS_DRIVE_PATH` <a id="constant-WINDOWS_DRIVE_PATH"></a> <a id="WINDOWS_DRIVE_PATH-constant"></a>
13
+ Not documented.
14
+
15
+ ### `WINDOWS_UNC_PATH` <a id="constant-WINDOWS_UNC_PATH"></a> <a id="WINDOWS_UNC_PATH-constant"></a>
16
+ Not documented.
17
+
18
+ ## Public Class Methods
19
+ ### `default_os()` <a id="method-c-default_os"></a> <a id="default_os-class_method"></a>
20
+ Not documented.
21
+
22
+ ## Public Instance Methods
23
+ ### `[] (name)` <a id="method-i--5B-5D"></a> <a id="[]-instance_method"></a>
24
+ Not documented.
25
+
26
+ ### `agents()` <a id="method-i-agents"></a> <a id="agents-instance_method"></a>
27
+ Not documented.
28
+
29
+ ### `candidates(name)` <a id="method-i-candidates"></a> <a id="candidates-instance_method"></a>
30
+ Not documented.
31
+
32
+ ### `home(name)` <a id="method-i-home"></a> <a id="home-instance_method"></a>
33
+ Not documented.
34
+
35
+ ### `initialize(env: = ENV.to_h, home: = ENV["HOME"], os: = self.class.default_os, entries: = Registry.entries)` <a id="method-i-initialize"></a> <a id="initialize-instance_method"></a>
36
+ - **@return** [Resolver] a new instance of Resolver
37
+
38
+ ### `installed()` <a id="method-i-installed"></a> <a id="installed-instance_method"></a>
39
+ Not documented.
40
+
41
+ ### `installed?(name)` <a id="method-i-installed-3F"></a> <a id="installed?-instance_method"></a>
42
+ - **@return** [Boolean]
43
+
44
+ ### `names()` <a id="method-i-names"></a> <a id="names-instance_method"></a>
45
+ Not documented.
@@ -0,0 +1,6 @@
1
+ # Class Agent::Homedir::UnknownAgent <a id="class-Agent-Homedir-UnknownAgent"></a>
2
+
3
+ | | |
4
+ | --- | --- |
5
+ | **Inherits** | [Agent::Homedir::Error](Error.md) |
6
+ | **Defined in** | lib/agent/homedir/unknown_agent.rb |
@@ -0,0 +1,60 @@
1
+ # Module Agent::Homedir <a id="module-Agent-Homedir"></a>
2
+
3
+ | | |
4
+ | --- | --- |
5
+ | **Defined in** | lib/agent/homedir.rb, lib/agent/homedir/entry.rb, lib/agent/homedir/error.rb, lib/agent/homedir/version.rb, lib/agent/homedir/registry.rb, lib/agent/homedir/resolver.rb, lib/agent/homedir/unknown_agent.rb, lib/agent/homedir/home_not_resolvable.rb |
6
+
7
+ ## Constants
8
+ ### `DEFAULT_RESOLVER_MONITOR` <a id="constant-DEFAULT_RESOLVER_MONITOR"></a> <a id="DEFAULT_RESOLVER_MONITOR-constant"></a>
9
+ Not documented.
10
+
11
+ ### `VERSION` <a id="constant-VERSION"></a> <a id="VERSION-constant"></a>
12
+ Not documented.
13
+
14
+ ## Public Class Methods
15
+ ### `[] (name)` <a id="method-c--5B-5D"></a> <a id="[]-class_method"></a>
16
+ Returns the named agent from the default registry.
17
+ - **@param** `name` [String, Symbol]
18
+ - **@raise** [Agent::Homedir::UnknownAgent] if the name is not registered
19
+ - **@return** [Agent::Homedir::Entry]
20
+
21
+ ### `agents()` <a id="method-c-agents"></a> <a id="agents-class_method"></a>
22
+ Returns all known agents in registry order.
23
+ - **@return** [Array<Agent::Homedir::Entry>]
24
+
25
+ ### `default_resolver()` <a id="method-c-default_resolver"></a> <a id="default_resolver-class_method"></a>
26
+ Returns the memoized default resolver built from the current environment. ENV
27
+ and HOME are snapshotted on first access and reused for process lifetime.
28
+ - **@raise** [ArgumentError] if the current host OS is unsupported
29
+ - **@return** [Agent::Homedir::Resolver]
30
+
31
+ ### `home(name)` <a id="method-c-home"></a> <a id="home-class_method"></a>
32
+ Returns the configured home directory for the named agent.
33
+ - **@param** `name` [String, Symbol]
34
+ - **@raise** [Agent::Homedir::UnknownAgent] if the name is not registered
35
+ - **@raise** [Agent::Homedir::HomeNotResolvable] if HOME is missing, blank, or not absolute
36
+ - **@return** [Pathname]
37
+
38
+ ### `installed()` <a id="method-c-installed"></a> <a id="installed-class_method"></a>
39
+ Returns currently installed agents in registry order.
40
+ - **@raise** [Agent::Homedir::HomeNotResolvable] if HOME is missing, blank, or not absolute
41
+ - **@return** [Array<Agent::Homedir::Entry>]
42
+
43
+ ### `installed?(name)` <a id="method-c-installed-3F"></a> <a id="installed?-class_method"></a>
44
+ Returns whether the named agent is currently installed.
45
+ - **@param** `name` [String, Symbol]
46
+ - **@raise** [Agent::Homedir::UnknownAgent] if the name is not registered
47
+ - **@raise** [Agent::Homedir::HomeNotResolvable] if HOME is missing, blank, or not absolute
48
+ - **@return** [Boolean]
49
+
50
+ ### `names()` <a id="method-c-names"></a> <a id="names-class_method"></a>
51
+ Returns all known agent names in registry order.
52
+ - **@return** [Array<Symbol>]
53
+
54
+ # Documentation
55
+
56
+ - [Homedir/Entry.md](Homedir/Entry.md)
57
+ - [Homedir/Error.md](Homedir/Error.md)
58
+ - [Homedir/HomeNotResolvable.md](Homedir/HomeNotResolvable.md)
59
+ - [Homedir/Resolver.md](Homedir/Resolver.md)
60
+ - [Homedir/UnknownAgent.md](Homedir/UnknownAgent.md)
data/doc/Agent.md ADDED
@@ -0,0 +1,5 @@
1
+ # Module Agent <a id="module-Agent"></a>
2
+
3
+ | | |
4
+ | --- | --- |
5
+ | **Defined in** | lib/agent/homedir.rb, lib/agent/homedir/entry.rb, lib/agent/homedir/error.rb, lib/agent/homedir/version.rb, lib/agent/homedir/registry.rb, lib/agent/homedir/resolver.rb, lib/agent/homedir/unknown_agent.rb, lib/agent/homedir/home_not_resolvable.rb |
data/doc/CHANGELOG.md ADDED
@@ -0,0 +1,40 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ ## [0.3.0] - 2026-08-25
6
+
7
+ ### Changed
8
+
9
+ - Renamed the gem from `agents_homedir` to `agent_homedir`.
10
+ - Moved the public API from `AgentsHomedir` to `Agent::Homedir` for the planned
11
+ `Agent::` gem family.
12
+ - Renamed the immutable data class from `AgentsHomedir::Agent` to
13
+ `Agent::Homedir::Entry`.
14
+
15
+ ### Deprecated
16
+
17
+ - Deprecated the old `agents_homedir` gem in favor of `agent_homedir`.
18
+
19
+ ## [0.2.0] - 2026-08-25
20
+
21
+ ### Added
22
+
23
+ - Added `bin/prepare_release` to run tests, regenerate documentation, create
24
+ `llm.txt`, and build the release artifact in one fail-fast workflow.
25
+ - Added generated Markdown API documentation and an LLM-oriented entry point.
26
+ - Added regression coverage for documentation generation, release command
27
+ ordering, failure handling, and packaged documentation links.
28
+ - Added the usage demo image to the README.
29
+
30
+ ### Changed
31
+
32
+ - Included `llm.txt` and every linked API document in the packaged gem.
33
+ - Corrected the gem author email metadata.
34
+
35
+ ## [0.1.0] - 2026-08-25
36
+
37
+ ### Added
38
+
39
+ - Initial release with home-directory resolution for supported AI coding
40
+ agents, immutable agent values, environment overrides, and OS-aware defaults.
data/doc/README.md ADDED
@@ -0,0 +1,177 @@
1
+ # Agent::Homedir
2
+
3
+ Find the home folder an AI coding agent uses, without reading contents.
4
+
5
+ <img width="1400" height="850" alt="agent_homedir-demo" src="https://github.com/user-attachments/assets/62fa43bc-5df6-42c0-af2c-1f25ea7070a1" />
6
+
7
+
8
+ ## Installation
9
+
10
+ Use Ruby 3.2 or newer. The gem ships with one runtime dependency: Zeitwerk 2.8.
11
+
12
+ Add this line to your application's **Gemfile**:
13
+
14
+ ```ruby
15
+ gem "agent_homedir"
16
+ ```
17
+
18
+ Then run:
19
+
20
+ ```sh
21
+ bundle install
22
+ ```
23
+
24
+ Or install it directly:
25
+
26
+ ```sh
27
+ gem install agent_homedir
28
+ ```
29
+
30
+ ## Quick Start
31
+
32
+ Get a home path:
33
+
34
+ ```ruby
35
+ require "agent_homedir"
36
+
37
+ Agent::Homedir.home(:claude_code)
38
+ ```
39
+
40
+ Check installation:
41
+
42
+ ```ruby
43
+ require "agent_homedir"
44
+
45
+ Agent::Homedir.installed?(:codex)
46
+ ```
47
+
48
+ Expect a `Pathname` and a boolean.
49
+
50
+ The module facade is snapshotted on first access.
51
+ That snapshots `ENV` and `HOME` for the rest of the process.
52
+ If you need a different snapshot, instantiate `Agent::Homedir::Resolver` directly.
53
+
54
+ ## Usage
55
+
56
+ Fetch an agent:
57
+
58
+ ```ruby
59
+ require "agent_homedir"
60
+
61
+ agent = Agent::Homedir[:codex]
62
+
63
+ agent.name
64
+ agent.label
65
+ agent.home
66
+ ```
67
+
68
+ Discover the catalog:
69
+
70
+ ```ruby
71
+ require "agent_homedir"
72
+
73
+ Agent::Homedir.names
74
+ Agent::Homedir.agents
75
+ Agent::Homedir.installed
76
+ ```
77
+
78
+ Expect ordered, frozen arrays.
79
+
80
+ ### Supported agents
81
+
82
+ Use these names with every lookup method:
83
+
84
+ | Agent | Name |
85
+ | --- | --- |
86
+ | Claude Code | `:claude_code` |
87
+ | Codex CLI | `:codex` |
88
+ | Gemini CLI | `:gemini` |
89
+ | Antigravity CLI | `:antigravity_cli` |
90
+ | Antigravity IDE | `:antigravity_ide` |
91
+ | Antigravity App | `:antigravity_app` |
92
+ | Qwen Code | `:qwen` |
93
+ | Pi | `:pi` |
94
+ | Amp | `:amp` |
95
+ | OpenCode | `:opencode` |
96
+ | Cursor | `:cursor` |
97
+ | Cursor IDE | `:cursor_ide` |
98
+ | GitHub Copilot CLI | `:github_copilot_cli` |
99
+ | VS Code Copilot Chat | `:vscode_copilot_chat` |
100
+ | Cline | `:cline` |
101
+ | Cline for VS Code | `:cline_vscode` |
102
+ | Grok Build | `:grok_build` |
103
+ | Vibe | `:vibe` |
104
+ | Muse Code | `:muse` |
105
+ | Prime Agent | `:prime_agent` |
106
+ | DeepSeek Harness | `:deepseek_harness` |
107
+ | Hermes Agent | `:hermes` |
108
+ | Factory Droid | `:factory_droid` |
109
+ | Devin CLI | `:devin_cli` |
110
+ | Devin Desktop | `:devin_desktop` |
111
+
112
+ Inspect agent facts:
113
+
114
+ ```ruby
115
+ require "agent_homedir"
116
+
117
+ agent = Agent::Homedir[:claude_code]
118
+
119
+ agent.env_override
120
+ agent.verified_on
121
+ agent.candidates
122
+ ```
123
+
124
+ Resolution order:
125
+
126
+ - Use a nonblank native override.
127
+ - Use the first existing directory candidate.
128
+ - Use the first candidate otherwise.
129
+
130
+ Agent facts:
131
+
132
+ - `name` is a `Symbol`.
133
+ - `label` is a `String`.
134
+ - `home` returns a `Pathname`.
135
+ - `installed?` returns a boolean.
136
+ - `candidates` returns an ordered, frozen array of `Pathname` objects.
137
+ - `env_override` is a `String` or `nil`.
138
+ - `verified_on` is a `Date` or `nil`.
139
+
140
+ Errors:
141
+
142
+ - Catch `Agent::Homedir::UnknownAgent` to list valid names.
143
+ - Catch `Agent::Homedir::HomeNotResolvable` for missing, blank, or nonabsolute `HOME`.
144
+
145
+ ## Testing
146
+
147
+ Pass `env`, `home`, and `os` explicitly.
148
+ Instantiate a fresh resolver when you need a different environment snapshot.
149
+ Do not stub global `ENV`.
150
+
151
+ ```ruby
152
+ require "agent_homedir"
153
+
154
+ resolver = Agent::Homedir::Resolver.new(
155
+ env: { "CODEX_HOME" => "custom/codex" },
156
+ home: "/Users/me",
157
+ os: :linux
158
+ )
159
+
160
+ resolver.home(:codex)
161
+ # => #<Pathname:/Users/me/custom/codex>
162
+ ```
163
+
164
+ ## Contributing
165
+
166
+ Activate Ruby 3.2 or newer.
167
+
168
+ Run the tests before sending a change.
169
+
170
+ ```sh
171
+ bundle install
172
+ bundle exec rake test
173
+ ```
174
+
175
+ ## License
176
+
177
+ MIT
data/doc/index.csv ADDED
@@ -0,0 +1,36 @@
1
+ name,type,path
2
+ README.md,File,README.md
3
+ CHANGELOG.md,File,CHANGELOG.md
4
+ Agent,Module,Agent.md
5
+ Agent::Homedir,Module,Agent/Homedir.md
6
+ Agent::Homedir.DEFAULT_RESOLVER_MONITOR,Constant,Agent/Homedir.md#constant-DEFAULT_RESOLVER_MONITOR
7
+ Agent::Homedir.VERSION,Constant,Agent/Homedir.md#constant-VERSION
8
+ Agent::Homedir.[],Method,Agent/Homedir.md#method-c--5B-5D
9
+ Agent::Homedir.agents,Method,Agent/Homedir.md#method-c-agents
10
+ Agent::Homedir.default_resolver,Method,Agent/Homedir.md#method-c-default_resolver
11
+ Agent::Homedir.home,Method,Agent/Homedir.md#method-c-home
12
+ Agent::Homedir.installed,Method,Agent/Homedir.md#method-c-installed
13
+ Agent::Homedir.installed?,Method,Agent/Homedir.md#method-c-installed-3F
14
+ Agent::Homedir.names,Method,Agent/Homedir.md#method-c-names
15
+ Agent::Homedir::Entry,Class,Agent/Homedir/Entry.md
16
+ Agent::Homedir::Entry.candidates,Method,Agent/Homedir/Entry.md#method-i-candidates
17
+ Agent::Homedir::Entry.home,Method,Agent/Homedir/Entry.md#method-i-home
18
+ Agent::Homedir::Entry.initialize,Method,Agent/Homedir/Entry.md#method-i-initialize
19
+ Agent::Homedir::Entry.installed?,Method,Agent/Homedir/Entry.md#method-i-installed-3F
20
+ Agent::Homedir::Entry.with,Method,Agent/Homedir/Entry.md#method-i-with
21
+ Agent::Homedir::Error,Class,Agent/Homedir/Error.md
22
+ Agent::Homedir::Resolver,Class,Agent/Homedir/Resolver.md
23
+ Agent::Homedir::Resolver.VALID_OSES,Constant,Agent/Homedir/Resolver.md#constant-VALID_OSES
24
+ Agent::Homedir::Resolver.WINDOWS_DRIVE_PATH,Constant,Agent/Homedir/Resolver.md#constant-WINDOWS_DRIVE_PATH
25
+ Agent::Homedir::Resolver.WINDOWS_UNC_PATH,Constant,Agent/Homedir/Resolver.md#constant-WINDOWS_UNC_PATH
26
+ Agent::Homedir::Resolver.[],Method,Agent/Homedir/Resolver.md#method-i--5B-5D
27
+ Agent::Homedir::Resolver.agents,Method,Agent/Homedir/Resolver.md#method-i-agents
28
+ Agent::Homedir::Resolver.candidates,Method,Agent/Homedir/Resolver.md#method-i-candidates
29
+ Agent::Homedir::Resolver.home,Method,Agent/Homedir/Resolver.md#method-i-home
30
+ Agent::Homedir::Resolver.initialize,Method,Agent/Homedir/Resolver.md#method-i-initialize
31
+ Agent::Homedir::Resolver.installed,Method,Agent/Homedir/Resolver.md#method-i-installed
32
+ Agent::Homedir::Resolver.installed?,Method,Agent/Homedir/Resolver.md#method-i-installed-3F
33
+ Agent::Homedir::Resolver.names,Method,Agent/Homedir/Resolver.md#method-i-names
34
+ Agent::Homedir::Resolver.default_os,Method,Agent/Homedir/Resolver.md#method-c-default_os
35
+ Agent::Homedir::UnknownAgent,Class,Agent/Homedir/UnknownAgent.md
36
+ Agent::Homedir::HomeNotResolvable,Class,Agent/Homedir/HomeNotResolvable.md