torquebox-backstage 1.0.4 → 1.0.5

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/VERSION CHANGED
@@ -1,3 +1,3 @@
1
- 1.0.4
1
+ 1.0.5
2
2
 
3
3
 
data/backstage.rb CHANGED
@@ -46,7 +46,11 @@ module Backstage
46
46
  TORQUEBOX_VERSION = File.readlines( File.join( File.dirname( __FILE__ ), 'TORQUEBOX_VERSION' ) ).first.strip
47
47
 
48
48
  class Application < Sinatra::Base
49
- use TorqueBox::Session::ServletStore
49
+ if ENV['TORQUEBOX_APP_NAME']
50
+ use TorqueBox::Session::ServletStore
51
+ else
52
+ enable :sessions
53
+ end
50
54
  use Rack::Accept
51
55
  use Rack::CommonLogger, Backstage.logger
52
56
  use Rack::Webconsole
@@ -40,6 +40,11 @@ module Backstage
40
40
  :view]
41
41
  end
42
42
 
43
+ # this shadows Object#open
44
+ def open
45
+ mbean[:open]
46
+ end
47
+
43
48
  def protocols
44
49
  mbean = JMX::MBeanServer.new
45
50
  cluster = self.cluster_name
data/lib/has_mbean.rb CHANGED
@@ -38,6 +38,14 @@ module Backstage
38
38
  end
39
39
 
40
40
  def method_missing(method, *args, &block)
41
+ if args.length == 0
42
+ # see if it is an attribute first
43
+ begin
44
+ return mbean[method.to_s.camelize]
45
+ rescue Exception => e
46
+ # it must not be an attribute, fall through
47
+ end
48
+ end
41
49
  mbean.send( method, *args, &block )
42
50
  rescue NoMethodError => ex
43
51
  super
data/lib/helpers.rb CHANGED
@@ -253,13 +253,19 @@ class Object
253
253
  end
254
254
 
255
255
  class String
256
+ def camelize
257
+ if self =~ %r{_}
258
+ split( '_' ).collect( &:capitalize ).join( '' )
259
+ else
260
+ capitalize
261
+ end
262
+ end
263
+
256
264
  def classify
257
265
  if self =~ %r{/}
258
- split( '/' ).collect( &:classify ).join( '::' )
259
- elsif self =~ %r{_}
260
- split( '_' ).collect( &:classify ).join( '' )
266
+ split( '/' ).collect( &:camelize ).join( '::' )
261
267
  else
262
- capitalize
268
+ camelize
263
269
  end
264
270
  end
265
271
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: torquebox-backstage
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.4
5
+ version: 1.0.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Tobias Crawley
@@ -12,7 +12,7 @@ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
 
15
- date: 2012-07-02 00:00:00 Z
15
+ date: 2012-07-03 00:00:00 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: sinatra