Permalink
Browse files

Use more modern gem versions.

  • Loading branch information...
1 parent 60d64c9 commit 0886bf477d4afc1ba43f52ba926a14faa6482071 @tobias tobias committed Nov 26, 2013
Showing with 14 additions and 18 deletions.
  1. +2 −3 Gemfile
  2. +5 −8 lib/helpers.rb
  3. +5 −5 views/layout.haml
  4. +1 −1 views/logs/show.haml
  5. +1 −1 views/pools/show.haml
View
@@ -1,12 +1,11 @@
source 'https://rubygems.org'
-gem "sinatra", "1.2.6"
+gem "sinatra", "1.4.4"
gem 'haml', '~>3.0'
gem 'sass', '~>3.0'
gem "jmx", '0.9'
-gem 'json', '1.5.1'
+gem 'json', '1.8.1'
gem 'torquebox', '>= 2.0', "< 5.0"
-gem 'tobias-sinatra-url-for', '0.2.1'
gem 'rack-accept', '~>0.4.0'
gem 'torquebox-webconsole', '0.1.1'
View
@@ -16,7 +16,6 @@
require 'logger'
require 'util'
require 'authentication'
-require 'sinatra/url_for'
module Backstage
def self.jboss_log_dir
@@ -46,11 +45,9 @@ class Application < Sinatra::Base
helpers do
include Backstage::Authentication
- include Sinatra::UrlForHelper
- def json_url_for(fragment, options = { })
- options[:format] = 'json'
- url_for( fragment, :full, options )
+ def json_url_for(fragment)
+ url(fragment) + "?format=json"
end
def object_path(object)
@@ -71,11 +68,11 @@ def object_action_or_collection_path(*objects)
alias_method :collection_path, :object_action_or_collection_path
def redirect_to(location)
- redirect url_for(location, :full)
+ redirect url(location)
end
def link_to(path, text, options = {})
- "<a href='#{url_for path}' class='#{options[:class]}'>#{text}</a>"
+ "<a href='#{url path}' class='#{options[:class]}'>#{text}</a>"
end
def paginate(total, limit = 100)
@@ -134,7 +131,7 @@ def class_for_body
def action_button(object, action, text=nil)
text ||= action.capitalize
accum = <<-EOF
-<form method="post" action="#{url_for object_action_path(object, action)}">
+<form method="post" action="#{url object_action_path(object, action)}">
<input type="submit" value="#{text}"/>
</form>
EOF
View
@@ -1,11 +1,11 @@
!!!
%html
%title TorqueBox::BackStage
- %link{:rel=>"stylesheet", :type=>"text/css", :href=>url_for('/css/html5reset.css')}
- %link{:rel=>"stylesheet", :type=>"text/css", :href=>url_for('/css/style.css')}
- %link{:rel=>"shortcut icon", :type=>"image/png", :href=>url_for('/favicon.png')}
- %script{:type=>"text/javascript", :src=> url_for('/jquery.min.js')}
- %script{:type=>"text/javascript", :src=> url_for('/app.js')}
+ %link{:rel=>"stylesheet", :type=>"text/css", :href=>url('/css/html5reset.css')}
+ %link{:rel=>"stylesheet", :type=>"text/css", :href=>url('/css/style.css')}
+ %link{:rel=>"shortcut icon", :type=>"image/png", :href=>url('/favicon.png')}
+ %script{:type=>"text/javascript", :src=> url('/jquery.min.js')}
+ %script{:type=>"text/javascript", :src=> url('/app.js')}
%body{:class => class_for_body}
#header
%h1 TorqueBox::Backstage
@@ -6,7 +6,7 @@
#log
#ajax-spinner{:style => 'display: none'}
- %img{:src => url_for('/ajax-loader.gif')}
+ %img{:src => url('/ajax-loader.gif')}
%pre#log_output
Fetching log...
@@ -18,7 +18,7 @@
:javascript
function evaluate_remote() {
$.post(
- '#{url_for( object_action_path( @object, :evaluate ) )}',
+ '#{url( object_action_path( @object, :evaluate ) )}',
$('#script_form').serialize(),
function( response ) {
result = response.result

0 comments on commit 0886bf4

Please sign in to comment.