rboss 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5c865678a219fd236a68663a11b06292b39d1d30
4
+ data.tar.gz: ea7e7538b6bcb61c42cee3edaf3618a85df8d9d8
5
+ SHA512:
6
+ metadata.gz: fe288a4166e76bf5c80b41ce303fde89966e8c36c5d8d486c97b416f4317b848c6cb7921ae9f1e40ca063ebe340e1431abd30e329985a421745a383105ce8b2c
7
+ data.tar.gz: 91cf9958af7217a830017acaed421c4913d1f5872355b30380ff216144564210d6e194530a91198df042293c6305b1527f573c55c24281c54c8c80249e361c02
@@ -92,6 +92,12 @@ end
92
92
  opts.on('--native COMMANDS', Array, 'Executes the given commands using cli interface (each command must be comma separated)') do |commands|
93
93
  @native = commands
94
94
  end
95
+ opts.on('--domain-host DOMAIN_HOST', 'Sets the domain host (for using in domain mode)') do |host|
96
+ @domain_host = host
97
+ end
98
+ opts.on('--domain-server DOMAIN_HOST', 'Sets the domain server (for using in domain mode)') do |server|
99
+ @domain_server = server
100
+ end
95
101
  opts.on('--script FILE', 'Executes the script in the cli interface') do |file|
96
102
  @script = file
97
103
  end
@@ -161,6 +167,9 @@ opts.parse!(ARGV) rescue abort 'Invalid Option! Use --help or -h for usage help.
161
167
  @jboss_home = params[:jboss_home]
162
168
  @jboss_cli = RBoss::Cli::Invoker::new params
163
169
 
170
+ @jboss_cli.domain_host = @domain_host if @domain_host
171
+ @jboss_cli.domain_server = @domain_server if @domain_server
172
+
164
173
  if save
165
174
  config = load_yaml
166
175
  config[save] ||= {}
@@ -224,5 +233,5 @@ begin
224
233
  execute_actions
225
234
 
226
235
  rescue Interrupt
227
- puts "Aborted!".colorize(:red)
236
+ puts "\nAborted!".colorize(:red)
228
237
  end
@@ -37,10 +37,11 @@ module RBoss
37
37
  include RBoss::Cli::Mappings, RBoss::Platform, RBoss::Cli::ResultParser
38
38
 
39
39
  attr_reader :server, :host, :port, :user, :password
40
+ attr_accessor :domain_host, :domain_server
40
41
 
41
42
  def initialize(params = {})
42
43
  params = {
43
- :jboss_home => ENV["JBOSS_HOME"],
44
+ :jboss_home => ENV['JBOSS_HOME'],
44
45
  }.merge! params
45
46
 
46
47
  @jboss_home = params[:jboss_home]
@@ -66,6 +67,14 @@ module RBoss
66
67
  @skip_optional = params[:skip_optional]
67
68
  end
68
69
 
70
+ def domain_host=(host)
71
+ @domain_host = "/host=#{host}"
72
+ end
73
+
74
+ def domain_server=(host)
75
+ @domain_server = "/server=#{host}"
76
+ end
77
+
69
78
  def command
70
79
  command = "#{jboss_cli} --connect"
71
80
  command << " --controller=#@server" if @server
@@ -75,11 +84,13 @@ module RBoss
75
84
  end
76
85
 
77
86
  def invoke(operation, resources, parameters)
78
- buff = ""
87
+ buff = ''
79
88
  resources.each do |key, resource_names|
80
89
  if resource_mappings.has_key? key
81
90
  mapping = resource_mappings[key]
82
91
  resource = RBoss::Cli::Resource::new(self, mapping)
92
+ resource.context[:domain_host] = @domain_host
93
+ resource.context[:domain_server] = @domain_server
83
94
  result = resource.invoke(operation, resource_names, parameters)
84
95
  buff << result.to_s if result
85
96
  end
@@ -89,11 +100,11 @@ module RBoss
89
100
 
90
101
  def gets_and_invoke(path, operation, parameters)
91
102
  result = result("#{path}:read-operation-description(name=#{operation})")
92
- props = result["request-properties"]
103
+ props = result['request-properties']
93
104
  props ||= {}
94
105
  builder = CommandBuilder::new operation
95
106
  help_printed = false
96
- info = Yummi::colorize("Please input the requested parameters", :yellow)
107
+ info = Yummi::colorize('Please input the requested parameters', :yellow)
97
108
  props.each do |name, detail|
98
109
  next if (@skip_optional and (not detail['required'] or detail['default']))
99
110
  parameter_type = detail['type']
