Class: BetweenMeals::Changeset
- Inherits:
-
Object
- Object
- BetweenMeals::Changeset
- Defined in:
- lib/between_meals/changeset.rb
Overview
Convenience for dealing with changes Represents a list of diffs between two revisions as a series of Cookbook and Role objects
Basically, you always want to use BetweenMeals::Changes through this helper class.
Defined Under Namespace
Classes: ReferenceError
Instance Method Summary collapse
- #cookbooks ⇒ Object
- #databags ⇒ Object
-
#initialize(logger, repo, start_ref, end_ref, locations, track_symlinks = false) ⇒ Changeset
constructor
rubocop:disable Metrics/ParameterLists.
- #roles ⇒ Object
Constructor Details
#initialize(logger, repo, start_ref, end_ref, locations, track_symlinks = false) ⇒ Changeset
rubocop:disable Metrics/ParameterLists
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/between_meals/changeset.rb', line 33 def initialize( logger, repo, start_ref, end_ref, locations, track_symlinks = false ) # rubocop:enable Metrics/ParameterLists @logger = logger @repo = repo @cookbook_dirs = locations[:cookbook_dirs].dup @role_dir = locations[:role_dir] @databag_dir = locations[:databag_dir] @track_symlinks = track_symlinks # Figure out which files changed if refs provided # or return all files (full upload) otherwise if start_ref @files = [] @repo.changes(start_ref, end_ref).each do |file| @files << file end else @files = @repo.files end end |
Instance Method Details
#cookbooks ⇒ Object
55 56 57 58 59 |
# File 'lib/between_meals/changeset.rb', line 55 def cookbooks BetweenMeals::Changes::Cookbook.find( @files, @cookbook_dirs, @logger, @repo, @track_symlinks ) end |
#databags ⇒ Object
65 66 67 |
# File 'lib/between_meals/changeset.rb', line 65 def databags BetweenMeals::Changes::Databag.find(@files, @databag_dir, @logger) end |
#roles ⇒ Object
61 62 63 |
# File 'lib/between_meals/changeset.rb', line 61 def roles BetweenMeals::Changes::Role.find(@files, @role_dir, @logger) end |