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:) ⇒ 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:) ⇒ 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:) ⇒ Hash<String, { before_content: String, after_content: String, mode: String }>
Apply recipe file for unit test
56 57 58 59 60 |
# File 'lib/sashimi_tanpopo/dsl.rb', line 56 def evaluate(recipe_body:, recipe_path:, target_dir:, params:, dry_run:, is_colored:, is_update_local:) context = EvalContext.new(params: params, dry_run: dry_run, is_colored: is_colored, target_dir: target_dir, is_update_local: is_update_local) 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:) ⇒ Hash<String, { before_content: String, after_content: String, mode: String }>
Apply recipe file
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/sashimi_tanpopo/dsl.rb', line 24 def perform(recipe_path:, target_dir:, params:, dry_run:, is_colored:, is_update_local:) 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, ) end |