@@ -105,28 +116,28 @@ module RBoss
105
116
  required = detail['required']
106
117
  default_value = detail['default']
107
118
  input_message << ' | ' << RBoss::Colorizers.type(parameter_type).colorize(parameter_type)
108
- input_message << ' | ' << Yummi::colorize("Required", :red) if required
109
- input_message << ' | ' << Yummi::colorize("Optional", :cyan) unless required
119
+ input_message << ' | ' << Yummi::colorize('Required', :red) if required
120
+ input_message << ' | ' << Yummi::colorize('Optional', :cyan) unless required
110
121
  input_message << ' | ' << Yummi::colorize("[#{default_value}]", :blue) if default_value
111
- input_message << "\n" << Yummi::colorize(detail['description'], "bold.black")
122
+ input_message << "\n" << Yummi::colorize(detail['description'], 'bold.black')
112
123
  puts input_message
113
124
  input = get_input
114
125
  while required and input.empty?
115
- puts Yummi::colorize("Required parameter!", :red)
126
+ puts Yummi::colorize('Required parameter!', :red)
116
127
  input = get_input
117
128
  end
118
129
  end
119
130
  if input.empty?
120
- puts Yummi::colorize("Parameter skipped!", :yellow)
131
+ puts Yummi::colorize('Parameter skipped!', :yellow)
121
132
  next
122
133
  end
123
134
  begin
124
135
  builder << {:name => name, :value => parameter_type.convert(input)}
125
136
  rescue Exception => e
126
- puts Yummi::colorize("Your input could not be converted:", :yellow)
137
+ puts Yummi::colorize('Your input could not be converted:', :yellow)
127
138
  puts Yummi::colorize(e.message, :red)
128
- puts Yummi::colorize("This will not affect other inputs, you can continue to input other values.", :yellow)
129
- puts "Press ENTER to continue"
139
+ puts Yummi::colorize('This will not affect other inputs, you can continue to input other values.', :yellow)
140
+ puts 'Press ENTER to continue'
130
141
  gets
131
142
  end
132
143
  end
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  description: Details Connectors
3
- path: /subsystem=web/connector=${NAME}
4
- scan: ls /subsystem=web/connector
3
+ path: ${DOMAIN_HOST}${DOMAIN_SERVER}/subsystem=web/connector=${NAME}
4
+ scan: ls ${DOMAIN_HOST}${DOMAIN_SERVER}/subsystem=web/connector
5
5
  print:
6
6
  - title: Connectors
7
7
  layout: vertical
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  description: Datasource Information
3
- path: /subsystem=datasources/data-source=${NAME}
4
- scan: ls /subsystem=datasources/data-source
3
+ path: ${DOMAIN_HOST}${DOMAIN_SERVER}/subsystem=datasources/data-source=${NAME}
4
+ scan: ls ${DOMAIN_HOST}${DOMAIN_SERVER}/subsystem=datasources/data-source
5
5
  print:
6
6
  - id: config
7
7
  title: Datasource Details
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  description: Details Deployment Scanner
3
- path: /subsystem=deployment-scanner/scanner=${NAME}
4
- scan: ls /subsystem=deployment-scanner/scanner
3
+ path: ${DOMAIN_HOST}${DOMAIN_SERVER}/subsystem=deployment-scanner/scanner=${NAME}
4
+ scan: ls ${DOMAIN_HOST}${DOMAIN_SERVER}/subsystem=deployment-scanner/scanner
5
5
  print:
6
6
  - title: Scanner
7
7
  layout: vertical
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  description: Details Interfaces
3
- path: /interface=${NAME}
4
- scan: ls /interface
3
+ path: ${DOMAIN_HOST}${DOMAIN_SERVER}/interface=${NAME}
4
+ scan: ls ${DOMAIN_HOST}${DOMAIN_SERVER}/interface
5
5
  print:
6
6
  - title: Interfaces
7
7
  layout: vertical
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  description: Detail JDBC Drivers
3
- path: /subsystem=datasources/jdbc-driver=${NAME}
4
- scan: ls /subsystem=datasources/jdbc-driver
3
+ path: ${DOMAIN_HOST}${DOMAIN_SERVER}/subsystem=datasources/jdbc-driver=${NAME}
4
+ scan: ls ${DOMAIN_HOST}${DOMAIN_SERVER}/subsystem=datasources/jdbc-driver
5
5
  print:
6
6
  - title: JDBC Drivers
7
7
  properties:
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Detail Server Information
3
- path: /core-service=
3
+ path: ${DOMAIN_HOST}${DOMAIN_SERVER}/core-service=
4
4
  print:
5
5
  - id: platform
