rhcp_shell 0.0.7 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,7 +14,10 @@ require 'rhcp'
14
14
  # If a command and all mandatory parameters are entered/selected, the command is
15
15
  # executed.
16
16
  class RHCPShellBackend < ShellBackend
17
-
17
+
18
+ # TODO refactor this monstrosity
19
+
20
+ attr_reader :last_response
18
21
  attr_reader :prompt
19
22
  attr_accessor :banner
20
23
 
@@ -111,7 +114,7 @@ class RHCPShellBackend < ShellBackend
111
114
  command.result_hints[:display_type] = "hidden"
112
115
  broker.register_command command
113
116
 
114
- command = RHCP::Command.new("detail", "shows details about a single record of the last response (makes sense if you executed a command that returned a table)",
117
+ command = RHCP::Command.new("detail", "shows details about a single record of the last response\n" + (" " * 43) + "(makes sense if you executed a command that returned a table)",
115
118
  lambda { |req,res|
116
119
  if @last_response == nil
117
120
  puts "did not find any old response data...is it possible that you did not execute a command yet that returned a table?"
@@ -270,12 +273,12 @@ class RHCPShellBackend < ShellBackend
270
273
  command = @command_broker.get_command(@command_selected.name)
271
274
  request = RHCP::Request.new(command, @collected_params)
272
275
  response = command.execute_request(request)
276
+ @last_response = response # we might want to access this response in further commands
273
277
  if (response.status == RHCP::Response::Status::OK)
274
278
  $logger.debug "raw result : #{response.data}"
275
279
  $logger.debug "result hints: #{command.result_hints}"
276
280
  $logger.debug "display_type : #{command.result_hints[:display_type]}"
277
281
  if command.result_hints[:display_type] == "table"
278
- @last_response = response # we might want to access this response in further commands
279
282
  # TODO make sure that the response really holds the correct data types and that we've got at least one column
280
283
  # TODO check that all columns in overview_columns are valid
281
284
  # TODO check that all columns in column_titles are valid and match overview_columns
@@ -517,4 +520,4 @@ def show_banner
517
520
  end
518
521
  end
519
522
 
520
- end
523
+ end
data/lib/version.rb CHANGED
@@ -5,7 +5,7 @@ module RhcpShell #:nodoc:
5
5
 
6
6
  MAJOR = 0
7
7
  MINOR = 0
8
- TINY = 7
8
+ TINY = 9
9
9
 
10
10
  def Version.to_s
11
11
  [ MAJOR, MINOR, TINY ].join(".")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhcp_shell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philipp Traeder
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-17 00:00:00 +02:00
12
+ date: 2009-10-15 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -33,12 +33,10 @@ extra_rdoc_files: []
33
33
  files:
34
34
  - bin/rhcp_shell
35
35
  - lib/shell_backend.rb
36
- - lib/rhcp_shell.rb
37
36
  - lib/base_shell.rb
38
37
  - lib/test.log
39
38
  - lib/rhcp_shell_backend.rb
40
39
  - lib/version.rb
41
- - lib/rhcp_shell.log
42
40
  - test/rhcp_shell_backend_test.rb
43
41
  - test/setup_test_registry.rb
44
42
  has_rdoc: true