librarian-puppet-maestrodev 0.9.7.5 → 0.9.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. data/README.md +3 -3
  2. data/bin/librarian-puppet +0 -2
  3. data/lib/librarian/puppet.rb +10 -1
  4. data/lib/librarian/puppet/extension.rb +68 -11
  5. data/lib/librarian/puppet/requirement.rb +39 -0
  6. data/lib/librarian/puppet/source.rb +1 -0
  7. data/lib/librarian/puppet/source/forge.rb +8 -1
  8. data/lib/librarian/puppet/source/git.rb +2 -0
  9. data/lib/librarian/puppet/source/githubtarball.rb +16 -1
  10. data/lib/librarian/puppet/version.rb +1 -1
  11. metadata +33 -112
  12. data/vendor/librarian/CHANGELOG.md +0 -185
  13. data/vendor/librarian/Gemfile +0 -6
  14. data/vendor/librarian/MIT-LICENSE +0 -20
  15. data/vendor/librarian/README.md +0 -403
  16. data/vendor/librarian/Rakefile +0 -34
  17. data/vendor/librarian/bin/librarian-chef +0 -7
  18. data/vendor/librarian/bin/librarian-mock +0 -7
  19. data/vendor/librarian/config/cucumber.yaml +0 -1
  20. data/vendor/librarian/features/chef/cli/init.feature +0 -11
  21. data/vendor/librarian/features/chef/cli/install.feature +0 -64
  22. data/vendor/librarian/features/chef/cli/show.feature +0 -77
  23. data/vendor/librarian/features/chef/cli/version.feature +0 -11
  24. data/vendor/librarian/features/support/env.rb +0 -9
  25. data/vendor/librarian/lib/librarian.rb +0 -19
  26. data/vendor/librarian/lib/librarian/action.rb +0 -5
  27. data/vendor/librarian/lib/librarian/action/base.rb +0 -24
  28. data/vendor/librarian/lib/librarian/action/clean.rb +0 -44
  29. data/vendor/librarian/lib/librarian/action/ensure.rb +0 -24
  30. data/vendor/librarian/lib/librarian/action/install.rb +0 -99
  31. data/vendor/librarian/lib/librarian/action/resolve.rb +0 -81
  32. data/vendor/librarian/lib/librarian/action/update.rb +0 -78
  33. data/vendor/librarian/lib/librarian/chef.rb +0 -1
  34. data/vendor/librarian/lib/librarian/chef/cli.rb +0 -48
  35. data/vendor/librarian/lib/librarian/chef/dsl.rb +0 -15
  36. data/vendor/librarian/lib/librarian/chef/environment.rb +0 -27
  37. data/vendor/librarian/lib/librarian/chef/extension.rb +0 -9
  38. data/vendor/librarian/lib/librarian/chef/integration/knife.rb +0 -42
  39. data/vendor/librarian/lib/librarian/chef/manifest_reader.rb +0 -59
  40. data/vendor/librarian/lib/librarian/chef/source.rb +0 -3
  41. data/vendor/librarian/lib/librarian/chef/source/git.rb +0 -25
  42. data/vendor/librarian/lib/librarian/chef/source/local.rb +0 -69
  43. data/vendor/librarian/lib/librarian/chef/source/path.rb +0 -12
  44. data/vendor/librarian/lib/librarian/chef/source/site.rb +0 -446
  45. data/vendor/librarian/lib/librarian/chef/templates/Cheffile +0 -15
  46. data/vendor/librarian/lib/librarian/cli.rb +0 -205
  47. data/vendor/librarian/lib/librarian/cli/manifest_presenter.rb +0 -79
  48. data/vendor/librarian/lib/librarian/config.rb +0 -7
  49. data/vendor/librarian/lib/librarian/config/database.rb +0 -205
  50. data/vendor/librarian/lib/librarian/config/file_source.rb +0 -47
  51. data/vendor/librarian/lib/librarian/config/hash_source.rb +0 -33
  52. data/vendor/librarian/lib/librarian/config/source.rb +0 -149
  53. data/vendor/librarian/lib/librarian/dependency.rb +0 -91
  54. data/vendor/librarian/lib/librarian/dsl.rb +0 -108
  55. data/vendor/librarian/lib/librarian/dsl/receiver.rb +0 -48
  56. data/vendor/librarian/lib/librarian/dsl/target.rb +0 -172
  57. data/vendor/librarian/lib/librarian/environment.rb +0 -134
  58. data/vendor/librarian/lib/librarian/error.rb +0 -4
  59. data/vendor/librarian/lib/librarian/helpers.rb +0 -13
  60. data/vendor/librarian/lib/librarian/lockfile.rb +0 -29
  61. data/vendor/librarian/lib/librarian/lockfile/compiler.rb +0 -66
  62. data/vendor/librarian/lib/librarian/lockfile/parser.rb +0 -100
  63. data/vendor/librarian/lib/librarian/logger.rb +0 -46
  64. data/vendor/librarian/lib/librarian/manifest.rb +0 -132
  65. data/vendor/librarian/lib/librarian/manifest_set.rb +0 -154
  66. data/vendor/librarian/lib/librarian/mock.rb +0 -1
  67. data/vendor/librarian/lib/librarian/mock/cli.rb +0 -19
  68. data/vendor/librarian/lib/librarian/mock/dsl.rb +0 -15
  69. data/vendor/librarian/lib/librarian/mock/environment.rb +0 -24
  70. data/vendor/librarian/lib/librarian/mock/extension.rb +0 -9
  71. data/vendor/librarian/lib/librarian/mock/source.rb +0 -1
  72. data/vendor/librarian/lib/librarian/mock/source/mock.rb +0 -97
  73. data/vendor/librarian/lib/librarian/mock/source/mock/registry.rb +0 -83
  74. data/vendor/librarian/lib/librarian/resolution.rb +0 -44
  75. data/vendor/librarian/lib/librarian/resolver.rb +0 -78
  76. data/vendor/librarian/lib/librarian/resolver/implementation.rb +0 -118
  77. data/vendor/librarian/lib/librarian/source.rb +0 -2
  78. data/vendor/librarian/lib/librarian/source/git.rb +0 -150
  79. data/vendor/librarian/lib/librarian/source/git/repository.rb +0 -217
  80. data/vendor/librarian/lib/librarian/source/local.rb +0 -61
  81. data/vendor/librarian/lib/librarian/source/path.rb +0 -74
  82. data/vendor/librarian/lib/librarian/spec.rb +0 -13
  83. data/vendor/librarian/lib/librarian/spec_change_set.rb +0 -173
  84. data/vendor/librarian/lib/librarian/specfile.rb +0 -18
  85. data/vendor/librarian/lib/librarian/support/abstract_method.rb +0 -21
  86. data/vendor/librarian/lib/librarian/ui.rb +0 -64
  87. data/vendor/librarian/lib/librarian/version.rb +0 -3
  88. data/vendor/librarian/librarian.gemspec +0 -34
  89. data/vendor/librarian/spec/functional/chef/source/git_spec.rb +0 -432
  90. data/vendor/librarian/spec/functional/chef/source/site_spec.rb +0 -215
  91. data/vendor/librarian/spec/functional/source/git/repository_spec.rb +0 -149
  92. data/vendor/librarian/spec/unit/action/base_spec.rb +0 -18
  93. data/vendor/librarian/spec/unit/action/clean_spec.rb +0 -102
  94. data/vendor/librarian/spec/unit/action/ensure_spec.rb +0 -37
  95. data/vendor/librarian/spec/unit/action/install_spec.rb +0 -111
  96. data/vendor/librarian/spec/unit/config/database_spec.rb +0 -319
  97. data/vendor/librarian/spec/unit/dependency_spec.rb +0 -36
  98. data/vendor/librarian/spec/unit/dsl_spec.rb +0 -194
  99. data/vendor/librarian/spec/unit/environment_spec.rb +0 -9
  100. data/vendor/librarian/spec/unit/lockfile/parser_spec.rb +0 -162
  101. data/vendor/librarian/spec/unit/lockfile_spec.rb +0 -65
  102. data/vendor/librarian/spec/unit/manifest_set_spec.rb +0 -202
  103. data/vendor/librarian/spec/unit/manifest_spec.rb +0 -36
  104. data/vendor/librarian/spec/unit/mock/source/mock_spec.rb +0 -22
  105. data/vendor/librarian/spec/unit/resolver_spec.rb +0 -192
  106. data/vendor/librarian/spec/unit/source/git_spec.rb +0 -29
  107. data/vendor/librarian/spec/unit/spec_change_set_spec.rb +0 -169
