Class: SashimiTanpopo::DSL
- Inherits:
-
Object
- Object
- SashimiTanpopo::DSL
- Defined in:
- lib/sashimi_tanpopo/dsl.rb
Defined Under Namespace
Classes: EvalContext
Instance Method Summary collapse
-
#evaluate(recipe_body:, recipe_path:, target_dir:, params:, dry_run:, is_colored:, is_update_local:, changed_files:) ⇒ Hash<String, { before_content: String, after_content: String, mode: String }>
Apply recipe file for unit test.
-
#perform(recipe_path:, target_dir:, params:, dry_run:, is_colored:, is_update_local:, changed_files: {}) ⇒ Hash<String, { before_content: String, after_content: String, mode: String }>
Apply recipe file.
Instance Method Details
#evaluate(recipe_body:, recipe_path:, target_dir:, params:, dry_run:, is_colored:, is_update_local:, changed_files:) ⇒ Hash<String, { before_content: String, after_content: String, mode: String }>
Apply recipe file for unit test
59 60 61 62 63 |
# File 'lib/sashimi_tanpopo/dsl.rb', line 59 def evaluate(recipe_body:, recipe_path:, target_dir:, params:, dry_run:, is_colored:, is_update_local:, changed_files:) context = EvalContext.new(params: params, dry_run: dry_run, is_colored: is_colored, target_dir: target_dir, is_update_local: is_update_local, changed_files: changed_files) InstanceEval.new(recipe_body: recipe_body, recipe_path: recipe_path, target_dir: target_dir, context: context).call context.changed_files end |
#perform(recipe_path:, target_dir:, params:, dry_run:, is_colored:, is_update_local:, changed_files: {}) ⇒ Hash<String, { before_content: String, after_content: String, mode: String }>
Apply recipe file
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/sashimi_tanpopo/dsl.rb', line 25 def perform(recipe_path:, target_dir:, params:, dry_run:, is_colored:, is_update_local:, changed_files: {}) evaluate( recipe_body: File.read(recipe_path), recipe_path: recipe_path, target_dir: target_dir, params: params, dry_run: dry_run, is_colored: is_colored, is_update_local: is_update_local, changed_files: changed_files, ) end |