capistrano-karaf 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -74,18 +74,23 @@ module Capistrano_Karaf
74
74
  # Uninstall a feature on the karaf server
75
75
  #
76
76
  # name - the string containing the feature name
77
- # version - the string containing the version number
77
+ # version - the optional string containing the version number
78
78
  #
79
79
  # Examples
80
80
  # feature_uninstall "hello" "2.19.0"
81
81
  # # => nil
82
82
  #
83
83
  # Returns nothing
84
- def feature_uninstall(name, version)
84
+ def feature_uninstall(name, version=nil)
85
85
 
86
86
  # Keep track of the bundles that are part of the feature
87
87
  feature_bundle_urls = feature_bundles(name, version).collect {|b| b[:url]}
88
- execute(:features_uninstall, "#{name}/#{version}")
88
+
89
+ if version.nil? then
90
+ execute(:features_uninstall, "#{name}")
91
+ else
92
+ execute(:features_uninstall, "#{name}/#{version}")
93
+ end
89
94
 
90
95
  # Verify all bundles have been uninstalled and remove the bundle if not
91
96
  list_bundle_locations.each do |installed_bundle|
@@ -47,13 +47,14 @@ module Capistrano_Karaf
47
47
  # way it tries to avoid an exception on the karaf server.
48
48
  #
49
49
  # name - a string containing the feature name
50
+ # version - an optional version string
50
51
  #
51
52
  # Examples
52
53
  # feature_uninstall_safe "test", "1.0.0"
53
54
  # # => nil
54
55
  #
55
56
  # Returns nothing
56
- def feature_uninstall_safe (name, version)
57
+ def feature_uninstall_safe (name, version=nil)
57
58
  feature_uninstall name, version unless !feature_installed? name, version
58
59
  end
59
60
 
@@ -119,6 +120,7 @@ module Capistrano_Karaf
119
120
  # Verify if a feature is installed
120
121
  #
121
122
  # name - a string containing the name of the feature
123
+ # version - an optional version string
122
124
  #
123
125
  # Examples
124
126
  # feature_installed? "camel-core"
@@ -126,7 +128,7 @@ module Capistrano_Karaf
126
128
  #
127
129
  # Returns true if the feature is installed
128
130
  def feature_installed? (name, version)
129
- feature = list_features.find {|f| f[:name]==name and f[:version] == version}
131
+ feature = list_features.find {|f| f[:name]==name and (version.nil? or f[:version] == version)}
130
132
  feature[:status] == 'installed' unless feature.nil?
131
133
  end
132
134
 
metadata CHANGED
@@ -1,12 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-karaf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Brecht Hoflack
9
- - Jerome Morel
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []