rboss 0.9.1 → 0.9.3

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.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/.idea/encodings.xml +5 -0
  3. data/.idea/misc.xml +5 -0
  4. data/.idea/modules.xml +9 -0
  5. data/.idea/rboss.iml +65 -0
  6. data/.idea/scopes/scope_settings.xml +5 -0
  7. data/.idea/vcs.xml +7 -0
  8. data/Gemfile +2 -2
  9. data/README.md +34 -397
  10. data/bin/rboss-cli +77 -28
  11. data/lib/rboss.rb +10 -12
  12. data/lib/rboss/cli/invoker.rb +31 -18
  13. data/lib/rboss/cli/mappings.rb +11 -10
  14. data/lib/rboss/cli/mappings/resources/connector.yaml +2 -2
  15. data/lib/rboss/cli/mappings/resources/datasource.yaml +5 -5
  16. data/lib/rboss/cli/mappings/resources/deployment-scanner.yaml +3 -3
  17. data/lib/rboss/cli/mappings/resources/interface.yaml +2 -2
  18. data/lib/rboss/cli/mappings/resources/jdbc-driver.yaml +12 -0
  19. data/lib/rboss/cli/mappings/resources/jms-queue.yaml +44 -0
  20. data/lib/rboss/cli/mappings/resources/runtime.yaml +34 -0
  21. data/lib/rboss/cli/mappings/resources/server.yaml +8 -8
  22. data/lib/rboss/cli/resource.rb +60 -37
  23. data/lib/rboss/cli/result_parser.rb +29 -5
  24. data/lib/rboss/plaftorm.rb +2 -25
  25. data/lib/rboss/utils.rb +2 -8
  26. data/lib/rboss/version.rb +1 -1
  27. data/lib/rboss/view/colorizers.rb +4 -2
  28. data/lib/rboss/view/formatters.rb +37 -0
  29. data/lib/rboss/view/table_builder.rb +2 -2
  30. data/rboss-cli-bash-completion +82 -0
  31. data/rboss.gemspec +12 -12
  32. data/rboss.iml +6 -7
  33. data/rboss.ipr +2 -11
  34. metadata +23 -53
  35. data/bin/rboss-profile +0 -125
  36. data/bin/rboss-twiddle +0 -204
  37. data/lib/rboss/bin/command_actions.rb +0 -125
  38. data/lib/rboss/cli/mappings/resources/jdbc_driver.yaml +0 -12
  39. data/lib/rboss/component_processor.rb +0 -179
  40. data/lib/rboss/components/component.rb +0 -58
  41. data/lib/rboss/components/datasource.rb +0 -179
  42. data/lib/rboss/components/deploy_folder.rb +0 -104
  43. data/lib/rboss/components/hypersonic_replacer.rb +0 -58
  44. data/lib/rboss/components/jbossweb.rb +0 -119
  45. data/lib/rboss/components/jmx.rb +0 -88
  46. data/lib/rboss/components/mod_cluster.rb +0 -81
  47. data/lib/rboss/components/org/6.0/deploy_folder.rb +0 -33
  48. data/lib/rboss/components/org/jmx.rb +0 -59
  49. data/lib/rboss/components/profile_folder.rb +0 -44
  50. data/lib/rboss/components/resource.rb +0 -52
  51. data/lib/rboss/components/restore_slimming.rb +0 -46
  52. data/lib/rboss/components/run_conf.rb +0 -90
  53. data/lib/rboss/components/run_conf.yaml +0 -22
  54. data/lib/rboss/components/service_script.rb +0 -55
  55. data/lib/rboss/components/slimming.rb +0 -107
  56. data/lib/rboss/components/slimming.yaml +0 -110
  57. data/lib/rboss/components/soa-p/hypersonic_replacer.rb +0 -79
  58. data/lib/rboss/components/soa-p/jmx.rb +0 -47
  59. data/lib/rboss/components/xadatasource.rb +0 -67
  60. data/lib/rboss/file_processor.rb +0 -111
  61. data/lib/rboss/jboss_path.rb +0 -74
  62. data/lib/rboss/jboss_profile.rb +0 -350
  63. data/lib/rboss/resources/jboss_init_redhat.sh.erb +0 -140
  64. data/lib/rboss/resources/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml +0 -282
  65. data/lib/rboss/resources/mod_cluster.sar/mod_cluster-1.1.2.Final.jar +0 -0
  66. data/lib/rboss/resources/run.conf.bat.erb +0 -60
  67. data/lib/rboss/resources/run.conf.erb +0 -62
  68. data/lib/rboss/twiddle.rb +0 -25
  69. data/lib/rboss/twiddle/base_monitor.rb +0 -88
  70. data/lib/rboss/twiddle/mbean.rb +0 -148
  71. data/lib/rboss/twiddle/monitor.rb +0 -222
  72. data/lib/rboss/twiddle/twiddle.rb +0 -87
