Module: RatatuiRuby::Devtools
- Defined in:
- lib/ratatui_ruby/devtools.rb,
lib/ratatui_ruby/devtools/version.rb
Overview
Development tooling for the RatatuiRuby ecosystem.
This gem provides shared Rake tasks, linter configurations, and build tooling used across all RatatuiRuby ecosystem gems.
Usage
In your Rakefile:
require "ratatui_ruby/devtools"
RatatuiRuby::Devtools.install!
# Optional: import project-specific tasks
Dir.glob("tasks/*.rake").each { |r| import r }
task default: %w[lint:fix test lint]
Defined Under Namespace
Classes: Error
Constant Summary collapse
- VERSION =
Current version of the ratatui_ruby-devtools gem.
"0.1.0"
Class Attribute Summary collapse
-
.gem_name ⇒ Object
Returns the gem name, auto-discovered from gemspec if not set.
-
.gemspec_file ⇒ Object
Returns the path to the gemspec file.
-
.version_file ⇒ Object
Returns the path to the version.rb file.
Class Method Summary collapse
-
.install! ⇒ Object
Loads all devtools Rake tasks into the current application.
-
.tasks_path ⇒ Object
Returns the path to the tasks directory.
-
.templates_path ⇒ Object
Returns the path to the templates directory.
Class Attribute Details
.gem_name ⇒ Object
Returns the gem name, auto-discovered from gemspec if not set.
Tasks need to know which gem they’re operating on. Auto-discovery from gemspec files means zero configuration for standard layouts. Override via gem_name= if needed.
67 68 69 |
# File 'lib/ratatui_ruby/devtools.rb', line 67 def gem_name @gem_name ||= discover_gem_name end |
.gemspec_file ⇒ Object
Returns the path to the gemspec file.
Tasks parse the gemspec for metadata. Auto-discovery finds the single .gemspec file in the project root. Override via gemspec_file= for non-standard layouts.
76 77 78 |
# File 'lib/ratatui_ruby/devtools.rb', line 76 def gemspec_file @gemspec_file ||= discover_gemspec end |
.version_file ⇒ Object
Returns the path to the version.rb file.
Version bumping needs the version file location. Auto-discovery finds it in the standard lib/*/ path. Override via version_file= for non-standard layouts.
85 86 87 |
# File 'lib/ratatui_ruby/devtools.rb', line 85 def version_file @version_file ||= discover_version_file end |
Class Method Details
.install! ⇒ Object
Loads all devtools Rake tasks into the current application.
Consumer gems need shared tasks for linting, testing, and licensing. Manually copying rake files is tedious and leads to drift. Call this once in your Rakefile to import all devtools tasks.
Example
require "ratatui_ruby/devtools"
RatatuiRuby::Devtools.install!
54 55 56 57 58 59 60 |
# File 'lib/ratatui_ruby/devtools.rb', line 54 def install! tasks_dir = File.("devtools/tasks", __dir__) Dir.glob("#{tasks_dir}/*.rake").each do |task_file| Rake.application.add_import(task_file) end Rake.application.load_imports end |
.tasks_path ⇒ Object
Returns the path to the tasks directory.
Debug and introspection tools may need to list available tasks. This method provides the absolute path regardless of caller location.
101 102 103 |
# File 'lib/ratatui_ruby/devtools.rb', line 101 def tasks_path File.("devtools/tasks", __dir__) end |
.templates_path ⇒ Object
Returns the path to the templates directory.
Scaffolding commands copy files from templates. This method provides the absolute path regardless of caller location.
93 94 95 |
# File 'lib/ratatui_ruby/devtools.rb', line 93 def templates_path File.("devtools/templates", __dir__) end |