gitorious-munin-plugins 0.9.15 → 0.9.16

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,8 +15,8 @@ Usage:
15
15
  where [options] are:
16
16
  EOS
17
17
  opt :status, "List install status of plugins"
18
- opt :install, "Install PACKAGE1 PACKAGE2"
19
- opt :uninstall, "Uninstall PACKAGE1 PACKAGE2 "
18
+ opt :install, "Install PACKAGE1 PACKAGE2. Specify 'all' to install all plugins"
19
+ opt :uninstall, "Uninstall PACKAGE1 PACKAGE2. Specify 'all' to uninstall all plugins "
20
20
  end
21
21
 
22
22
  if global_options[:status_given]
@@ -28,7 +28,8 @@ EOS
28
28
  end
29
29
  end
30
30
 
31
- def install_plugins(plugins)
31
+ def install_plugins(plugin_spec)
32
+ plugins = extract_plugins_from_spec(plugin_spec)
32
33
  plugins.each do |p|
33
34
  if plugin = @known_plugins.detect {|_p| _p.named?(p)}
34
35
  plugin.install!
@@ -38,7 +39,8 @@ EOS
38
39
  end
39
40
  end
40
41
 
41
- def uninstall_plugins(plugins)
42
+ def uninstall_plugins(plugin_spec)
43
+ plugins = extract_plugins_from_spec(plugin_spec)
42
44
  plugins.each do |p|
43
45
  if plugin = @known_plugins.detect {|_p| _p.named?(p)}
44
46
  plugin.uninstall!
@@ -48,6 +50,14 @@ EOS
48
50
  end
49
51
  end
50
52
 
53
+ def extract_plugins_from_spec(spec)
54
+ if spec.first == "all"
55
+ @known_plugins.map(&:name)
56
+ else
57
+ return spec
58
+ end
59
+ end
60
+
51
61
  def display_install_status
52
62
  msg = [Term::ANSIColor.bold { "These plugins are available"} ]
53
63
  @known_plugins.each do |p|
@@ -1,3 +1,3 @@
1
1
  module GitoriousMuninPlugins
2
- VERSION = "0.9.15"
2
+ VERSION = "0.9.16"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitorious-munin-plugins
3
3
  version: !ruby/object:Gem::Version
4
- hash: 37
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 15
10
- version: 0.9.15
9
+ - 16
10
+ version: 0.9.16
11
11
  platform: ruby
12
12
  authors:
13
13
  - Marius Mathiesen
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-11-01 00:00:00 +01:00
18
+ date: 2012-11-02 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency