Module: Kettle::Dev::TemplateHelpers
- Defined in:
- sig/kettle/dev.rbs
Overview
Helpers shared by kettle:dev Rake tasks for templating and file ops.
Class Method Summary collapse
-
.apply_common_replacements ⇒ Object
Apply common token replacements used when templating text files.
-
.ask ⇒ Boolean
Simple yes/no prompt.
-
.copy_dir_with_prompt ⇒ void
Copy a directory tree, prompting before creating or overwriting.
-
.copy_file_with_prompt ⇒ Object
Copy a single file with interactive prompts for create/replace.
-
.ensure_clean_git! ⇒ void
Ensure git working tree is clean before making changes in a task.
-
.gem_checkout_root ⇒ String
Root of this gem's checkout (repository root when working from source).
-
.gemspec_metadata ⇒ {
Parse gemspec metadata and derive useful strings When no gemspec is present, gemspec_path may be nil; gh_org/gh_repo may be nil when not derivable.
-
.modified_by_template? ⇒ Boolean
Returns true if the given path was created or replaced by the template task in this run.
-
.project_root ⇒ String
Root of the host project where Rake was invoked.
-
.record_template_result ⇒ void
Record a template action for a destination path.
-
.template_results ⇒ Hash[String, { action: template_action, timestamp: ::Time }]
Access all template results (read-only clone).
-
.write_file ⇒ void
Write file content creating directories as needed.
Class Method Details
.apply_common_replacements ⇒ Object
Apply common token replacements used when templating text files
529 |
# File 'sig/kettle/dev.rbs', line 529 def self.apply_common_replacements: ( |
.ask ⇒ Boolean
Simple yes/no prompt.
499 |
# File 'sig/kettle/dev.rbs', line 499 def self.ask: (String prompt, bool default) -> bool |
.copy_dir_with_prompt ⇒ void
This method returns an undefined value.
Copy a directory tree, prompting before creating or overwriting.
526 |
# File 'sig/kettle/dev.rbs', line 526 def self.copy_dir_with_prompt: (String src_dir, String dest_dir) -> void |
.copy_file_with_prompt ⇒ Object
Copy a single file with interactive prompts for create/replace.
518 |
# File 'sig/kettle/dev.rbs', line 518 def self.copy_file_with_prompt: ( |
.ensure_clean_git! ⇒ void
This method returns an undefined value.
Ensure git working tree is clean before making changes in a task. If not a git repo, this is a no-op.
515 |
# File 'sig/kettle/dev.rbs', line 515 def self.ensure_clean_git!: (root: String, task_label: String) -> void |
.gem_checkout_root ⇒ String
Root of this gem's checkout (repository root when working from source)
496 |
# File 'sig/kettle/dev.rbs', line 496 def self.gem_checkout_root: () -> String |
.gemspec_metadata ⇒ {
Parse gemspec metadata and derive useful strings When no gemspec is present, gemspec_path may be nil; gh_org/gh_repo may be nil when not derivable.
542 |
# File 'sig/kettle/dev.rbs', line 542 def self.gemspec_metadata: (?String root) -> { |
.modified_by_template? ⇒ Boolean
Returns true if the given path was created or replaced by the template task in this run
511 |
# File 'sig/kettle/dev.rbs', line 511 def self.modified_by_template?: (String dest_path) -> bool |
.project_root ⇒ String
Root of the host project where Rake was invoked
493 |
# File 'sig/kettle/dev.rbs', line 493 def self.project_root: () -> String |
.record_template_result ⇒ void
This method returns an undefined value.
Record a template action for a destination path
505 |
# File 'sig/kettle/dev.rbs', line 505 def self.record_template_result: (String dest_path, template_action action) -> void |
.template_results ⇒ Hash[String, { action: template_action, timestamp: ::Time }]
Access all template results (read-only clone)
508 |
# File 'sig/kettle/dev.rbs', line 508 def self.template_results: () -> Hash[String, { action: template_action, timestamp: ::Time }] |
.write_file ⇒ void
This method returns an undefined value.
Write file content creating directories as needed
502 |
# File 'sig/kettle/dev.rbs', line 502 def self.write_file: (String dest_path, String content) -> void |