6
6
  title: Operating System Information
@@ -25,6 +25,8 @@ module RBoss
25
25
  module Cli
26
26
  class Resource
27
27
 
28
+ attr_accessor :context
29
+
28
30
  def initialize(invoker, config)
29
31
  @config = config
30
32
  @invoker = invoker
@@ -21,5 +21,5 @@
21
21
  # THE SOFTWARE.
22
22
 
23
23
  module RBoss
24
- VERSION = "0.9.0"
24
+ VERSION = "0.9.1"
25
25
  end
@@ -3,7 +3,7 @@ require 'yummi'
3
3
  module RBoss
4
4
 
5
5
  #
6
- # A module that holds the builtin colorizers
6
+ # A module that holds the colorizers
7
7
  #
8
8
  module Colorizers
9
9
 
@@ -2,7 +2,7 @@ require 'yummi'
2
2
 
3
3
  module RBoss
4
4
  #
5
- # A module that holds the builtin formatters
5
+ # A module that holds the formatters
6
6
  #
7
7
  module Formatters
8
8
 
@@ -2,7 +2,7 @@ require 'yummi'
2
2
 
3
3
  module RBoss
4
4
  #
5
- # A module that holds the builtin health checkers
5
+ # A module that holds the health checkers
6
6
  #
7
7
  module HealthCheckers
8
8
 
data/rboss.iml CHANGED
@@ -8,9 +8,12 @@
8
8
  <sourceFolder url="file://$MODULE_DIR$/bin" isTestSource="false" />
9
9
  <excludeFolder url="file://$MODULE_DIR$/pkg" />
10
10
  </content>
11
- <orderEntry type="inheritedJdk" />
11
+ <orderEntry type="jdk" jdkName="RVM: ruby-2.0.0-p247" jdkType="RUBY_SDK" />
12
12
  <orderEntry type="sourceFolder" forTests="false" />
13
- <orderEntry type="library" scope="PROVIDED" name="bundler (v1.2.3, RVM: ruby-1.9.3-p374) [gem]" level="application" />
13
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v1.3.5, RVM: ruby-2.0.0-p247) [gem]" level="application" />
14
+ <orderEntry type="library" scope="PROVIDED" name="term-ansicolor (v1.2.2, RVM: ruby-2.0.0-p247) [gem]" level="application" />
15
+ <orderEntry type="library" scope="PROVIDED" name="tins (v0.12.0, RVM: ruby-2.0.0-p247) [gem]" level="application" />
16
+ <orderEntry type="library" scope="PROVIDED" name="yummi (v0.9.2, RVM: ruby-2.0.0-p247) [gem]" level="application" />
14
17
  </component>
15
18
  <component name="org.twodividedbyzero.idea.findbugs">
16
19
  <option name="_basePreferences">
metadata CHANGED
@@ -1,34 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rboss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
5
- prerelease:
4
+ version: 0.9.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Ataxexe
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-05-10 00:00:00.000000000 Z
11
+ date: 2014-03-11 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: yummi
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: 0.9.0
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: 0.9.0
30
- description: ! "Rboss gives you a set of command line tools to configure a JBoss instance\n
31
- \ and use jboss-cli and twiddle wrapped by an elegant interface"
27
+ description: |-
28
+ Rboss gives you a set of command line tools to configure a JBoss instance
29
+ and use jboss-cli and twiddle wrapped by an elegant interface
32
30
  email:
33
31
  - ataxexe@gmail.com
34
32
  executables:
@@ -103,26 +101,25 @@ files:
103
101
  - rboss.ipr
104
102
  homepage: https://github.com/ataxexe/rboss
105
103
  licenses: []
104
+ metadata: {}
106
105
  post_install_message:
107
106
  rdoc_options: []
108
107
  require_paths:
109
108
  - lib
110
109
  required_ruby_version: !ruby/object:Gem::Requirement
111
- none: false
112
110
  requirements:
113
- - - ! '>='
111
+ - - '>='
114
112
  - !ruby/object:Gem::Version
115
113
  version: '0'
116
114
  required_rubygems_version: !ruby/object:Gem::Requirement
117
- none: false
118
115
  requirements:
119
- - - ! '>='
116
+ - - '>='
120
117
  - !ruby/object:Gem::Version
121
118
  version: '0'
122
119
  requirements: []
123
120
  rubyforge_project: rboss
124
- rubygems_version: 1.8.25
121
+ rubygems_version: 2.1.9
125
122
  signing_key:
126
- specification_version: 3
123
+ specification_version: 4
127
124
  summary: Manage your JBoss from your command line.
128
125
  test_files: []