librarian-puppet-maestrodev 0.9.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. data/.gitignore +3 -0
  2. data/LICENSE +20 -0
  3. data/README.md +187 -0
  4. data/bin/librarian-puppet +9 -0
  5. data/lib/librarian/puppet.rb +13 -0
  6. data/lib/librarian/puppet/cli.rb +85 -0
  7. data/lib/librarian/puppet/dsl.rb +16 -0
  8. data/lib/librarian/puppet/environment.rb +54 -0
  9. data/lib/librarian/puppet/extension.rb +41 -0
  10. data/lib/librarian/puppet/lockfile/parser.rb +53 -0
  11. data/lib/librarian/puppet/source.rb +4 -0
  12. data/lib/librarian/puppet/source/forge.rb +279 -0
  13. data/lib/librarian/puppet/source/git.rb +114 -0
  14. data/lib/librarian/puppet/source/githubtarball.rb +234 -0
  15. data/lib/librarian/puppet/source/local.rb +57 -0
  16. data/lib/librarian/puppet/source/path.rb +12 -0
  17. data/lib/librarian/puppet/templates/Puppetfile +10 -0
  18. data/lib/librarian/puppet/version.rb +5 -0
  19. data/vendor/librarian/CHANGELOG.md +185 -0
  20. data/vendor/librarian/Gemfile +6 -0
  21. data/vendor/librarian/MIT-LICENSE +20 -0
  22. data/vendor/librarian/README.md +403 -0
  23. data/vendor/librarian/Rakefile +34 -0
  24. data/vendor/librarian/bin/librarian-chef +7 -0
  25. data/vendor/librarian/bin/librarian-mock +7 -0
  26. data/vendor/librarian/config/cucumber.yaml +1 -0
  27. data/vendor/librarian/features/chef/cli/init.feature +11 -0
  28. data/vendor/librarian/features/chef/cli/install.feature +64 -0
  29. data/vendor/librarian/features/chef/cli/show.feature +77 -0
  30. data/vendor/librarian/features/chef/cli/version.feature +11 -0
  31. data/vendor/librarian/features/support/env.rb +9 -0
  32. data/vendor/librarian/lib/librarian.rb +19 -0
  33. data/vendor/librarian/lib/librarian/action.rb +5 -0
  34. data/vendor/librarian/lib/librarian/action/base.rb +24 -0
  35. data/vendor/librarian/lib/librarian/action/clean.rb +44 -0
  36. data/vendor/librarian/lib/librarian/action/ensure.rb +24 -0
  37. data/vendor/librarian/lib/librarian/action/install.rb +99 -0
  38. data/vendor/librarian/lib/librarian/action/resolve.rb +81 -0
  39. data/vendor/librarian/lib/librarian/action/update.rb +78 -0
  40. data/vendor/librarian/lib/librarian/chef.rb +1 -0
  41. data/vendor/librarian/lib/librarian/chef/cli.rb +48 -0
  42. data/vendor/librarian/lib/librarian/chef/dsl.rb +15 -0
  43. data/vendor/librarian/lib/librarian/chef/environment.rb +27 -0
  44. data/vendor/librarian/lib/librarian/chef/extension.rb +9 -0
  45. data/vendor/librarian/lib/librarian/chef/integration/knife.rb +42 -0
  46. data/vendor/librarian/lib/librarian/chef/manifest_reader.rb +59 -0
  47. data/vendor/librarian/lib/librarian/chef/source.rb +3 -0
  48. data/vendor/librarian/lib/librarian/chef/source/git.rb +25 -0
  49. data/vendor/librarian/lib/librarian/chef/source/local.rb +69 -0
  50. data/vendor/librarian/lib/librarian/chef/source/path.rb +12 -0
  51. data/vendor/librarian/lib/librarian/chef/source/site.rb +446 -0
  52. data/vendor/librarian/lib/librarian/chef/templates/Cheffile +15 -0
  53. data/vendor/librarian/lib/librarian/cli.rb +205 -0
  54. data/vendor/librarian/lib/librarian/cli/manifest_presenter.rb +79 -0
  55. data/vendor/librarian/lib/librarian/config.rb +7 -0
  56. data/vendor/librarian/lib/librarian/config/database.rb +205 -0
  57. data/vendor/librarian/lib/librarian/config/file_source.rb +47 -0
  58. data/vendor/librarian/lib/librarian/config/hash_source.rb +33 -0
  59. data/vendor/librarian/lib/librarian/config/source.rb +149 -0
  60. data/vendor/librarian/lib/librarian/dependency.rb +91 -0
  61. data/vendor/librarian/lib/librarian/dsl.rb +108 -0
  62. data/vendor/librarian/lib/librarian/dsl/receiver.rb +48 -0
  63. data/vendor/librarian/lib/librarian/dsl/target.rb +172 -0
  64. data/vendor/librarian/lib/librarian/environment.rb +134 -0
  65. data/vendor/librarian/lib/librarian/error.rb +4 -0
  66. data/vendor/librarian/lib/librarian/helpers.rb +13 -0
  67. data/vendor/librarian/lib/librarian/lockfile.rb +29 -0
  68. data/vendor/librarian/lib/librarian/lockfile/compiler.rb +66 -0
  69. data/vendor/librarian/lib/librarian/lockfile/parser.rb +100 -0
  70. data/vendor/librarian/lib/librarian/logger.rb +46 -0
  71. data/vendor/librarian/lib/librarian/manifest.rb +132 -0
  72. data/vendor/librarian/lib/librarian/manifest_set.rb +153 -0
  73. data/vendor/librarian/lib/librarian/mock.rb +1 -0
  74. data/vendor/librarian/lib/librarian/mock/cli.rb +19 -0
  75. data/vendor/librarian/lib/librarian/mock/dsl.rb +15 -0
  76. data/vendor/librarian/lib/librarian/mock/environment.rb +24 -0
  77. data/vendor/librarian/lib/librarian/mock/extension.rb +9 -0
  78. data/vendor/librarian/lib/librarian/mock/source.rb +1 -0
  79. data/vendor/librarian/lib/librarian/mock/source/mock.rb +97 -0
  80. data/vendor/librarian/lib/librarian/mock/source/mock/registry.rb +83 -0
  81. data/vendor/librarian/lib/librarian/resolution.rb +44 -0
  82. data/vendor/librarian/lib/librarian/resolver.rb +78 -0
  83. data/vendor/librarian/lib/librarian/resolver/implementation.rb +118 -0
  84. data/vendor/librarian/lib/librarian/source.rb +2 -0
  85. data/vendor/librarian/lib/librarian/source/git.rb +150 -0
  86. data/vendor/librarian/lib/librarian/source/git/repository.rb +217 -0
  87. data/vendor/librarian/lib/librarian/source/local.rb +61 -0
  88. data/vendor/librarian/lib/librarian/source/path.rb +74 -0
  89. data/vendor/librarian/lib/librarian/spec.rb +13 -0
  90. data/vendor/librarian/lib/librarian/spec_change_set.rb +173 -0
  91. data/vendor/librarian/lib/librarian/specfile.rb +18 -0
  92. data/vendor/librarian/lib/librarian/support/abstract_method.rb +21 -0
  93. data/vendor/librarian/lib/librarian/ui.rb +64 -0
  94. data/vendor/librarian/lib/librarian/version.rb +3 -0
  95. data/vendor/librarian/librarian.gemspec +34 -0
  96. data/vendor/librarian/spec/functional/chef/source/git_spec.rb +432 -0
  97. data/vendor/librarian/spec/functional/chef/source/site_spec.rb +215 -0
  98. data/vendor/librarian/spec/functional/source/git/repository_spec.rb +149 -0
  99. data/vendor/librarian/spec/unit/action/base_spec.rb +18 -0
  100. data/vendor/librarian/spec/unit/action/clean_spec.rb +102 -0
  101. data/vendor/librarian/spec/unit/action/ensure_spec.rb +37 -0
  102. data/vendor/librarian/spec/unit/action/install_spec.rb +111 -0
  103. data/vendor/librarian/spec/unit/config/database_spec.rb +319 -0
  104. data/vendor/librarian/spec/unit/dependency_spec.rb +36 -0
  105. data/vendor/librarian/spec/unit/dsl_spec.rb +194 -0
  106. data/vendor/librarian/spec/unit/environment_spec.rb +9 -0
  107. data/vendor/librarian/spec/unit/lockfile/parser_spec.rb +162 -0
  108. data/vendor/librarian/spec/unit/lockfile_spec.rb +65 -0
  109. data/vendor/librarian/spec/unit/manifest_set_spec.rb +202 -0
  110. data/vendor/librarian/spec/unit/manifest_spec.rb +36 -0
  111. data/vendor/librarian/spec/unit/mock/source/mock_spec.rb +22 -0
  112. data/vendor/librarian/spec/unit/resolver_spec.rb +192 -0
  113. data/vendor/librarian/spec/unit/source/git_spec.rb +29 -0
  114. data/vendor/librarian/spec/unit/spec_change_set_spec.rb +169 -0
  115. metadata +227 -0
