rboss 0.8.0 → 0.8.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/bin/rboss-cli +16 -9
- data/lib/rboss/cli/invoker.rb +1 -1
- data/lib/rboss/cli/mappings.rb +16 -11
- data/lib/rboss/cli/resource.rb +4 -3
- data/lib/rboss/version.rb +1 -1
- metadata +2 -2
data/bin/rboss-cli
CHANGED
@@ -35,7 +35,6 @@ servers_file = "#@conf_dir/jboss-cli-servers.yaml"
|
|
35
35
|
@resources = {}
|
36
36
|
@parameters = {}
|
37
37
|
@servers_file = File.expand_path(servers_file)
|
38
|
-
@operation = :read_resource
|
39
38
|
save = false
|
40
39
|
params[:jboss_home] = (ENV["RBOSS_CLI_JBOSS_HOME"] or Dir.pwd)
|
41
40
|
params[:host] = '127.0.0.1'
|
@@ -112,13 +111,15 @@ opts.on('-a', '--args PARAMETERS', Array,
|
|
112
111
|
end
|
113
112
|
|
114
113
|
RBoss::Cli::Mappings.resource_mappings.each do |name, config|
|
115
|
-
if config[:
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
114
|
+
if config[:description]
|
115
|
+
if config[:scan]
|
116
|
+
opts.on("--#{name} [NAMES]", Array, config[:description]) do |resources|
|
117
|
+
@resources[name] = resources
|
118
|
+
end
|
119
|
+
else
|
120
|
+
opts.on("--#{name}", config[:description]) do
|
121
|
+
@resources[name] = true
|
122
|
+
end
|
122
123
|
end
|
123
124
|
end
|
124
125
|
end
|
@@ -152,7 +153,13 @@ if save
|
|
152
153
|
puts "Configuration saved!"
|
153
154
|
end
|
154
155
|
|
155
|
-
|
156
|
+
if @resources.empty? and not @operation
|
157
|
+
puts opts
|
158
|
+
elsif @resources.empty?
|
159
|
+
@resources[''] = true
|
160
|
+
elsif not @operation
|
161
|
+
@operation = :read_resource
|
162
|
+
end
|
156
163
|
|
157
164
|
def execute_actions
|
158
165
|
begin
|
data/lib/rboss/cli/invoker.rb
CHANGED
@@ -131,7 +131,7 @@ module RBoss
|
|
131
131
|
end
|
132
132
|
end
|
133
133
|
result = result("#{path}:#{builder}")
|
134
|
-
puts Yummi::colorize("Result:", :
|
134
|
+
puts Yummi::colorize("Result:", :intense_yellow)
|
135
135
|
#TODO print a table using the returned parameters
|
136
136
|
puts YAML::dump(result)
|
137
137
|
end
|
data/lib/rboss/cli/mappings.rb
CHANGED
@@ -36,18 +36,20 @@ module RBoss
|
|
36
36
|
name = File.basename(file, '.yaml').gsub('_', '-')
|
37
37
|
mapping = YAML::load_file(file).symbolize_keys
|
38
38
|
@resource_mappings[name] = mapping
|
39
|
-
mapping[:print]
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
39
|
+
if mapping[:print]
|
40
|
+
mapping[:print].each do |table|
|
41
|
+
if table[:id]
|
42
|
+
new_mapping = mapping.dup
|
43
|
+
new_mapping[:print] = [table]
|
44
|
+
new_mapping[:description] = table[:title]
|
45
|
+
new_mapping[:derived] = true
|
46
|
+
if table[:path]
|
47
|
+
new_mapping[:path] = table[:path].gsub '${PATH}', mapping[:path]
|
48
|
+
table[:path] = new_mapping[:path]
|
49
|
+
end
|
50
|
+
new_key = "#{name}-#{table[:id]}"
|
51
|
+
@resource_mappings[new_key] = new_mapping
|
48
52
|
end
|
49
|
-
new_key = "#{name}-#{table[:id]}"
|
50
|
-
@resource_mappings[new_key] = new_mapping
|
51
53
|
end
|
52
54
|
end
|
53
55
|
end
|
@@ -65,6 +67,9 @@ module RBoss
|
|
65
67
|
if File.exist? file
|
66
68
|
load_resources file
|
67
69
|
end
|
70
|
+
@resource_mappings[''] = {
|
71
|
+
:path => ''
|
72
|
+
}
|
68
73
|
end
|
69
74
|
|
70
75
|
module_function :load_resources,
|
data/lib/rboss/cli/resource.rb
CHANGED
@@ -30,7 +30,7 @@ module RBoss
|
|
30
30
|
@invoker = invoker
|
31
31
|
@context = {
|
32
32
|
:name => '',
|
33
|
-
:read_resource => 'read-resource(include-runtime=true)'
|
33
|
+
:read_resource => 'read-resource(include-runtime=true,recursive=true)'
|
34
34
|
}
|
35
35
|
@context[:path] = parse(@config[:path])
|
36
36
|
@tables = []
|
@@ -49,6 +49,7 @@ module RBoss
|
|
49
49
|
def read_resource(resources, arguments)
|
50
50
|
resources ||= scan
|
51
51
|
params = @config[:print]
|
52
|
+
return unless params
|
52
53
|
params.each do |p|
|
53
54
|
table_builder = RBoss::TableBuilder::new p
|
54
55
|
table_builder.add_name_column if scannable?
|
@@ -70,7 +71,7 @@ module RBoss
|
|
70
71
|
end
|
71
72
|
|
72
73
|
def read_operation_names(resource_name, arguments)
|
73
|
-
operations = Yummi::colorize('Operations:', :
|
74
|
+
operations = Yummi::colorize('Operations:', :intense_yellow)
|
74
75
|
operations << $/
|
75
76
|
with resource_name do
|
76
77
|
result = @invoker.result("#{@context[:path]}:read-operation-names")
|
@@ -197,7 +198,7 @@ module RBoss
|
|
197
198
|
end
|
198
199
|
|
199
200
|
def get_data(config)
|
200
|
-
command = parse((config[:command] or
|
201
|
+
command = parse((config[:command] or "${PATH}:#{@context[:read_resource]}"))
|
201
202
|
begin
|
202
203
|
result = @invoker.result(command)
|
203
204
|
data = []
|
data/lib/rboss/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rboss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-04 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: ! "Rboss gives you a set of command line tools to configure a JBoss instance\n
|
15
15
|
\ and use jboss-cli and twiddle wrapped by an elegant interface"
|