This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create queue | |
Padrino.after_load do | |
# | |
# Create message queues | |
## | |
TorqueBox::Messaging::Queue.start '/queues/metrics/scripttiming' | |
p '/queues/metrics/scripttiming queue started in Padrino.' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ciaran-Archers-MacBook-Pro:roman-numerals carcher$ jasmine-node spec --coffee | |
F | |
Failures: | |
1) TestClass should be created | |
Message: | |
TypeError: object is not a function | |
Stacktrace: | |
TypeError: object is not a function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Warden::Manager.before_failure do |env, opts| | |
# Sinatra/Padrino is very sensitive to the request method and | |
# since authentication could fail on any type of method, we need | |
# to set it for the failure app so it is routed to the correct block. | |
env['REQUEST_METHOD'] = "POST" | |
end | |
Warden::Strategies.add(:basic_http) do | |
def valid? | |
# Check if valid and store an instance var |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\dev\torquebox\backstage>echo %JRUBY_OPTS% | |
--1.9 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
req = Request.new(params) | |
req.validate_params_as do |conditions| | |
conditions[:scriptingtimingid] = :numeric | |
conditions[:script_name] = :string | |
conditions[:completed_on] = :time | |
end | |
req.validate? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@responder.respond do |r| | |
r.do_something | |
@responder.bad_request! # using @responder in it's own block, is this frowned upon? | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>>>> Environment <<<<<< | |
TORQUEBOX_HOME: C:\dev\torquebox\torquebox-2.x | |
JRUBY_HOME: C:\dev\torquebox\torquebox-2.x\jruby | |
JBOSS_HOME: C:\dev\torquebox\torquebox-2.x\jboss | |
>>>>> Ruby <<<<<< | |
Version: 1.9.2 | |
Platform: java | |
>>>>> TorqueBox Server <<<<<< |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
profile_data = JRuby::Profiler.profile do | |
results = SIA::SIAModels::Client.get_all | |
results.each do |c| | |
puts "#{c[:clientid]} #{c[:firstname]} #{c[:status]} #{c[:customersince]} #{c[:emailactive]}" | |
end | |
end | |
profile_printer = JRuby::Profiler::GraphProfilePrinter.new(profile_data) | |
profile_printer.printProfile(STDOUT) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Client < DatabaseSIA | |
# set a non-defualt primary key | |
set_primary_key :clientid | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "singleton" | |
module SIA | |
# Singleton class to enable database access for those occasions where a model will just not do. | |
# @author Ciaran Archer | |
class Database | |
include Singleton | |
@databases = nil | |
# Setup database connections with configuration file. |