plugin_manager 1.3 → 1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/plugin_manager.rb +9 -3
  2. metadata +43 -49
@@ -128,7 +128,7 @@ class PluginManager
128
128
  Dependency.new(self, n, ">0")
129
129
  end
130
130
  end
131
- remaining_to_load = expand_dependencies(target_dependencies)
131
+ remaining_to_load = remove_already_loaded_dependencies(expand_dependencies(target_dependencies))
132
132
  while remaining_to_load.length > 0
133
133
  previous_length = remaining_to_load.length
134
134
  if plugin = next_to_load(remaining_to_load)
@@ -176,15 +176,21 @@ class PluginManager
176
176
  if pl = latest_version_by_name(dep.required_name)
177
177
  [dep, pl.dependencies]
178
178
  else
179
- dep
179
+ raise "couldn't find a plugin called #{dep.required_name}"
180
180
  end
181
- end.flatten.uniq
181
+ end.flatten.compact.uniq
182
182
  if new_dependency_array.length > previous_length
183
183
  expand_dependencies(new_dependency_array)
184
184
  else
185
185
  new_dependency_array
186
186
  end
187
187
  end
188
+
189
+ def remove_already_loaded_dependencies(dependency_array)
190
+ dependency_array.reject do |dep|
191
+ loaded_plugins.map(&:name).include?(dep.required_name)
192
+ end
193
+ end
188
194
 
189
195
  def next_to_load(dependency_array)
190
196
  hash = Hash.new {|h,k| h[k] = []}
metadata CHANGED
@@ -1,72 +1,66 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: plugin_manager
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: '1.4'
4
5
  prerelease:
5
- version: "1.3"
6
6
  platform: ruby
7
- authors:
8
- - Daniel Lucraft
7
+ authors:
8
+ - Daniel Lucraft
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-06-14 00:00:00 +01:00
12
+ date: 2011-11-16 00:00:00.000000000 +00:00
14
13
  default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
17
- name: rspec
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
20
- none: false
21
- requirements:
22
- - - ">="
23
- - !ruby/object:Gem::Version
24
- version: "0"
25
- type: :development
26
- version_requirements: *id001
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rspec
17
+ requirement: &70305755296240 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
23
+ type: :development
24
+ prerelease: false
25
+ version_requirements: *70305755296240
27
26
  description:
28
27
  email: dan@fluentradical.com
29
28
  executables: []
30
-
31
29
  extensions: []
32
-
33
- extra_rdoc_files:
34
- - README.md
35
- files:
36
- - README.md
37
- - Rakefile
38
- - lib/plugin_manager.rb
39
- - lib/plugin_manager/definition_builder.rb
40
- - lib/plugin_manager/plugin.rb
41
- - lib/plugin_manager/plugin_definition.rb
30
+ extra_rdoc_files:
31
+ - README.md
32
+ files:
33
+ - README.md
34
+ - Rakefile
35
+ - lib/plugin_manager/definition_builder.rb
36
+ - lib/plugin_manager/plugin.rb
37
+ - lib/plugin_manager/plugin_definition.rb
38
+ - lib/plugin_manager.rb
42
39
  has_rdoc: true
43
40
  homepage: http://github.com/danlucraft/plugin_manager
44
41
  licenses: []
45
-
46
42
  post_install_message:
47
- rdoc_options:
48
- - --main
49
- - README.md
50
- require_paths:
51
- - lib
52
- required_ruby_version: !ruby/object:Gem::Requirement
43
+ rdoc_options:
44
+ - --main
45
+ - README.md
46
+ require_paths:
47
+ - lib
48
+ required_ruby_version: !ruby/object:Gem::Requirement
53
49
  none: false
54
- requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- version: "0"
58
- required_rubygems_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
55
  none: false
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: "0"
56
+ requirements:
57
+ - - ! '>='
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
64
60
  requirements: []
65
-
66
61
  rubyforge_project:
67
- rubygems_version: 1.5.1
62
+ rubygems_version: 1.6.2
68
63
  signing_key:
69
64
  specification_version: 3
70
65
  summary: A Ruby plugin loader
71
66
  test_files: []
72
-