Class: SashimiTanpopo::Provider::Base
- Inherits:
-
Object
- Object
- SashimiTanpopo::Provider::Base
- Defined in:
- lib/sashimi_tanpopo/provider/base.rb
Instance Method Summary collapse
-
#apply_recipe_files ⇒ Hash<String, { before_content: String, after_content: String, mode: String }>
Apply recipe files.
-
#initialize(recipe_paths:, target_dir:, params:, dry_run:, is_colored:, is_update_local:) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(recipe_paths:, target_dir:, params:, dry_run:, is_colored:, is_update_local:) ⇒ Base
Returns a new instance of Base.
12 13 14 15 16 17 18 19 |
# File 'lib/sashimi_tanpopo/provider/base.rb', line 12 def initialize(recipe_paths:, target_dir:, params:, dry_run:, is_colored:, is_update_local:) @recipe_paths = recipe_paths @target_dir = target_dir || Dir.pwd @params = params @dry_run = dry_run @is_colored = is_colored @is_update_local = is_update_local end |
Instance Method Details
#apply_recipe_files ⇒ Hash<String, { before_content: String, after_content: String, mode: String }>
Apply recipe files
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/sashimi_tanpopo/provider/base.rb', line 33 def apply_recipe_files all_changed_files = {} # : changed_files @recipe_paths.each do |recipe_path| changed_files = DSL.new.perform( recipe_path: recipe_path, target_dir: @target_dir, params: @params, dry_run: @dry_run, is_colored: @is_colored, is_update_local: @is_update_local, ) all_changed_files.merge!(changed_files) end all_changed_files end |