@@ -0,0 +1,217 @@
1
+ require 'open3'
2
+
3
+ module Librarian
4
+ module Source
5
+ class Git
6
+ class Repository
7
+
8
+ class << self
9
+ def clone!(environment, path, repository_url)
10
+ path = Pathname.new(path)
11
+ path.mkpath
12
+ git = new(environment, path)
13
+ git.clone!(repository_url)
14
+ git
15
+ end
16
+
17
+ def bin
18
+ @bin ||= which("git") or raise Error, "cannot find git"
19
+ end
20
+
21
+ private
22
+
23
+ # Cross-platform way of finding an executable in the $PATH.
24
+ #
25
+ # which('ruby') #=> /usr/bin/ruby
26
+ #
27
+ # From:
28
+ # https://github.com/defunkt/hub/commit/353031307e704d860826fc756ff0070be5e1b430#L2R173
29
+ def which(cmd)
30
+ exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
31
+ ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
32
+ path = File.expand_path(path)
33
+ exts.each do |ext|
34
+ exe = File.join(path, cmd + ext)
35
+ return exe if File.file?(exe) && File.executable?(exe)
36
+ end
37
+ end
38
+ nil
39
+ end
40
+ end
41
+
42
+ attr_accessor :environment, :path
43
+ private :environment=, :path=
44
+
45
+ def initialize(environment, path)
46
+ self.environment = environment
47
+ self.path = Pathname.new(path)
48
+ end
49
+
50
+ def git?
51
+ path.join('.git').exist?
52
+ end
53
+
54
+ def default_remote
55
+ "origin"
56
+ end
57
+
58
+ def version(options = { })
59
+ version!(options).strip
60
+ end
61
+
62
+ def version!(options = { })
63
+ silent = options.delete(:silent)
64
+
65
+ command = %w(--version)
66
+ run!(command, :silent => silent)
67
+ end
68
+
69
+ def clone!(repository_url)
70
+ command = %W(clone #{repository_url} . --quiet)
71
+ run!(command, :chdir => true)
72
+ end
73
+
74
+ def checkout!(reference, options ={ })
75
+ command = %W(checkout #{reference} --quiet)
76
+ command << "--force" if options[:force]
77
+ run!(command, :chdir => true)
78
+ end
79
+
80
+ def fetch!(remote, options = { })
81
+ command = %W(fetch #{remote} --quiet)
82
+ command << "--tags" if options[:tags]
83
+ run!(command, :chdir => true)
84
+ end
85
+
86
+ def reset_hard!
87
+ command = %W(reset --hard --quiet)
88
+ run!(command, :chdir => true)
89
+ end
90
+
91
+ def clean!
92
+ command = %w(clean -x -d --force --force)
93
+ run!(command, :chdir => true)
94
+ end
95
+
96
+ def checked_out?(sha)
97
+ current_commit_hash == sha
98
+ end
99
+
100
+ def remote_names
101
+ command = %W(remote)
102
+ run!(command, :chdir => true).strip.lines.map(&:strip)
103
+ end
104
+
105
+ def remote_branch_names
106
+ remotes = remote_names.sort_by(&:length).reverse
107
+
108
+ command = %W(branch -r)
109
+ names = run!(command, :chdir => true).strip.lines.map(&:strip).to_a
110
+ names.each{|n| n.gsub!(/\s*->.*$/, "")}
111
+ names.reject!{|n| n =~ /\/HEAD$/}
112
+ Hash[remotes.map do |r|
113
+ matching_names = names.select{|n| n.start_with?("#{r}/")}
114
+ matching_names.each{|n| names.delete(n)}
115
+ matching_names.each{|n| n.slice!(0, r.size + 1)}
116
+ [r, matching_names]
117
+ end]
118
+ end
119
+
120
+ def hash_from(remote, reference)
121
+ branch_names = remote_branch_names[remote]
122
+ if branch_names.include?(reference)
123
+ reference = "#{remote}/#{reference}"
124
+ end
125
+
126
+ command = %W(rev-list #{reference} -1)
127
+ run!(command, :chdir => true).strip
128
+ end
129
+
130
+ def current_commit_hash
131
+ command = %W(rev-parse HEAD --quiet)
132
+ run!(command, :chdir => true).strip!
133
+ end
134
+
135
+ private
136
+
137
+ def bin
138
+ self.class.bin
139
+ end
140
+
141
+ def run!(args, options = { })
142
+ chdir = options.delete(:chdir)
143
+ chdir = path.to_s if chdir == true
144
+
145
+ silent = options.delete(:silent)
146
+
147
+ command = [bin]
148
+ command.concat(args)
149
+
150
+ maybe_within(chdir) do
151
+ logging_command(command, :silent => silent) do
152
+ run_command_internal(command)
153
+ end
154
+ end
155
+ end
156
+
157
+ def maybe_within(path)
158
+ if path
159
+ Dir.chdir(path) { with_env_var("GIT_DIR", nil) { yield } }
160
+ else
161
+ yield
162
+ end
163
+ end
164
+
165
+ def with_env_var(name, value)
166
+ original_value = ENV[name]
167
+ begin
168
+ ENV[name] = value
169
+ yield
170
+ ensure
171
+ ENV[name] = original_value
172
+ end
173
+ end
174
+
175
+ def logging_command(command, options)
176
+ silent = options.delete(:silent)
177
+
178
+ pwd = Dir.pwd
179
+
180
+ unless silent
181
+ debug { "Running `#{command.join(' ')}` in #{relative_path_to(pwd)}" }
182
+ end
183
+
184
+ out = yield
185
+
186
+ unless silent
187
+ if out.size > 0
188
+ out.lines.each do |line|
189
+ debug { " --> #{line}" }
190
+ end
191
+ else
192
+ debug { " --- No output" }
193
+ end
194
+ end
195
+
196
+ out
197
+ end
198
+
199
+ def run_command_internal(command)
200
+ Open3.popen3(*command) do |i, o, e, t|
201
+ raise StandardError, e.read unless (t ? t.value : $?).success?
202
+ o.read
203
+ end
204
+ end
205
+
206
+ def debug(*args, &block)
207
+ environment.logger.debug(*args, &block)
208
+ end
209
+
210
+ def relative_path_to(path)
211
+ environment.logger.relative_path_to(path)
212
+ end
213
+
214
+ end
215
+ end
216
+ end
217
+ end
@@ -0,0 +1,61 @@
1
+ require 'librarian/support/abstract_method'
2
+
3
+ module Librarian
4
+ module Source
5
+ # Requires that the including source class have methods:
6
+ # #path
7
+ # #environment
8
+ module Local
9
+
10
+ include Support::AbstractMethod
11
+
12
+ abstract_method :path, :fetch_version, :fetch_dependencies
13
+
14
+ def manifests(name)
15
+ manifest = Manifest.new(self, name)
16
+ [manifest].compact
17
+ end
18
+
19
+ def manifest(name, version, dependencies)
20
+ manifest = Manifest.new(self, name)
21
+ manifest.version = version
22
+ manifest.dependencies = dependencies
23
+ manifest
24
+ end
25
+
26
+ def manifest_search_paths(name)
27
+ @manifest_search_paths ||= { }
28
+ @manifest_search_paths[name] ||= begin
29
+ cache!
30
+ paths = [filesystem_path, filesystem_path.join(name)]
31
+ paths.select{|s| s.exist?}
32
+ end
33
+ end
34
+
35
+ def found_path(name)
36
+ @_found_paths ||= { }
37
+ @_found_paths[name] ||= begin
38
+ paths = manifest_search_paths(name)
39
+ paths.find{|p| manifest?(name, p)}
40
+ end
41
+ end
42
+
43
+ private
44
+
45
+ abstract_method :manifest? # (name, path) -> boolean
46
+
47
+ def info(*args, &block)
48
+ environment.logger.info(*args, &block)
49
+ end
50
+
51
+ def debug(*args, &block)
52
+ environment.logger.debug(*args, &block)
53
+ end
54
+
55
+ def relative_path_to(path)
56
+ environment.logger.relative_path_to(path)
57
+ end
58
+
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,74 @@
1
+ require 'librarian/source/local'
2
+
3
+ module Librarian
4
+ module Source
5
+ class Path
6
+
7
+ include Local
8
+
9
+ class << self
10
+
11
+ LOCK_NAME = 'PATH'
12
+
13
+ def lock_name
14
+ LOCK_NAME
15
+ end
16
+
17
+ def from_lock_options(environment, options)
18
+ new(environment, options[:remote], options.reject{|k, v| k == :remote})
19
+ end
20
+
21
+ def from_spec_args(environment, path, options)
22
+ recognized_options = []
23
+ unrecognized_options = options.keys - recognized_options
24
+ unrecognized_options.empty? or raise Error, "unrecognized options: #{unrecognized_options.join(", ")}"
25
+
26
+ new(environment, path, options)
27
+ end
28
+
29
+ end
30
+
31
+ attr_accessor :environment
32
+ private :environment=
33
+ attr_reader :path
34
+
35
+ def initialize(environment, path, options)
36
+ self.environment = environment
37
+ @path = path
38
+ end
39
+
40
+ def to_s
41
+ path.to_s
42
+ end
43
+
44
+ def ==(other)
45
+ other &&
46
+ self.class == other.class &&
47
+ self.path == other.path
48
+ end
49
+
50
+ def to_spec_args
51
+ [path.to_s, {}]
52
+ end
53
+
54
+ def to_lock_options
55
+ {:remote => path}
56
+ end
57
+
58
+ def pinned?
59
+ false
60
+ end
61
+
62
+ def unpin!
63
+ end
64
+
65
+ def cache!
66
+ end
67
+
68
+ def filesystem_path
69
+ @filesystem_path ||= Pathname.new(path).expand_path(environment.project_path)
70
+ end
71
+
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,13 @@
1
+ module Librarian
2
+ class Spec
3
+
4
+ attr_accessor :source, :dependencies
5
+ private :source=, :dependencies=
6
+
7
+ def initialize(source, dependencies)
8
+ self.source = source
9
+ self.dependencies = dependencies
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,173 @@
1
+ require 'librarian/helpers'
2
+
3
+ require 'librarian/manifest_set'
4
+ require 'librarian/resolution'
5
+ require 'librarian/spec'
6
+
7
+ module Librarian
8
+ class SpecChangeSet
9
+
10
+ attr_accessor :environment
11
+ private :environment=
12
+ attr_reader :spec, :lock
13
+
14
+ def initialize(environment, spec, lock)
15
+ self.environment = environment
16
+ raise TypeError, "can't convert #{spec.class} into #{Spec}" unless Spec === spec
17
+ raise TypeError, "can't convert #{lock.class} into #{Resolution}" unless Resolution === lock
18
+ @spec, @lock = spec, lock
19
+ end
20
+
21
+ def same?
22
+ @same ||= spec.dependencies.sort_by{|d| d.name} == lock.dependencies.sort_by{|d| d.name}
23
+ end
24
+
25
+ def changed?
26
+ !same?
27
+ end
28
+
29
+ def spec_dependencies
30
+ @spec_dependencies ||= spec.dependencies
31
+ end
32
+ def spec_dependency_names
33
+ @spec_dependency_names ||= Set.new(spec_dependencies.map{|d| d.name})
34
+ end
35
+ def spec_dependency_index
36
+ @spec_dependency_index ||= Hash[spec_dependencies.map{|d| [d.name, d]}]
37
+ end
38
+
39
+ def lock_dependencies
40
+ @lock_dependencies ||= lock.dependencies
41
+ end
42
+ def lock_dependency_names
43
+ @lock_dependency_names ||= Set.new(lock_dependencies.map{|d| d.name})
44
+ end
45
+ def lock_dependency_index
46
+ @lock_dependency_index ||= Hash[lock_dependencies.map{|d| [d.name, d]}]
47
+ end
48
+
49
+ def lock_manifests
50
+ @lock_manifests ||= lock.manifests
51
+ end
52
+ def lock_manifests_index
53
+ @lock_manifests_index ||= ManifestSet.new(lock_manifests).to_hash
54
+ end
55
+
56
+ def removed_dependency_names
57
+ @removed_dependency_names ||= lock_dependency_names - spec_dependency_names
58
+ end
59
+
60
+ # A dependency which is deleted from the specfile will, in the general case,
61
+ # be removed conservatively. This means it might not actually be removed.
62
+ # But if the dependency originally declared a source which is now non-
63
+ # default, it must be removed, even if another dependency has a transitive
64
+ # dependency on the one that was removed (which is the scenario in which
65
+ # a conservative removal would not remove it). In this case, we must also
66
+ # remove it explicitly so that it can be re-resolved from the default
67
+ # source.
68
+ def explicit_removed_dependency_names
69
+ @explicit_removed_dependency_names ||= removed_dependency_names.reject do |name|
70
+ lock_manifest = lock_manifests_index[name]
71
+ lock_manifest.source == spec.source
72
+ end.to_set
73
+ end
74
+
75
+ def added_dependency_names
76
+ @added_dependency_names ||= spec_dependency_names - lock_dependency_names
77
+ end
78
+
79
+ def nonmatching_added_dependency_names
80
+ @nonmatching_added_dependency_names ||= added_dependency_names.reject do |name|
81
+ spec_dependency = spec_dependency_index[name]
82
+ lock_manifest = lock_manifests_index[name]
83
+ if lock_manifest
84
+ matching = true
85
+ matching &&= spec_dependency.satisfied_by?(lock_manifest)
86
+ matching &&= spec_dependency.source == lock_manifest.source
87
+ matching
88
+ else
89
+ false
90
+ end
91
+ end.to_set
92
+ end
93
+
94
+ def common_dependency_names
95
+ @common_dependency_names ||= lock_dependency_names & spec_dependency_names
96
+ end
97
+
98
+ def changed_dependency_names
99
+ @changed_dependency_names ||= common_dependency_names.reject do |name|
100
+ spec_dependency = spec_dependency_index[name]
101
+ lock_dependency = lock_dependency_index[name]
102
+ lock_manifest = lock_manifests_index[name]
103
+ same = true
104
+ same &&= spec_dependency.satisfied_by?(lock_manifest)
105
+ same &&= spec_dependency.source == lock_dependency.source
106
+ same
107
+ end.to_set
108
+ end
109
+
110
+ def deep_keep_manifest_names
111
+ @deep_keep_manifest_names ||= begin
112
+ lock_dependency_names - (
113
+ removed_dependency_names +
114
+ changed_dependency_names +
115
+ nonmatching_added_dependency_names
116
+ )
117
+ end
118
+ end
119
+
120
+ def shallow_strip_manifest_names
121
+ @shallow_strip_manifest_names ||= begin
122
+ explicit_removed_dependency_names + changed_dependency_names
123
+ end
124
+ end
125
+
126
+ def inspect
127
+ Helpers.strip_heredoc(<<-INSPECT)
128
+ <##{self.class.name}:
129
+ Removed: #{removed_dependency_names.to_a.join(", ")}
130
+ ExplicitRemoved: #{explicit_removed_dependency_names.to_a.join(", ")}
131
+ Added: #{added_dependency_names.to_a.join(", ")}
132
+ NonMatchingAdded: #{nonmatching_added_dependency_names.to_a.join(", ")}
133
+ Changed: #{changed_dependency_names.to_a.join(", ")}
134
+ DeepKeep: #{deep_keep_manifest_names.to_a.join(", ")}
135
+ ShallowStrip: #{shallow_strip_manifest_names.to_a.join(", ")}
136
+ >
137
+ INSPECT
138
+ end
139
+
140
+ # Returns an array of those manifests from the previous spec which should be kept,
141
+ # based on inspecting the new spec against the locked resolution from the previous spec.
142
+ def analyze
143
+ @analyze ||= begin
144
+ debug { "Analyzing spec and lock:" }
145
+
146
+ if same?
147
+ debug { " Same!" }
148
+ return lock.manifests
149
+ end
150
+
151
+ debug { " Removed:" } ; removed_dependency_names.each { |name| debug { " #{name}" } }
152
+ debug { " ExplicitRemoved:" } ; explicit_removed_dependency_names.each { |name| debug { " #{name}" } }
153
+ debug { " Added:" } ; added_dependency_names.each { |name| debug { " #{name}" } }
154
+ debug { " NonMatchingAdded:" } ; nonmatching_added_dependency_names.each { |name| debug { " #{name}" } }
155
+ debug { " Changed:" } ; changed_dependency_names.each { |name| debug { " #{name}" } }
156
+ debug { " DeepKeep:" } ; deep_keep_manifest_names.each { |name| debug { " #{name}" } }
157
+ debug { " ShallowStrip:" } ; shallow_strip_manifest_names.each { |name| debug { " #{name}" } }
158
+
159
+ manifests = ManifestSet.new(lock_manifests)
160
+ manifests.deep_keep!(deep_keep_manifest_names)
161
+ manifests.shallow_strip!(shallow_strip_manifest_names)
162
+ manifests.to_a
163
+ end
164
+ end
165
+
166
+ private
167
+
168
+ def debug(*args, &block)
169
+ environment.logger.debug(*args, &block)
170
+ end
171
+
172
+ end
173
+ end