@@ -21,5 +21,5 @@
21
21
  # THE SOFTWARE.
22
22
 
23
23
  module RBoss
24
- VERSION = "0.9.1"
24
+ VERSION = '0.9.3'
25
25
  end
@@ -6,14 +6,16 @@ module RBoss
6
6
  # A module that holds the colorizers
7
7
  #
8
8
  module Colorizers
9
-
9
+
10
+ module_function
11
+
10
12
  #
11
13
  # A colorizer for the types returned by invocations in jboss-cli.
12
14
  #
13
15
  # Parameter:
14
16
  # The type to use the color
15
17
  #
16
- def self.type type
18
+ def type type
17
19
  Yummi::to_colorize do |ctx|
18
20
  case type
19
21
  when RBoss::Cli::ResultParser::STRING then
@@ -6,5 +6,42 @@ module RBoss
6
6
  #
7
7
  module Formatters
8
8
 
9
+ module_function
10
+
11
+ def date(format = '%d-%m-%Y %H:%M:%S %z')
12
+ Yummi::to_format do |ctx|
13
+ value = ctx.value
14
+ Time.at(value / 1000).strftime(format)
15
+ end
16
+ end
17
+
18
+ def time
19
+ Yummi::to_format do |ctx|
20
+ value = ctx.value / 1000
21
+ seconds = value % 60
22
+ minutes = (value / 60) % 60
23
+ hours = (value / 60 / 60) % 24
24
+ days = (value / 60 / 60 / 24)
25
+ "#{days}d #{hours}h #{minutes}m #{seconds}s"
26
+ end
27
+ end
28
+
29
+ def trim(max)
30
+ Yummi::to_format do |ctx|
31
+ value = ctx.value.to_s
32
+ if value.size > max
33
+ value[0..max] << '...'
34
+ else
35
+ value
36
+ end
37
+ end
38
+ end
39
+
40
+ def array(separator = ', ')
41
+ Yummi::to_format do |ctx|
42
+ ctx.value.join separator
43
+ end
44
+ end
45
+
9
46
  end
10
47
  end
@@ -24,7 +24,7 @@ module RBoss
24
24
  class TableBuilder
25
25
 
26
26
  def initialize(config)
27
- @config = config
27
+ @config = config.dup
28
28
  add_name_column if config[:scan]
29
29
  end
30
30
 
@@ -60,7 +60,7 @@ module RBoss
60
60
  table.format_null :with => 'undefined'
61
61
  table.colorize_null :with => :red
62
62
 
63
- table.colorize :name, :with => "bold.white" if @name_column
63
+ table.colorize :name, :with => 'bold.white' if @name_column
64
64
 
65
65
  table
66
66
  end
