torquebox-backstage 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/backstage.rb +5 -1
- data/lib/groups/models/group.rb +5 -0
- data/lib/has_mbean.rb +8 -0
- data/lib/helpers.rb +10 -4
- metadata +2 -2
data/VERSION
CHANGED
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
|
-
|
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
|
data/lib/groups/models/group.rb
CHANGED
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( &:
|
259
|
-
elsif self =~ %r{_}
|
260
|
-
split( '_' ).collect( &:classify ).join( '' )
|
266
|
+
split( '/' ).collect( &:camelize ).join( '::' )
|
261
267
|
else
|
262
|
-
|
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.
|
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-
|
15
|
+
date: 2012-07-03 00:00:00 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: sinatra
|