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
# Always rollback transactions for all databases | |
RSpec.configure do |c| | |
c.around(:each) do |example| | |
Sequel.transaction(SIASquirrel.databases.values, :rollback=>:always) { example.run } | |
end | |
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
module MyPrinter | |
def self.print(str, times=1) | |
p ((str + ' ') * times).strip | |
end | |
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
module X | |
VERSION = '0.0.1' | |
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
# -*- encoding: utf-8 -*- | |
$:.push File.expand_path("../lib", __FILE__) | |
require "sia_squirrel/version" | |
Gem::Specification.new do |s| | |
s.name = "x" | |
s.version = X::VERSION | |
s.authors = ["Ciaran Archer"] | |
s.email = ["[email protected]"] | |
s.homepage = "http://x.x.com" |
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
13:49:17,411 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "hermes-knob.yml" | |
13:49:17,442 INFO [org.torquebox.core] (MSC service thread 1-1) evaling: C:\dev\repos\hermes\torquebox.rb | |
13:49:17,442 ERROR [org.torquebox.core.runtime] (MSC service thread 1-1) Error during evaluation: require 'rubygems' | |
require 'torquebox-configure' | |
TorqueBox::Configuration::GlobalConfiguration.load_configuration( %q{C:\dev\repos\hermes\torquebox.rb} ).to_java: org.jruby.exceptions.RaiseException: (LoadError) Could not find blankslate (= 2.1.2.4) amongst [bundler-1.1.4, bundler-1.1.3, rake-0.9.2.2, rake-0.8.7, torquebox-2.0.3, torquebox-backstage-1.0.3, torquebox-cache-2.0.3-java, torquebox-capistrano-support-2.0.3, torquebox-configure-2.0.3-java, torquebox-core-2.0.3-java, torquebox-messaging-2.0.3-java, torquebox-naming-2.0.3-java, torquebox-no-op-2.0.3, torquebox-rake-support-2.0.3, torquebox-security-2.0.3-java, torquebox-stomp-2.0.3, torquebox-transactions-2.0.3, torquebox |
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
module Minesweeper | |
class Game | |
attr_reader :fields | |
def initialize | |
@fields = [] | |
@allow_input = true |
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
## | |
# This is the ugly work-around for working with gems from local source. | |
# Comment in as required, and then run 'bundle update'. | |
### | |
# gem 'sia_squirrel', :path => 'c:/dev/repos/gems/sia_squirrel', :require => 'sia_squirrel' | |
# gem 'sia_beaver', :path => 'c:/dev/repos/gems/sia_beaver', :require => 'sia_beaver' | |
# gem 'sia_crypto', :path => 'c:/dev/repos/gems/sia_crypto', :require => 'sia_crypto' | |
gem 'sia_squirrel' | |
gem 'sia_beaver' | |
gem 'sia_crypto' |
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 Grid | |
attr_accessor :values | |
def initialize(dimension) | |
@values = [] | |
(1..dimension).each do |i| | |
@values << (1..dimension).map{ ('A'..'Z').to_a[rand(26)] } | |
end | |
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
# code | |
queue = TorqueBox::Messaging::Queue.new('/queues/metrics/script_timing') | |
p params | |
p params.class | |
queue.publish params | |
# output | |
08:35:06,177 INFO [stdout] (http--127.0.0.1-8080-1) {"scriptname"=>"test", "server"=>"1"} | |
08:35:06,178 INFO [stdout] (http--127.0.0.1-8080-1) Hash |
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 ScriptTimingMsgProcessor < TorqueBox::Messaging::MessageProcessor | |
p "ScriptTimingMsgProcessor class loaded" | |
def on_message(body) | |
# The body will be of whatever type was published by the Producer | |
# the entire JMS message is available as a member variable called message() | |
p 'ScriptTimingMsgProcessor::on_message() called with ' + body.to_s | |
end | |
def on_error(exception) |