Skip to content

Instantly share code, notes, and snippets.

@rurounijones
rurounijones / Committee.rb
Created June 7, 2009 07:35 — forked from be9/acl9_query_by_role.rb
Using method_missing to dynamically create subject listing for objects based on role
class DynamicFinderMatch
attr_accessor :attribute
def initialize(method_sym)
if Role.all(:select => 'name').map{|n| n.name.pluralize}.include?(method_sym.to_s)
@attribute = method_sym
end
end
def match?
@attribute != nil
@rurounijones
rurounijones / rcov.rake
Created March 2, 2011 02:29
Rcov rake files
begin
require 'cucumber/rake/task'
require 'rspec/rails'
require 'rspec/core/rake_task'
desc 'Run both specs and features to generate aggregated coverage'
task :rcov => 'rcov:all'
namespace :rcov do
def rcov_opts
@rurounijones
rurounijones / exam_group.rb
Created May 14, 2011 15:56 — forked from kracekumar/exam_group.rb
exam_group_error
Exam Columns (0.7ms) SHOW FIELDS FROM `exams`
Subject Load (0.1ms) SELECT * FROM `subjects` WHERE (`subjects`.`id` = 11 AND (`subjects`.`is_deleted` = 0))
ActionView::TemplateError (undefined method `_delete' for #<Exam:0xb6c53be8>) on line #69 of app/views/exam/_exam_marks_form.rhtml:
66: <td class="col-1">
67: <div class="label-field-pair2">
68: <div class="text-input-bg2">
69: <%= exam_form.check_box :_delete %>
70: </div>
71: </div>
$ ruby test.rb
Parent (after_initialize):
Parent (Outside object): #<Template:0x7f91a16d3078>
source 'http://rubygems.org'
gem 'rails', '3.1.0.rc1'
# General Purpose gems
gem 'dragonfly', '~>0.9.2'
gem 'rack-cache', :require => 'rack/cache'
gem 'nokogiri', '~>1.5.0.beta.4'
# Torquebox related gems
2011-07-11 09:50:31,258 WARN [org.hornetq.core.server.impl.QueueImpl] (Thread-18 (group:HornetQ-server-threads1709454628-1591635196)) removing consumer which did not handle a message, consumer=org.hornetq.core.server.cluster.impl.BridgeImpl@567df41c, message=Reference[6442452614]:RELIABLE: java.lang.NullPointerException
at org.hornetq.core.buffers.impl.ResetLimitWrappedHornetQBuffer.<init>(ResetLimitWrappedHornetQBuffer.java:39) [:6.0.0.Final]
at org.hornetq.core.message.impl.MessageImpl.getBodyBuffer(MessageImpl.java:254) [:6.0.0.Final]
at org.hornetq.core.client.impl.ClientProducerImpl.doSend(ClientProducerImpl.java:220) [:6.0.0.Final]
at org.hornetq.core.client.impl.ClientProducerImpl.send(ClientProducerImpl.java:139) [:6.0.0.Final]
at org.hornetq.core.server.cluster.impl.BridgeImpl.handle(BridgeImpl.java:477) [:6.0.0.Final]
at org.hornetq.core.server.impl.QueueImpl.handle(QueueImpl.java:1384) [:6.0.0.Final]
at org.hornetq.core.server.impl.QueueImpl.deliver(QueueImpl.java:1175) [:6.0.0.Final]
at o
-rw-r--r-- 1 jjones jjones 45812 2011-08-24 10:05 jmupdf.jar
-rw-r--r-- 1 jjones jjones 6912164 2011-08-24 10:05 libjmupdf32.so
-rw-r--r-- 1 jjones jjones 7150456 2011-08-24 10:16 libjmupdf64.so
-rw-r--r-- 1 jjones jjones 2006604 2011-08-18 13:55 test.pdf
-rw-r--r-- 1 jjones jjones 479 2011-10-31 15:38 test.rb
Aug 31 13:27:02 app-web-1 rails-app-uat[24064]: Started GET "/test/" for 10.80.89.170 at Wed Aug 31 13:27:02 +0900 2011
Aug 31 13:27:02 app-web-1 rails-app-uat[24064]: ActionController::RoutingError (No route matches "/test"):
@rurounijones
rurounijones / gist:1216078
Created September 14, 2011 08:09
Stack Trace
ThreadError - thread 0x7f68fa5a6a30 tried to join itself:
/home/jjones/.rvm/gems/ruby-1.8.7-p352@onionapp/gems/rack-1.3.2/lib/rack/lock.rb:14:in `lock'
/home/jjones/.rvm/gems/ruby-1.8.7-p352@onionapp/gems/rack-1.3.2/lib/rack/lock.rb:14:in `call'
/home/jjones/.rvm/gems/ruby-1.8.7-p352@onionapp/gems/sinatra-1.2.6/lib/sinatra/base.rb:689:in `forward'
/home/jjones/.rvm/gems/ruby-1.8.7-p352@onionapp/gems/sinatra-1.2.6/lib/sinatra/base.rb:772:in `route_missing'
/home/jjones/.rvm/gems/ruby-1.8.7-p352@onionapp/gems/sinatra-1.2.6/lib/sinatra/base.rb:719:in `route!'
/home/jjones/.rvm/gems/ruby-1.8.7-p352@onionapp/gems/sinatra-1.2.6/lib/sinatra/base.rb:715:in `route!'
/home/jjones/.rvm/gems/ruby-1.8.7-p352@onionapp/gems/sinatra-1.2.6/lib/sinatra/base.rb:843:in `dispatch!'
/home/jjones/.rvm/gems/ruby-1.8.7-p352@onionapp/gems/sinatra-1.2.6/lib/sinatra/base.rb:644:in `call!'
/home/jjones/.rvm/gems/ruby-1.8.7-p352@onionapp/gems/sinatra-1.2.6/lib/sinatra/base.rb:808:in `instance_eval'
1)
'DatabaseCleaner::Base autodetect should raise an error when no ORM is detected' FAILED
expected DatabaseCleaner::NoORMDetected but nothing was raised
/home/jjones/.rvm/gems/ruby-1.8.7-p352@database_cleaner/gems/rspec-1.3.0/lib/spec/expectations/fail_with.rb:41:in `fail_with'
/home/jjones/.rvm/gems/ruby-1.8.7-p352@database_cleaner/gems/rspec-1.3.0/lib/spec/expectations/handler.rb:21:in `handle_matcher'
/home/jjones/.rvm/gems/ruby-1.8.7-p352@database_cleaner/gems/rspec-1.3.0/lib/spec/expectations/extensions/kernel.rb:27:in `should'
./spec/database_cleaner/base_spec.rb:51:
/home/jjones/.rvm/gems/ruby-1.8.7-p352@database_cleaner/gems/rspec-1.3.0/lib/spec/example/example_methods.rb:40:in `instance_eval'
/home/jjones/.rvm/gems/ruby-1.8.7-p352@database_cleaner/gems/rspec-1.3.0/lib/spec/example/example_methods.rb:40:in `execute'
/home/jjones/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/timeout.rb:53:i