capistrano-karaf 1.4.0 → 1.4.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.
- data/lib/capistrano-karaf/install.rb +6 -4
- metadata +1 -1
@@ -13,18 +13,18 @@ module Capistrano_Karaf
|
|
13
13
|
# - :feature_url - the string containing the feature url
|
14
14
|
# - :feature - the string containing the feature name to upgrade
|
15
15
|
# - :version - the string containing the version
|
16
|
-
# - :
|
16
|
+
# - :condition - specifies when to upgrade the feature, one of [ :lt, :eq, :gt ( the default ) ]
|
17
17
|
#
|
18
18
|
# Examples
|
19
19
|
# upgrade([{:feature_url => "mvn:repository/featurea/xml/features/1.1.0",
|
20
20
|
# :feature => "featurea",
|
21
21
|
# :version => "1.1.0",
|
22
|
-
# :
|
22
|
+
# :condition => gt
|
23
23
|
# },
|
24
24
|
# {:feature_url => "mvn:repository/featureb/xml/features/1.2.0",
|
25
25
|
# :feature => "featureb",
|
26
26
|
# :version => "1.2.0",
|
27
|
-
# :
|
27
|
+
# :condition => gt
|
28
28
|
# }])
|
29
29
|
# # => nil
|
30
30
|
#
|
@@ -32,10 +32,12 @@ module Capistrano_Karaf
|
|
32
32
|
def upgrade (projects)
|
33
33
|
features = list_features()
|
34
34
|
projects.each do |project|
|
35
|
+
project = {:condition => :gt}.merge(project)
|
36
|
+
|
35
37
|
install_new_feature = true
|
36
38
|
installed_features = find_installed_with_name(features, project[:feature])
|
37
39
|
|
38
|
-
p = method(project[:
|
40
|
+
p = method(project[:condition])
|
39
41
|
installed_features.each do |f|
|
40
42
|
if p.call(f["version"], project[:version])
|
41
43
|
feature_uninstall("#{project[:feature]}/#{f['version']}")
|