@@ -1,81 +0,0 @@
1
- require "librarian/error"
2
- require "librarian/resolver"
3
- require "librarian/spec_change_set"
4
- require "librarian/action/base"
5
-
6
- module Librarian
7
- module Action
8
- class Resolve < Base
9
-
10
- def run
11
- if force? || !lockfile_path.exist?
12
- spec = specfile.read
13
- manifests = []
14
- else
15
- lock = lockfile.read
16
- spec = specfile.read(lock.sources)
17
- changes = spec_change_set(spec, lock)
18
- if changes.same?
19
- debug { "The specfile is unchanged: nothing to do." }
20
- return
21
- end
22
- manifests = changes.analyze
23
- end
24
-
25
- resolution = resolver.resolve(spec, manifests)
26
- unless resolution.correct?
27
- raise Error, "Could not resolve the dependencies."
28
- else
29
- lockfile_text = lockfile.save(resolution)
30
- debug { "Bouncing #{lockfile_name}" }
31
- bounced_lockfile_text = lockfile.save(lockfile.load(lockfile_text))
32
- unless bounced_lockfile_text == lockfile_text
33
- debug { "lockfile_text: \n#{lockfile_text}"}
34
- debug { "bounced_lockfile_text: \n#{bounced_lockfile_text}"}
35
- raise Error, "Cannot bounce #{lockfile_name}!"
36
- end
37
- lockfile_path.open('wb') { |f| f.write(lockfile_text) }
38
- end
39
- end
40
-
41
- private
42
-
43
- def force?
44
- options[:force]
45
- end
46
-
47
- def specfile_name
48
- environment.specfile_name
49
- end
50
-
51
- def lockfile_name
52
- environment.lockfile_name
53
- end
54
-
55
- def specfile_path
56
- environment.specfile_path
57
- end
58
-
59
- def lockfile_path
60
- environment.lockfile_path
61
- end
62
-
63
- def specfile
64
- environment.specfile
65
- end
66
-
67
- def lockfile
68
- environment.lockfile
69
- end
70
-
71
- def resolver
72
- Resolver.new(environment)
73
- end
74
-
75
- def spec_change_set(spec, lock)
76
- SpecChangeSet.new(environment, spec, lock)
77
- end
78
-
79
- end
80
- end
81
- end
@@ -1,78 +0,0 @@
1
- require "librarian/error"
2
- require "librarian/manifest_set"
3
- require "librarian/resolver"
4
- require "librarian/spec_change_set"
5
- require "librarian/action/base"
6
-
7
- module Librarian
8
- module Action
9
- class Update < Base
10
-
11
- def run
12
- unless lockfile_path.exist?
13
- raise Error, "Lockfile missing!"
14
- end
15
- previous_resolution = lockfile.load(lockfile_path.read)
16
- spec = specfile.read(previous_resolution.sources)
17
- changes = spec_change_set(spec, previous_resolution)
18
- manifests = changes.same? ? previous_resolution.manifests : changes.analyze
19
- partial_manifests = ManifestSet.deep_strip(manifests, dependency_names)
20
- unpinnable_sources = previous_resolution.sources - partial_manifests.map(&:source)
21
- unpinnable_sources.each(&:unpin!)
22
- resolution = resolver.resolve(spec, partial_manifests)
23
- unless resolution.correct?
24
- raise Error, "Could not resolve the dependencies."
25
- else
26
- lockfile_text = lockfile.save(resolution)
27
- debug { "Bouncing #{lockfile_name}" }
28
- bounced_lockfile_text = lockfile.save(lockfile.load(lockfile_text))
29
- unless bounced_lockfile_text == lockfile_text
30
- debug { "lockfile_text: \n#{lockfile_text}"}
31
- debug { "bounced_lockfile_text: \n#{bounced_lockfile_text}"}
32
- raise Error, "Cannot bounce #{lockfile_name}!"
33
- end
34
- lockfile_path.open('wb') { |f| f.write(lockfile_text) }
35
- end
36
- end
37
-
38
- private
39
-
40
- def dependency_names
41
- options[:names]
42
- end
43
-
44
- def specfile_name
45
- environment.specfile_name
46
- end
47
-
48
- def lockfile_name
49
- environment.lockfile_name
50
- end
51
-
52
- def specfile_path
53
- environment.specfile_path
54
- end
55
-
56
- def lockfile_path
57
- environment.lockfile_path
58
- end
59
-
60
- def specfile
61
- environment.specfile
62
- end
63
-
64
- def lockfile
65
- environment.lockfile
66
- end
67
-
68
- def resolver
69
- Resolver.new(environment)
70
- end
71
-
72
- def spec_change_set(spec, lock)
73
- SpecChangeSet.new(environment, spec, lock)
74
- end
75
-
76
- end
77
- end
78
- end
@@ -1 +0,0 @@
1
- require 'librarian/chef/extension'
@@ -1,48 +0,0 @@
1
- require 'librarian/helpers'
2
-
3
- require 'librarian/cli'
4
- require 'librarian/chef'
5
-
6
- module Librarian
7
- module Chef
8
- class Cli < Librarian::Cli
9
-
10
- module Particularity
11
- def root_module
12
- Chef
13
- end
14
- end
15
-
16
- include Particularity
17
- extend Particularity
18
-
19
- source_root Pathname.new(__FILE__).dirname.join("templates")
20
-
21
- def init
22
- copy_file environment.specfile_name
23
- end
24
-
25
- desc "install", "Resolves and installs all of the dependencies you specify."
26
- option "quiet", :type => :boolean, :default => false
27
- option "verbose", :type => :boolean, :default => false
28
- option "line-numbers", :type => :boolean, :default => false
29
- option "clean", :type => :boolean, :default => false
30
- option "strip-dot-git", :type => :boolean
31
- option "path", :type => :string
32
- def install
33
- ensure!
34
- clean! if options["clean"]
35
- if options.include?("strip-dot-git")
36
- strip_dot_git_val = options["strip-dot-git"] ? "1" : nil
37
- environment.config_db.local["install.strip-dot-git"] = strip_dot_git_val
38
- end
39
- if options.include?("path")
40
- environment.config_db.local["path"] = options["path"]
41
- end
42
- resolve!
43
- install!
44
- end
45
-
46
- end
47
- end
48
- end
@@ -1,15 +0,0 @@
1
- require 'librarian/dsl'
2
- require 'librarian/chef/source'
3
-
4
- module Librarian
5
- module Chef
6
- class Dsl < Librarian::Dsl
7
-
8
- dependency :cookbook
9
-
10
- source :site => Source::Site
11
- source :git => Source::Git
12
- source :path => Source::Path
13
- end
14
- end
15
- end
@@ -1,27 +0,0 @@
1
- require "librarian/environment"
2
- require "librarian/chef/dsl"
3
- require "librarian/chef/source"
4
-
5
- module Librarian
6
- module Chef
7
- class Environment < Environment
8
-
9
- def adapter_name
10
- "chef"
11
- end
12
-
13
- def install_path
14
- part = config_db["path"] || "cookbooks"
15
- project_path.join(part)
16
- end
17
-
18
- def config_keys
19
- super + %w[
20
- install.strip-dot-git
21
- path
22
- ]
23
- end
24
-
25
- end
26
- end
27
- end
@@ -1,9 +0,0 @@
1
- require 'librarian/chef/environment'
2
-
3
- module Librarian
4
- module Chef
5
- extend self
6
- extend Librarian
7
-
8
- end
9
- end
@@ -1,42 +0,0 @@
1
- require 'pathname'
2
- require 'securerandom'
3
- require 'highline'
4
-
5
- require 'librarian'
6
- require 'librarian/action/install'
7
- require 'librarian/chef'
8
-
9
- module Librarian
10
- module Chef
11
-
12
- class Environment
13
- def install_path
14
- @install_path ||= begin
15
- has_home = ENV["HOME"] && File.directory?(ENV["HOME"])
16
- tmp_dir = Pathname.new(has_home ? "~/.librarian/tmp" : "/tmp/librarian").expand_path
17
- enclosing = tmp_dir.join("chef/integration/knife/install")
18
- enclosing.mkpath unless enclosing.exist?
19
- dir = enclosing.join(SecureRandom.hex(16))
20
- dir.mkpath
21
- at_exit { dir.rmtree }
22
- dir
23
- end
24
- end
25
- end
26
-
27
- def install_path
28
- environment.install_path
29
- end
30
-
31
- hl = HighLine.new
32
-
33
- begin
34
- Action::Install.new(environment).run
35
- rescue Error => e
36
- message = hl.color(e.message, HighLine::RED)
37
- hl.say(message)
38
- Process.exit!(1)
39
- end
40
-
41
- end
42
- end
@@ -1,59 +0,0 @@
1
- require 'json'
2
- require 'yaml'
3
-
4
- require 'librarian/manifest'
5
-
6
- module Librarian
7
- module Chef
8
- module ManifestReader
9
- extend self
10
-
11
- MANIFESTS = %w(metadata.json metadata.yml metadata.yaml metadata.rb)
12
-
13
- def manifest_path(path)
14
- MANIFESTS.map{|s| path.join(s)}.find{|s| s.exist?}
15
- end
16
-
17
- def read_manifest(name, manifest_path)
18
- case manifest_path.extname
19
- when ".json" then JSON.parse(binread(manifest_path))
20
- when ".yml", ".yaml" then YAML.load(binread(manifest_path))
21
- when ".rb" then compile_manifest(name, manifest_path.dirname)
22
- end
23
- end
24
-
25
- def compile_manifest(name, path)
26
- # Inefficient, if there are many cookbooks with uncompiled metadata.
27
- require 'chef/json_compat'
28
- require 'chef/cookbook/metadata'
29
- md = ::Chef::Cookbook::Metadata.new
30
- md.name(name)
31
- md.from_file(path.join('metadata.rb').to_s)
32
- {"name" => md.name, "version" => md.version, "dependencies" => md.dependencies}
33
- end
34
-
35
- def manifest?(name, path)
36
- path = Pathname.new(path)
37
- !!manifest_path(path)
38
- end
39
-
40
- def check_manifest(name, manifest_path)
41
- manifest = read_manifest(name, manifest_path)
42
- manifest["name"] == name
43
- end
44
-
45
- private
46
-
47
- if IO.respond_to?(:binread)
48
- def binread(path)
49
- path.binread
50
- end
51
- else
52
- def binread(path)
53
- path.read
54
- end
55
- end
56
-
57
- end
58
- end
59
- end
@@ -1,3 +0,0 @@
1
- require 'librarian/chef/source/path'
2
- require 'librarian/chef/source/git'
3
- require 'librarian/chef/source/site'
@@ -1,25 +0,0 @@
1
- require 'librarian/source/git'
2
- require 'librarian/chef/source/local'
3
-
4
- module Librarian
5
- module Chef
6
- module Source
7
- class Git < Librarian::Source::Git
8
- include Local
9
-
10
- private
11
-
12
- def install_perform_step_copy!(found_path, install_path)
13
- debug { "Copying #{relative_path_to(found_path)} to #{relative_path_to(install_path)}" }
14
- FileUtils.cp_r(found_path, install_path)
15
-
16
- if environment.config_db["install.strip-dot-git"] == "1"
17
- dot_git = install_path.join(".git")
18
- dot_git.rmtree if dot_git.directory?
19
- end
20
- end
21
-
22
- end
23
- end
24
- end
25
- end
@@ -1,69 +0,0 @@
1
- require 'librarian/chef/manifest_reader'
2
-
3
- module Librarian
4
- module Chef
5
- module Source
6
- module Local
7
-
8
- def install!(manifest)
9
- manifest.source == self or raise ArgumentError
10
-
11
- info { "Installing #{manifest.name} (#{manifest.version})" }
12
-
13
- debug { "Installing #{manifest}" }
14
-
15
- name, version = manifest.name, manifest.version
16
- found_path = found_path(name)
17
-
18
- install_path = environment.install_path.join(name)
19
- if install_path.exist?
20
- debug { "Deleting #{relative_path_to(install_path)}" }
21
- install_path.rmtree
22
- end
23
-
24
- install_perform_step_copy!(found_path, install_path)
25
- end
26
-
27
- def fetch_version(name, extra)
28
- manifest_data(name)["version"]
29
- end
30
-
31
- def fetch_dependencies(name, version, extra)
32
- manifest_data(name)["dependencies"]
33
- end
34
-
35
- private
36
-
37
- def install_perform_step_copy!(found_path, install_path)
38
- debug { "Copying #{relative_path_to(found_path)} to #{relative_path_to(install_path)}" }
39
- FileUtils.cp_r(found_path, install_path)
40
- end
41
-
42
- def manifest_data(name)
43
- @manifest_data ||= { }
44
- @manifest_data[name] ||= fetch_manifest_data(name)
45
- end
46
-
47
- def fetch_manifest_data(name)
48
- expect_manifest!(name)
49
-
50
- found_path = found_path(name)
51
- manifest_path = ManifestReader.manifest_path(found_path)
52
- ManifestReader.read_manifest(name, manifest_path)
53
- end
54
-
55
- def manifest?(name, path)
56
- ManifestReader.manifest?(name, path)
57
- end
58
-
59
- def expect_manifest!(name)
60
- found_path = found_path(name)
61
- return if found_path && ManifestReader.manifest_path(found_path)
62
-
63
- raise Error, "No metadata file found for #{name} from #{self}! If this should be a cookbook, you might consider contributing a metadata file upstream or forking the cookbook to add your own metadata file."
64
- end
65
-
66
- end
67
- end
68
- end
69
- end