Skip to content

Commit

Permalink
Extend Git environment type using WithModules
Browse files Browse the repository at this point in the history
This commit changes the R10K::Environment::Git class's parent from
R10K::Environment::Base to  R10K::Environment::WithModules. The
practical effect of this is that Git environments are now compatible
with environment sources that directly define modules to deploy (in
addition to or instead of modules defined in a Puppetfile).
  • Loading branch information
reidmv committed Sep 27, 2019
1 parent 734ef8b commit c3867e1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/r10k/environment/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# This class implements an environment based on a Git branch.
#
# @since 1.3.0
class R10K::Environment::Git < R10K::Environment::Base
class R10K::Environment::Git < R10K::Environment::WithModules

include R10K::Logging

Expand Down Expand Up @@ -70,15 +70,12 @@ def signature

include R10K::Util::Purgeable

def managed_directories
[@full_path]
end

# Returns an array of the full paths to all the content being managed.
# @note This implements a required method for the Purgeable mixin
# @return [Array<String>]
def desired_contents
desired = [File.join(@full_path, '.git')]
desired += @repo.tracked_paths.map { |entry| File.join(@full_path, entry) }
desired += super
end
end

0 comments on commit c3867e1

Please sign in to comment.