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,46 +0,0 @@
1
- module Librarian
2
- class Logger
3
-
4
- librarian_path = Pathname(__FILE__)
5
- librarian_path = librarian_path.dirname until librarian_path.join("lib").directory?
6
- LIBRARIAN_PATH = librarian_path
7
-
8
- attr_accessor :environment
9
- private :environment=
10
-
11
- def initialize(environment)
12
- self.environment = environment
13
- end
14
-
15
- def info(string = nil, &block)
16
- return unless ui
17
-
18
- ui.info(string || yield)
19
- end
20
-
21
- def debug(string = nil, &block)
22
- return unless ui
23
-
24
- if ui.respond_to?(:debug_line_numbers) && ui.debug_line_numbers
25
- loc = caller.find{|l| !(l =~ /in `debug'$/)}
26
- if loc =~ /^(.+):(\d+):in `(.+)'$/
27
- loc = "#{Pathname.new($1).relative_path_from(LIBRARIAN_PATH)}:#{$2}:in `#{$3}'"
28
- end
29
- ui.debug { "[Librarian] #{string || yield} [#{loc}]" }
30
- else
31
- ui.debug { "[Librarian] #{string || yield}" }
32
- end
33
- end
34
-
35
- def relative_path_to(path)
36
- environment.project_relative_path_to(path)
37
- end
38
-
39
- private
40
-
41
- def ui
42
- environment.ui
43
- end
44
-
45
- end
46
- end
@@ -1,132 +0,0 @@
1
- require 'rubygems'
2
-
3
- module Librarian
4
- class Manifest
5
-
6
- class Version
7
- include Comparable
8
-
9
- def initialize(*args)
10
- args = initialize_normalize_args(args)
11
-
12
- self.backing = Gem::Version.new(*args)
13
- end
14
-
15
- def to_gem_version
16
- backing
17
- end
18
-
19
- def <=>(other)
20
- to_gem_version <=> other.to_gem_version
21
- end
22
-
23
- def to_s
24
- to_gem_version.to_s
25
- end
26
-
27
- private
28
-
29
- def initialize_normalize_args(args)
30
- args.map do |arg|
31
- arg = [arg] if self.class === arg
32
- arg
33
- end
34
- end
35
-
36
- attr_accessor :backing
37
- end
38
-
39
- attr_accessor :source, :name, :extra
40
- private :source=, :name=, :extra=
41
-
42
- def initialize(source, name, extra = nil)
43
- assert_name_valid! name
44
-
45
- self.source = source
46
- self.name = name
47
- self.extra = extra
48
- end
49
-
50
- def to_s
51
- "#{name}/#{version} <#{source}>"
52
- end
53
-
54
- def version
55
- defined_version || fetched_version
56
- end
57
-
58
- def version=(version)
59
- self.defined_version = _normalize_version(version)
60
- end
61
-
62
- def version?
63
- return unless defined_version
64
-
65
- defined_version == fetched_version
66
- end
67
-
68
- def dependencies
69
- defined_dependencies || fetched_dependencies
70
- end
71
-
72
- def dependencies=(dependencies)
73
- self.defined_dependencies = _normalize_dependencies(dependencies)
74
- end
75
-
76
- def dependencies?
77
- return unless defined_dependencies
78
-
79
- defined_dependencies.zip(fetched_dependencies).all? do |(a, b)|
80
- a.name == b.name && a.requirement == b.requirement
81
- end
82
- end
83
-
84
- def satisfies?(dependency)
85
- dependency.requirement.satisfied_by?(version)
86
- end
87
-
88
- def install!
89
- source.install!(self)
90
- end
91
-
92
- private
93
-
94
- attr_accessor :defined_version, :defined_dependencies
95
-
96
- def environment
97
- source.environment
98
- end
99
-
100
- def fetched_version
101
- @fetched_version ||= _normalize_version(fetch_version!)
102
- end
103
-
104
- def fetched_dependencies
105
- @fetched_dependencies ||= _normalize_dependencies(fetch_dependencies!)
106
- end
107
-
108
- def fetch_version!
109
- source.fetch_version(name, extra)
110
- end
111
-
112
- def fetch_dependencies!
113
- source.fetch_dependencies(name, version, extra)
114
- end
115
-
116
- def _normalize_version(version)
117
- Version.new(version)
118
- end
119
-
120
- def _normalize_dependencies(dependencies)
121
- if Hash === dependencies
122
- dependencies = dependencies.map{|k, v| Dependency.new(k, v, nil)}
123
- end
124
- dependencies.sort_by(&:name)
125
- end
126
-
127
- def assert_name_valid!(name)
128
- raise ArgumentError, "name (#{name.inspect}) must be sensible" unless name =~ /\A\S(?:.*\S)?\z/
129
- end
130
-
131
- end
132
- end
@@ -1,154 +0,0 @@
1
- require 'set'
2
- require 'tsort'
3
-
4
- module Librarian
5
- class ManifestSet
6
-
7
- class GraphHash < Hash
8
- include TSort
9
- alias tsort_each_node each_key
10
- def tsort_each_child(node, &block)
11
- self[node].each(&block)
12
- end
13
- end
14
-
15
- class << self
16
- def shallow_strip(manifests, names)
17
- new(manifests).shallow_strip!(names).send(method_for(manifests))
18
- end
19
- def deep_strip(manifests, names)
20
- new(manifests).deep_strip!(names).send(method_for(manifests))
21
- end
22
- def shallow_keep(manifests, names)
23
- new(manifests).shallow_keep!(names).send(method_for(manifests))
24
- end
25
- def deep_keep(manifests, names)
26
- new(manifests).deep_keep!(names).send(method_for(manifests))
27
- end
28
- def sort(manifests)
29
- manifests = Hash[manifests.map{|m| [m.name, m]}] if Array === manifests
30
- manifest_pairs = GraphHash[manifests.map{|k, m| [k, m.dependencies.map{|d| d.name}]}]
31
- manifest_names = manifest_pairs.tsort
32
- manifest_names.map{|n| manifests[n]}
33
- end
34
- private
35
- def method_for(manifests)
36
- case manifests
37
- when Hash
38
- :to_hash
39
- when Array
40
- :to_a
41
- end
42
- end
43
- end
44
-
45
- def initialize(manifests)
46
- self.index = Hash === manifests ? manifests.dup : Hash[manifests.map{|m| [m.name, m]}]
47
- end
48
-
49
- def to_a
50
- index.values
51
- end
52
-
53
- def to_hash
54
- index.dup
55
- end
56
-
57
- def dup
58
- self.class.new(index)
59
- end
60
-
61
- def shallow_strip(names)
62
- dup.shallow_strip!(names)
63
- end
64
-
65
- def shallow_strip!(names)
66
- assert_strings!(names)
67
-
68
- names.each do |name|
69
- index.delete(name)
70
- end
71
- self
72
- end
73
-
74
- def deep_strip(names)
75
- dup.deep_strip!(names)
76
- end
77
-
78
- def deep_strip!(names)
79
- names = Array === names ? names.dup : names.to_a
80
- assert_strings!(names)
81
-
82
- strippables = dependencies_of(names)
83
- shallow_strip!(strippables)
84
-
85
- self
86
- end
87
-
88
- def shallow_keep(names)
89
- dup.shallow_keep!(names)
90
- end
91
-
92
- def shallow_keep!(names)
93
- assert_strings!(names)
94
-
95
- names = Set.new(names) unless Set === names
96
- index.reject! { |k, v| !names.include?(k) }
97
- self
98
- end
99
-
100
- def deep_keep(names)
101
- dup.conservative_strip!(names)
102
- end
103
-
104
- def deep_keep!(names)
105
- names = Array === names ? names.dup : names.to_a
106
- assert_strings!(names)
107
-
108
- keepables = dependencies_of(names)
109
- shallow_keep!(keepables)
110
-
111
- self
112
- end
113
-
114
- def consistent?
115
- index.values.all? do |manifest|
116
- in_compliance_with?(manifest.dependencies)
117
- end
118
- end
119
-
120
- def in_compliance_with?(dependencies)
121
- dependencies.all? do |dependency|
122
- manifest = index[dependency.name]
123
- manifest && manifest.satisfies?(dependency)
124
- end
125
- end
126
-
127
- private
128
-
129
- attr_accessor :index
130
-
131
- def assert_strings!(names)
132
- non_strings = names.reject{|name| String === name}
133
- non_strings.empty? or raise TypeError, "names must all be strings"
134
- end
135
-
136
- # Straightforward breadth-first graph traversal algorithm.
137
- def dependencies_of(names)
138
- names = Array === names ? names.dup : names.to_a
139
- assert_strings!(names)
140
-
141
- deps = Set.new
142
- until names.empty?
143
- name = names.shift
144
- next if deps.include?(name)
145
-
146
- deps << name
147
- raise(Error, "Unable to find module #{name}") if index[name].nil?
148
- names.concat index[name].dependencies.map(&:name)
149
- end
150
- deps.to_a
151
- end
152
-
153
- end
154
- end
@@ -1 +0,0 @@
1
- require 'librarian/mock/extension'
@@ -1,19 +0,0 @@
1
- require 'librarian/cli'
2
- require 'librarian/mock'
3
-
4
- module Librarian
5
- module Mock
6
- class Cli < Librarian::Cli
7
-
8
- module Particularity
9
- def root_module
10
- Mock
11
- end
12
- end
13
-
14
- include Particularity
15
- extend Particularity
16
-
17
- end
18
- end
19
- end
@@ -1,15 +0,0 @@
1
- require 'librarian/dsl'
2
- require 'librarian/mock/source'
3
-
4
- module Librarian
5
- module Mock
6
- class Dsl < Librarian::Dsl
7
-
8
- dependency :dep
9
-
10
- source :src => Source::Mock
11
-
12
- shortcut :a, :src => 'source-a'
13
- end
14
- end
15
- end
@@ -1,24 +0,0 @@
1
- require "librarian/environment"
2
- require "librarian/mock/dsl"
3
-
4
- module Librarian
5
- module Mock
6
- class Environment < Environment
7
-
8
- def adapter_name
9
- "mock"
10
- end
11
-
12
- def install_path
13
- nil
14
- end
15
-
16
- def registry(options = nil, &block)
17
- @registry ||= Source::Mock::Registry.new
18
- @registry.merge!(options, &block)
19
- @registry
20
- end
21
- end
22
-
23
- end
24
- end
@@ -1,9 +0,0 @@
1
- require 'librarian/mock/environment'
2
-
3
- module Librarian
4
- module Mock
5
- extend self
6
- extend Librarian
7
-
8
- end
9
- end
@@ -1 +0,0 @@
1
- require 'librarian/mock/source/mock'
@@ -1,97 +0,0 @@
1
- require 'librarian/manifest'
2
- require 'librarian/mock/source/mock/registry'
3
-
4
- module Librarian
5
- module Mock
6
- module Source
7
- class Mock
8
-
9
- class << self
10
-
11
- LOCK_NAME = 'MOCK'
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, name, 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, name, options)
27
- end
28
-
29
- end
30
-
31
- attr_accessor :environment
32
- private :environment=
33
- attr_reader :name
34
-
35
- def initialize(environment, name, options)
36
- self.environment = environment
37
- @name = name
38
- end
39
-
40
- def to_s
41
- name
42
- end
43
-
44
- def ==(other)
45
- other &&
46
- self.class == other.class &&
47
- self.name == other.name
48
- end
49
-
50
- def to_spec_args
51
- [name, {}]
52
- end
53
-
54
- def to_lock_options
55
- {:remote => name}
56
- end
57
-
58
- def registry
59
- environment.registry[name]
60
- end
61
-
62
- def manifest(name, version, dependencies)
63
- manifest = Manifest.new(self, name)
64
- manifest.version = version
65
- manifest.dependencies = dependencies
66
- manifest
67
- end
68
-
69
- def manifests(name)
70
- if d = registry[name]
71
- d.map{|v| manifest(name, v[:version], v[:dependencies])}
72
- else
73
- nil
74
- end
75
- end
76
-
77
- def install!(manifest)
78
- end
79
-
80
- def to_s
81
- name
82
- end
83
-
84
- def fetch_version(name, extra)
85
- extra
86
- end
87
-
88
- def fetch_dependencies(name, version, extra)
89
- d = registry[name]
90
- m = d.find{|v| v[:version] == version.to_s}
91
- m[:dependencies]
92
- end
93
-
94
- end
95
- end
96
- end
97
- end