torquecheck 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,17 @@
1
+ # Copyright 2011 Lance Ball
2
+ #
3
+ # This is free software; you can redistribute it and/or modify it
4
+ # under the terms of the GNU Lesser General Public License as
5
+ # published by the Free Software Foundation; either version 2.1 of
6
+ # the License, or (at your option) any later version.
7
+ #
8
+ # This software is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this software; if not, write to the Free
15
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
16
+ # 02110-1301 USA, or see the FSF site: http://www.fsf.org.
17
+
data/README ADDED
@@ -0,0 +1,6 @@
1
+
2
+ Simple utility that will display your TorqueBox environment and such.
3
+
4
+ Usage:
5
+ $ gem install torquecheck
6
+ $ torquecheck
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Copyright 2011 Lance Ball
4
+ #
5
+ # This is free software; you can redistribute it and/or modify it
6
+ # under the terms of the GNU Lesser General Public License as
7
+ # published by the Free Software Foundation; either version 2.1 of
8
+ # the License, or (at your option) any later version.
9
+ #
10
+ # This software is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ # Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public
16
+ # License along with this software; if not, write to the Free
17
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18
+ # 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19
+
20
+ require 'rubygems'
21
+
22
+ require 'torquebox/gem'
23
+ require 'torquebox/ruby'
24
+ require 'torquebox/server'
25
+ require 'torquebox/bundler'
26
+ require 'torquebox/environment'
27
+
28
+ puts ">>>>> Environment <<<<<<"
29
+ TorqueBox::Environment.display
30
+ puts
31
+ puts ">>>>> Ruby <<<<<<"
32
+ TorqueBox::Ruby.display
33
+ puts
34
+ puts ">>>>> TorqueBox Server <<<<<<"
35
+ TorqueBox::Server.new.display
36
+ puts
37
+ puts ">>>>> Gems <<<<<<"
38
+ TorqueBox::Gem.display
39
+ puts
40
+ puts ">>>>> Bundler <<<<<<"
41
+ TorqueBox::Bundler.display
42
+ puts
43
+
44
+
@@ -0,0 +1,58 @@
1
+ # Copyright 2011 Lance Ball
2
+ #
3
+ # This is free software; you can redistribute it and/or modify it
4
+ # under the terms of the GNU Lesser General Public License as
5
+ # published by the Free Software Foundation; either version 2.1 of
6
+ # the License, or (at your option) any later version.
7
+ #
8
+ # This software is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this software; if not, write to the Free
15
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
16
+ # 02110-1301 USA, or see the FSF site: http://www.fsf.org.
17
+
18
+
19
+ module TorqueBox
20
+ class Bundler
21
+ def self.display
22
+ begin
23
+ require 'bundler/setup'
24
+ require 'bundler/version'
25
+ require 'bundler/cli'
26
+ require 'bundler'
27
+ print_basics
28
+ print_bundle
29
+ rescue SystemExit
30
+ # Fucking bundler
31
+ rescue Exception => e
32
+ puts "Bundler not installed: #{e}"
33
+ end
34
+ end
35
+
36
+ private
37
+ def self.print_basics
38
+ puts "Version: #{::Bundler::VERSION}"
39
+ end
40
+
41
+ def self.print_bundle
42
+ begin
43
+ puts "Bundle path: #{::Bundler.bundle_path}"
44
+ ::Bundler::CLI.new
45
+ puts "Bundler settings: "
46
+ ::Bundler.settings.all.each do |setting|
47
+ puts " #{setting}"
48
+ ::Bundler.settings.pretty_values_for(setting).each do |line|
49
+ puts " #{line}"
50
+ end
51
+ end
52
+ rescue ::Bundler::GemfileNotFound => e
53
+ puts "#{Dir.pwd} does not contain a Gemfile."
54
+ end
55
+ end
56
+ end
57
+ end
58
+
@@ -0,0 +1,28 @@
1
+ # Copyright 2011 Lance Ball
2
+ #
3
+ # This is free software; you can redistribute it and/or modify it
4
+ # under the terms of the GNU Lesser General Public License as
5
+ # published by the Free Software Foundation; either version 2.1 of
6
+ # the License, or (at your option) any later version.
7
+ #
8
+ # This software is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this software; if not, write to the Free
15
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
16
+ # 02110-1301 USA, or see the FSF site: http://www.fsf.org.
17
+
18
+ module TorqueBox
19
+ class Environment
20
+
21
+ def self.display
22
+ puts " TORQUEBOX_HOME: #{ENV['TORQUEBOX_HOME']}"
23
+ puts " JRUBY_HOME: #{ENV['JRUBY_HOME']}"
24
+ puts " JBOSS_HOME: #{ENV['JBOSS_HOME']}"
25
+ end
26
+
27
+ end
28
+ end
@@ -0,0 +1,55 @@
1
+ # Copyright 2011 Lance Ball
2
+ #
3
+ # This is free software; you can redistribute it and/or modify it
4
+ # under the terms of the GNU Lesser General Public License as
5
+ # published by the Free Software Foundation; either version 2.1 of
6
+ # the License, or (at your option) any later version.
7
+ #
8
+ # This software is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this software; if not, write to the Free
15
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
16
+ # 02110-1301 USA, or see the FSF site: http://www.fsf.org.
17
+
18
+
19
+ module TorqueBox
20
+ class Gem
21
+ def self.display
22
+ print_basics
23
+ print_gem_paths
24
+ print_gem_config
25
+ end
26
+
27
+ private
28
+ def self.print_gem_paths
29
+ puts "Gem Paths: "
30
+ path = ::Gem.path.dup
31
+ path.delete ::Gem.dir
32
+ path.each do |p|
33
+ puts "- #{p}\n"
34
+ end
35
+ end
36
+
37
+ def self.print_gem_config
38
+ puts "Gem Configuration:\n"
39
+ ::Gem.configuration.each do |name, value|
40
+ value = value.gsub(/./, '*') if name == 'gemcutter_key'
41
+ puts " #{name.inspect} => #{value.inspect}\n"
42
+ end
43
+ puts "Remote Sources:\n"
44
+ ::Gem.sources.each do |s|
45
+ puts " #{s}\n"
46
+ end
47
+ end
48
+
49
+ def self.print_basics
50
+ puts "Version: #{::Gem::VERSION}"
51
+ puts "Platform: #{::Gem::Platform.local.to_s}"
52
+ end
53
+ end
54
+ end
55
+
@@ -0,0 +1,28 @@
1
+ # Copyright 2011 Lance Ball
2
+ #
3
+ # This is free software; you can redistribute it and/or modify it
4
+ # under the terms of the GNU Lesser General Public License as
5
+ # published by the Free Software Foundation; either version 2.1 of
6
+ # the License, or (at your option) any later version.
7
+ #
8
+ # This software is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this software; if not, write to the Free
15
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
16
+ # 02110-1301 USA, or see the FSF site: http://www.fsf.org.
17
+
18
+ module TorqueBox
19
+ class Ruby
20
+
21
+ def self.display
22
+ puts "Version: #{RUBY_VERSION}"
23
+ puts "Platform: #{RUBY_PLATFORM}"
24
+ end
25
+
26
+ end
27
+ end
28
+
@@ -0,0 +1,78 @@
1
+ # Copyright 2011 Lance Ball
2
+ #
3
+ # This is free software; you can redistribute it and/or modify it
4
+ # under the terms of the GNU Lesser General Public License as
5
+ # published by the Free Software Foundation; either version 2.1 of
6
+ # the License, or (at your option) any later version.
7
+ #
8
+ # This software is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this software; if not, write to the Free
15
+ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
16
+ # 02110-1301 USA, or see the FSF site: http://www.fsf.org.
17
+
18
+ module TorqueBox
19
+ class Server
20
+
21
+ attr_reader :server
22
+
23
+ def initialize
24
+ @server = server_gem_path
25
+ end
26
+
27
+ def display
28
+ print_server_gem
29
+ print_installed_apps
30
+ rescue Exception => e
31
+ puts "Exception caught: #{e}"
32
+ end
33
+
34
+ def print_server_gem
35
+ puts "torquebox-server gem:"
36
+ if server
37
+ puts " Installed in #{server}"
38
+ else
39
+ puts " Not installed"
40
+ end
41
+ end
42
+
43
+ def print_installed_apps
44
+ if home
45
+ puts "TorqueBox applications installed in #{home}:"
46
+ deploy_dir = File.join( home, "jboss", "standalone", "deployments" )
47
+ if File.exists? deploy_dir
48
+ Dir.glob File.join(deploy_dir, "*.yml") do |f|
49
+ puts " " + File.basename( f ).gsub( /\.yml/, '' )
50
+ end
51
+ else
52
+ puts " Cannot find TorqueBox deployment directory #{deploy_dir}"
53
+ end
54
+ else
55
+ puts " Can't find TorqueBox!"
56
+ end
57
+ end
58
+
59
+ def home
60
+ server || ENV['TORQUEBOX_HOME']
61
+ end
62
+
63
+ private
64
+ def server_gem_path
65
+ if ((::Gem::Version.new(::Gem::VERSION) <=> ::Gem::Version.new('1.8.9')) < 0)
66
+ puts "[WARNING] Found rubygems version #{::Gem::VERSION}. This probably means you are on JRuby 1.6.4. While JRuby 1.6.4 should work, TorqueBox is tested on and ships with JRuby 1.6.5."
67
+ home = ::Gem.searcher.find( 'torquebox-server' )
68
+ else
69
+ begin
70
+ home = ::Gem::Specification.find_by_name( 'torquebox-server' )
71
+ rescue ::Gem::LoadError
72
+ end
73
+ end
74
+ home.full_gem_path if home
75
+ end
76
+ end
77
+ end
78
+
metadata ADDED
@@ -0,0 +1,64 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: torquecheck
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.1.2
6
+ platform: ruby
7
+ authors:
8
+ - Lance Ball
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-11-23 00:00:00 -05:00
14
+ default_executable: torquecheck
15
+ dependencies: []
16
+
17
+ description: TorqueCheck - A utility for displaying information about your TorqueBox installation.
18
+ email: lball@redhat.com
19
+ executables:
20
+ - torquecheck
21
+ extensions: []
22
+
23
+ extra_rdoc_files:
24
+ - LICENSE
25
+ - README
26
+ files:
27
+ - LICENSE
28
+ - README
29
+ - lib/torquebox/bundler.rb
30
+ - lib/torquebox/environment.rb
31
+ - lib/torquebox/gem.rb
32
+ - lib/torquebox/ruby.rb
33
+ - lib/torquebox/server.rb
34
+ - bin/torquecheck
35
+ has_rdoc: true
36
+ homepage: http://github.com/lance/torquecheck
37
+ licenses:
38
+ - GNU LPGL
39
+ post_install_message:
40
+ rdoc_options: []
41
+
42
+ require_paths:
43
+ - lib
44
+ required_ruby_version: !ruby/object:Gem::Requirement
45
+ none: false
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: "0"
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: "0"
56
+ requirements: []
57
+
58
+ rubyforge_project:
59
+ rubygems_version: 1.5.1
60
+ signing_key:
61
+ specification_version: 3
62
+ summary: A utility for displaying information about your TorqueBox installation.
63
+ test_files: []
64
+