@@ -0,0 +1,82 @@
1
+ #!/bin/sh
2
+ # The MIT License
3
+ #
4
+ # Copyright (c) 2014 Marcelo Guimaraes <ataxexe@gmail.com>
5
+ # ----------------------------------------------------------------------
6
+ # Permission is hereby granted, free of charge, to any person obtaining
7
+ # a copy of this software and associated documentation files (the
8
+ # "Software"), to deal in the Software without restriction, including
9
+ # without limitation the rights to use, copy, modify, merge, publish,
10
+ # distribute, sublicense, and/or sell copies of the Software, and to
11
+ # permit persons to whom the Software is furnished to do so, subject to
12
+ # the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be
15
+ # included in all copies or substantial portions of the Software.
16
+ # -----------------------
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20
+ # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21
+ # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22
+ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23
+ # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
+
25
+ _rboss_cli () {
26
+ COMPREPLY=()
27
+ local cur="${COMP_WORDS[COMP_CWORD]}"
28
+ local prev="${COMP_WORDS[COMP_CWORD-1]}"
29
+ local args="${COMP_WORDS[@]:1}"
30
+ local prev_args="${COMP_WORDS[@]:1:COMP_CWORD-1}"
31
+
32
+ case "$cur" in
33
+ - | --*)
34
+ COMPREPLY=( $( compgen -W '$(rboss-cli options)' -- $cur ) )
35
+ ;;
36
+ *)
37
+ case "$prev" in
38
+ --connect)
39
+ COMPREPLY=( $( compgen -W '$(rboss-cli --list-servers)' -- $cur ) )
40
+ ;;
41
+ -o | --operation | \
42
+ -d | --detail)
43
+ COMPREPLY=( $( compgen -W '$(rboss-cli $prev_args read-operation-names)' -- $cur ) )
44
+ ;;
45
+ -j | --jboss-home | --script)
46
+ _longopt
47
+ ;;
48
+ --domain-host)
49
+ COMPREPLY=( $( compgen -W '$(rboss-cli ${prev_args/--domain-host//} --hosts)' -- $cur ) )
50
+ ;;
51
+ --domain-server)
52
+ COMPREPLY=( $( compgen -W '$(rboss-cli ${prev_args/--domain-server//} --servers)' -- $cur ) )
53
+ ;;
54
+ -v | -s | -u | -p | -l | -n | -r | \
55
+ --list-operations | \
56
+ --list-resource-names | \
57
+ --verbose | \
58
+ --host | \
59
+ --port | \
60
+ --save | \
61
+ --list-servers | \
62
+ --start-cli | \
63
+ --native | \
64
+ --no-colors | \
65
+ --attribute | \
66
+ --all)
67
+ ;;
68
+ --*)
69
+ if [[ "$cur" =~ .*,.* ]]; then
70
+ COMPREPLY=( $( compgen -W '$(rboss-cli $args --list-resource-names)' \
71
+ -P "${cur%,*}," -- ${cur##*,} ) )
72
+ else
73
+ COMPREPLY=( $( compgen -W '$(rboss-cli $args --list-resource-names)' -- $cur ) )
74
+ fi
75
+ ;;
76
+ esac
77
+ ;;
78
+ esac
79
+ return 0
80
+ }
81
+
82
+ complete -F _rboss_cli -o nospace rboss-cli
@@ -1,23 +1,23 @@
1
1
  # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "rboss/version"
2
+ $:.push File.expand_path('../lib', __FILE__)
3
+ require 'rboss/version'
4
4
 
5
5
  Gem::Specification.new do |gem|
6
- gem.name = "rboss"
6
+ gem.name = 'rboss'
7
7
  gem.version = RBoss::VERSION
8
- gem.authors = ["Ataxexe"]
9
- gem.email = ["ataxexe@gmail.com"]
10
- gem.homepage = "https://github.com/ataxexe/rboss"
11
- gem.summary = %q{Manage your JBoss from your command line.}
12
- gem.description = %q{Rboss gives you a set of command line tools to configure a JBoss instance
13
- and use jboss-cli and twiddle wrapped by an elegant interface}
8
+ gem.authors = %w(Ataxexe)
9
+ gem.email = %w(ataxexe@gmail.com)
10
+ gem.homepage = 'https://github.com/ataxexe/rboss'
11
+ gem.summary = %q{Manage your JBoss from your command line}
12
+ gem.description = %q{Rboss gives you a set of command line tools to use
13
+ jboss-cli wrapped by an elegant interface}
14
14
 
15
- gem.rubyforge_project = "rboss"
15
+ gem.rubyforge_project = 'rboss'
16
16
 
17
- gem.add_dependency 'yummi', '>=0.9.0'
17
+ gem.add_dependency 'yummi', '>= 0.9.3'
18
18
 
19
19
  gem.files = `git ls-files`.split("\n")
20
20
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
21
  gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
- gem.require_paths = ["lib"]
22
+ gem.require_paths = %w(lib)
23
23
  end
data/rboss.iml CHANGED
@@ -8,12 +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="jdk" jdkName="RVM: ruby-2.0.0-p247" jdkType="RUBY_SDK" />
11
+ <orderEntry type="inheritedJdk" />
12
12
  <orderEntry type="sourceFolder" forTests="false" />
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" />
13
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v1.7.6, RVM: ruby-2.1-head) [gem]" level="application" />
14
+ <orderEntry type="library" scope="PROVIDED" name="term-ansicolor (v1.3.0, RVM: ruby-2.1-head) [gem]" level="application" />
15
+ <orderEntry type="library" scope="PROVIDED" name="tins (v1.3.2, RVM: ruby-2.1-head) [gem]" level="application" />
16
+ <orderEntry type="library" scope="PROVIDED" name="yummi (v0.9.4, RVM: ruby-2.1-head) [gem]" level="application" />
17
17
  </component>
18
18
  <component name="org.twodividedbyzero.idea.findbugs">
19
19
  <option name="_basePreferences">
@@ -204,5 +204,4 @@
204
204
  </map>
205
205
  </option>
206
206
  </component>
207
- </module>
208
-
207
+ </module>
data/rboss.ipr CHANGED
@@ -4,9 +4,6 @@
4
4
  <asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
5
5
  <groovy codeStyle="LEGACY" />
6
6
  </component>
7
- <component name="AntConfiguration">
8
- <defaultAnt bundledAnt="true" />
9
- </component>
10
7
  <component name="BuildJarProjectSettings">
11
8
  <option name="BUILD_JARS_ON_MAKE" value="false" />
12
9
  </component>
@@ -100,7 +97,6 @@
100
97
  <option name="myName" value="MIT" />
101
98
  <option name="myLocal" value="true" />
102
99
  </copyright>
103
- <module2copyright />
104
100
  </component>
105
101
  <component name="CppTools.Loader" reportImplicitCastToBool="false" reportNameReferencedOnce="false" version="3" compilerSelect="AUTO" />
106
102
  <component name="DependencyValidationManager">
@@ -114,9 +110,6 @@
114
110
  <component name="EntryPointsManager">
115
111
  <entry_points version="2.0" />
116
112
  </component>
117
- <component name="GradleSettings">
118
- <option name="gradleHome" value="$USER_HOME$/build/gradle" />
119
- </component>
120
113
  <component name="GradleUISettings">
121
114
  <setting name="root" />
122
115
  </component>
@@ -132,7 +125,6 @@
132
125
  <profile version="1.0" is_locked="false">
133
126
  <option name="myName" value="Project Default" />
134
127
  <option name="myLocal" value="false" />
135
- <inspection_tool class="Fix shebang" enabled="true" level="WARNING" enabled_by_default="true">/bin/sh#/bin/bash</inspection_tool>
136
128
  <inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
137
129
  <option name="processCode" value="true" />
138
130
  <option name="processLiterals" value="true" />
@@ -323,7 +315,7 @@
323
315
  <component name="ProjectResources">
324
316
  <default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
325
317
  </component>
326
- <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="RVM: ruby-1.9.3-p374" project-jdk-type="RUBY_SDK">
318
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="RVM: ruby-2.1-head" project-jdk-type="RUBY_SDK">
327
319
  <output url="file://$PROJECT_DIR$/out" />
328
320
  </component>
329
321
  <component name="ResourceManagerContainer">
@@ -586,5 +578,4 @@
586
578
  </map>
587
579
  </option>
588
580
  </component>
589
- </project>
590
-
581
+ </project>
metadata CHANGED
@@ -1,101 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rboss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ataxexe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-11 00:00:00.000000000 Z
11
+ date: 2015-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yummi
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.9.0
19
+ version: 0.9.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.9.0
26
+ version: 0.9.3
27
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
28
+ Rboss gives you a set of command line tools to use
29
+ jboss-cli wrapped by an elegant interface
30
30
  email:
31
31
  - ataxexe@gmail.com
32
32
  executables:
33
33
  - rboss-cli
34
- - rboss-profile
35
- - rboss-twiddle
36
34
  extensions: []
37
35
  extra_rdoc_files: []
38
36
  files:
39
- - .gitignore
37
+ - ".gitignore"
38
+ - ".idea/encodings.xml"
39
+ - ".idea/misc.xml"
40
+ - ".idea/modules.xml"
41
+ - ".idea/rboss.iml"
42
+ - ".idea/scopes/scope_settings.xml"
43
+ - ".idea/vcs.xml"
40
44
  - Gemfile
41
45
  - README.md
42
46
  - Rakefile
43
47
  - bin/rboss-cli
44
- - bin/rboss-profile
45
- - bin/rboss-twiddle
46
48
  - lib/rboss.rb
47
- - lib/rboss/bin/command_actions.rb
48
49
  - lib/rboss/cli/invoker.rb
49
50
  - lib/rboss/cli/mappings.rb
50
51
  - lib/rboss/cli/mappings/resources/connector.yaml
51
52
  - lib/rboss/cli/mappings/resources/datasource.yaml
52
53
  - lib/rboss/cli/mappings/resources/deployment-scanner.yaml
53
54
  - lib/rboss/cli/mappings/resources/interface.yaml
54
- - lib/rboss/cli/mappings/resources/jdbc_driver.yaml
55
+ - lib/rboss/cli/mappings/resources/jdbc-driver.yaml
56
+ - lib/rboss/cli/mappings/resources/jms-queue.yaml
57
+ - lib/rboss/cli/mappings/resources/runtime.yaml
55
58
  - lib/rboss/cli/mappings/resources/server.yaml
56
59
  - lib/rboss/cli/resource.rb
57
60
  - lib/rboss/cli/result_parser.rb
58
- - lib/rboss/component_processor.rb
59
- - lib/rboss/components/component.rb
60
- - lib/rboss/components/datasource.rb
61
- - lib/rboss/components/deploy_folder.rb
62
- - lib/rboss/components/hypersonic_replacer.rb
63
- - lib/rboss/components/jbossweb.rb
64
- - lib/rboss/components/jmx.rb
65
- - lib/rboss/components/mod_cluster.rb
66
- - lib/rboss/components/org/6.0/deploy_folder.rb
67
- - lib/rboss/components/org/jmx.rb
68
- - lib/rboss/components/profile_folder.rb
69
- - lib/rboss/components/resource.rb
70
- - lib/rboss/components/restore_slimming.rb
71
- - lib/rboss/components/run_conf.rb
72
- - lib/rboss/components/run_conf.yaml
73
- - lib/rboss/components/service_script.rb
74
- - lib/rboss/components/slimming.rb
75
- - lib/rboss/components/slimming.yaml
76
- - lib/rboss/components/soa-p/hypersonic_replacer.rb
77
- - lib/rboss/components/soa-p/jmx.rb
78
- - lib/rboss/components/xadatasource.rb
79
- - lib/rboss/file_processor.rb
80
- - lib/rboss/jboss_path.rb
81
- - lib/rboss/jboss_profile.rb
82
61
  - lib/rboss/plaftorm.rb
83
- - lib/rboss/resources/jboss_init_redhat.sh.erb
84
- - lib/rboss/resources/mod_cluster.sar/META-INF/mod_cluster-jboss-beans.xml
85
- - lib/rboss/resources/mod_cluster.sar/mod_cluster-1.1.2.Final.jar
86
- - lib/rboss/resources/run.conf.bat.erb
87
- - lib/rboss/resources/run.conf.erb
88
- - lib/rboss/twiddle.rb
89
- - lib/rboss/twiddle/base_monitor.rb
90
- - lib/rboss/twiddle/mbean.rb
91
- - lib/rboss/twiddle/monitor.rb
92
- - lib/rboss/twiddle/twiddle.rb
93
62
  - lib/rboss/utils.rb
94
63
  - lib/rboss/version.rb
95
64
  - lib/rboss/view/colorizers.rb
96
65
  - lib/rboss/view/formatters.rb
97
66
  - lib/rboss/view/health_checkers.rb
98
67
  - lib/rboss/view/table_builder.rb
68
+ - rboss-cli-bash-completion
99
69
  - rboss.gemspec
100
70
  - rboss.iml
101
71
  - rboss.ipr
@@ -108,18 +78,18 @@ require_paths:
108
78
  - lib
109
79
  required_ruby_version: !ruby/object:Gem::Requirement
110
80
  requirements:
111
- - - '>='
81
+ - - ">="
112
82
  - !ruby/object:Gem::Version
113
83
  version: '0'
114
84
  required_rubygems_version: !ruby/object:Gem::Requirement
115
85
  requirements:
116
- - - '>='
86
+ - - ">="
117
87
  - !ruby/object:Gem::Version
118
88
  version: '0'
119
89
  requirements: []
120
90
  rubyforge_project: rboss
121
- rubygems_version: 2.1.9
91
+ rubygems_version: 2.4.6
122
92
  signing_key:
123
93
  specification_version: 4
124
- summary: Manage your JBoss from your command line.
94
+ summary: Manage your JBoss from your command line
125
95
  test_files: []
@@ -1,125 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # The MIT License
4
- #
5
- # Copyright (c) 2011-2012 Marcelo Guimarães <ataxexe@gmail.com>
6
- #
7
- # Permission is hereby granted, free of charge, to any person obtaining a copy
8
- # of this software and associated documentation files (the "Software"), to deal
9
- # in the Software without restriction, including without limitation the rights
10
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- # copies of the Software, and to permit persons to whom the Software is
12
- # furnished to do so, subject to the following conditions:
13
- #
14
- # The above copyright notice and this permission notice shall be included in
15
- # all copies or substantial portions of the Software.
16
- #
17
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
- # THE SOFTWARE.
24
-
25
- require_relative '../lib/rboss'
26
- require 'optparse'
27
- require 'yaml'
28
- require 'logger'
29
-
30
- params = {}
31
- config = nil
32
- create = true
33
-
34
- opts = OptionParser::new
35
- opts.on('-j', '--jboss-home PATH', 'Defines the JBOSS_HOME variable') do |home|
36
- params[:jboss_home] = home
37
- end
38
- opts.on('-t', '--type TYPE', 'Defines the JBoss Type (org, eap, soa_p, epp)') do |type|
39
- params[:type] = type.to_sym
40
- end
41
- opts.on('-n', '--version VERSION', 'Defines the JBoss version (5, 6, 5.1, ...)') do |version|
42
- params[:version] = version
43
- end
44
- opts.on('-b', '--base-profile PROFILE', 'Defines the base profile') do |profile|
45
- params[:base_profile] = profile
46
- end
47
- opts.on('-p', '--profile PROFILE', 'Defines the custom profile') do |profile|
48
- params[:profile] = profile
49
- end
50
- opts.on('-u', '--update', 'Just update the profile folder') do
51
- create = false
52
- end
53
- opts.on('-c', '--config-file FILE', 'Defines the configuration file for the instance') do |yaml|
54
- config_file = File.expand_path(yaml)
55
- config = YAML::load File.open(config_file)
56
- config.each do |c|
57
- if c.is_a? Hash and c[:params]
58
- c.delete(:params).each do |key, value|
59
- params[key] = value
60
- end
61
- end
62
- end
63
- end
64
- opts.on("--encrypt PASSWORD", "Encrypts the given password for using with a SecureIdentityLoginModule") do |password|
65
- params[:encrypt] = password
66
- end
67
- opts.on("--slim SERVICES", "--slimming SERVICES", Array, "Slim the desired JBoss profile") do |services|
68
- params[:slimming] = services
69
- end
70
- opts.on("--restore SERVICES", Array, "Restores slimmed services in the desired JBoss profile") do |services|
71
- params[:restore] = services
72
- create = false
73
- end
74
- opts.on("--this", "Defines the current dir as the profile folder and update mode") do
75
- params[:jboss_home] = File.dirname(File.dirname(Dir.pwd))
76
- params[:profile] = Dir.pwd.split('/')[-1]
77
- create = false
78
- end
79
- opts.on('-v', '--verbose', 'Displays shell commands') do
80
- include FileUtils::Verbose
81
- params[:log_level] = Logger::DEBUG
82
- end
83
- opts.on("-h", "--help", "Shows this help message") { puts opts; exit }
84
- opts.parse!(ARGV) rescue abort 'Invalid Option! Use --help or -h for usage help.'
85
-
86
- unless $stdout.isatty
87
- require 'yummi/no_colors'
88
- end
89
-
90
- if params.empty?
91
- puts opts
92
- exit
93
- end
94
-
95
- params[:jboss_home] ||= Dir.pwd unless ENV["JBOSS_HOME"]
96
- profile = RBoss::Profile::new params
97
-
98
- if params[:slimming]
99
- profile.slim *params[:slimming]
100
- end
101
-
102
- if params[:restore]
103
- profile.add :restore, params[:restore]
104
- end
105
-
106
- if params[:encrypt]
107
- puts "Encrypted password: " + profile.jboss.encrypt(params[:encrypt])
108
- exit
109
- end
110
-
111
- if config
112
- config.each do |var|
113
- if var.is_a? Hash
114
- var.each do |key, value|
115
- key = key.gsub(/-/, '_').to_sym if key.is_a? String
116
- profile.add key, value
117
- end
118
- else
119
- profile.add var.to_sym
120
- end
121
- end
122
- end
123
-
124
- profile.create if create
125
- profile.update unless create