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.2.1"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.gem_nameObject

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.



96
97
98
# File 'lib/ratatui_ruby/devtools.rb', line 96

def gem_name
  @gem_name ||= discover_gem_name
end

.gemspec_fileObject

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.



105
106
107
# File 'lib/ratatui_ruby/devtools.rb', line 105

def gemspec_file
  @gemspec_file ||= discover_gemspec
end

.source_gem_dirObject (readonly)

Returns the source gem directory for website tasks.



78
79
80
# File 'lib/ratatui_ruby/devtools.rb', line 78

def source_gem_dir
  @source_gem_dir
end

.version_fileObject

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.



114
115
116
# File 'lib/ratatui_ruby/devtools.rb', line 114

def version_file
  @version_file ||= discover_version_file
end

Class Method Details

.install_gem_tasks!Object Also known as: install!

Loads gem development Rake tasks (test, lint, bump, license, etc.)

Use this in gem/library Rakefiles. These tasks help with version management, testing, linting, and releasing gems.

Example

require "ratatui_ruby/devtools"
RatatuiRuby::Devtools.install_gem_tasks!


53
54
55
# File 'lib/ratatui_ruby/devtools.rb', line 53

def install_gem_tasks!
  load_tasks_from("tasks")
end

.install_website_tasks!(source_gem_dir:) ⇒ Object

Loads website hosting Rake tasks (build, serve, deploy).

Use this in website repository Rakefiles. These tasks help sync docs from a source gem, update HTML metadata, and deploy.

Example

require "ratatui_ruby/devtools"
RatatuiRuby::Devtools.install_website_tasks!(
  source_gem_dir: "~/Developer/ratatui_ruby"
)

Parameters:

  • Path to the source gem directory (e.g., “~/Developer/ratatui_ruby”)



72
73
74
75
# File 'lib/ratatui_ruby/devtools.rb', line 72

def install_website_tasks!(source_gem_dir:)
  @source_gem_dir = File.expand_path(source_gem_dir)
  load_tasks_from("site_tasks")
end

.tasks_pathObject

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.



130
131
132
# File 'lib/ratatui_ruby/devtools.rb', line 130

def tasks_path
  File.expand_path("devtools/tasks", __dir__)
end

.templates_pathObject

Returns the path to the templates directory.

Scaffolding commands copy files from templates. This method provides the absolute path regardless of caller location.



122
123
124
# File 'lib/ratatui_ruby/devtools.rb', line 122

def templates_path
  File.expand_path("devtools/templates", __dir__)
end