Class: Senren::Rails::HostPaths
- Inherits:
-
Object
- Object
- Senren::Rails::HostPaths
- Defined in:
- lib/senren/rails/host_paths.rb
Overview
Resolves canonical paths inside a host Rails application. Accepts an explicit root for tests; defaults to Rails.root when present.
Instance Attribute Summary collapse
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
- #base_component_path ⇒ Object
- #components_dir ⇒ Object
- #conventions_file ⇒ Object
- #ensure_dirs! ⇒ Object
-
#initialize(root = nil) ⇒ HostPaths
constructor
A new instance of HostPaths.
- #installed_components ⇒ Object
- #llms_full ⇒ Object
- #llms_short ⇒ Object
- #registry_mirror ⇒ Object
- #senren_dir ⇒ Object
- #skill_file ⇒ Object
- #stimulus_dir ⇒ Object
- #stylesheet_path ⇒ Object
Constructor Details
Instance Attribute Details
#root ⇒ Object (readonly)
Returns the value of attribute root.
8 9 10 |
# File 'lib/senren/rails/host_paths.rb', line 8 def root @root end |
Instance Method Details
#base_component_path ⇒ Object
21 |
# File 'lib/senren/rails/host_paths.rb', line 21 def base_component_path = components_dir.join('base_component.rb') |
#components_dir ⇒ Object
20 |
# File 'lib/senren/rails/host_paths.rb', line 20 def components_dir = root.join('app', 'components', 'senren') |
#conventions_file ⇒ Object
18 |
# File 'lib/senren/rails/host_paths.rb', line 18 def conventions_file = senren_dir.join('conventions.md') |
#ensure_dirs! ⇒ Object
30 31 32 33 |
# File 'lib/senren/rails/host_paths.rb', line 30 def ensure_dirs! [senren_dir, components_dir, stimulus_dir, stylesheet_path.dirname, llms_short.dirname].each(&:mkpath) end |
#installed_components ⇒ Object
17 |
# File 'lib/senren/rails/host_paths.rb', line 17 def installed_components = senren_dir.join('installed_components.yml') |
#llms_full ⇒ Object
28 |
# File 'lib/senren/rails/host_paths.rb', line 28 def llms_full = root.join('public', 'llms-full.txt') |
#llms_short ⇒ Object
27 |
# File 'lib/senren/rails/host_paths.rb', line 27 def llms_short = root.join('public', 'llms.txt') |
#registry_mirror ⇒ Object
16 |
# File 'lib/senren/rails/host_paths.rb', line 16 def registry_mirror = senren_dir.join('registry.yml') |
#senren_dir ⇒ Object
14 |
# File 'lib/senren/rails/host_paths.rb', line 14 def senren_dir = root.join('.senren') |
#skill_file ⇒ Object
15 |
# File 'lib/senren/rails/host_paths.rb', line 15 def skill_file = senren_dir.join('skill.md') |
#stimulus_dir ⇒ Object
25 |
# File 'lib/senren/rails/host_paths.rb', line 25 def stimulus_dir = root.join('app', 'javascript', 'controllers', 'senren') |
#stylesheet_path ⇒ Object
23 |
# File 'lib/senren/rails/host_paths.rb', line 23 def stylesheet_path = root.join('app', 'assets', 'stylesheets', 'senren.css') |