Skip to content

Instantly share code, notes, and snippets.

View methodmissing's full-sized avatar

Lourens Naudé methodmissing

View GitHub Profile
class RouteFilter
class << self
def routes
ActionController::Routing::Routes.routes
end
def controllers
::Object.subclasses_of( ::ActionController::Base )
# Delivers a TMail::Mail object. By default, it delivers the cached mail
# object (from the <tt>create!</tt> method). If no cached mail object exists, and
# no alternate has been given as the parameter, this will fail.
def deliver!(mail = @mail)
raise "no mail object available for delivery!" unless mail
unless logger.nil?
logger.info "Sent mail to #{Array(recipients).join(', ')}"
logger.debug "\n#{mail.encoded}"
end
ExceptionNotifier.exception_recipients = %w([email protected])
ExceptionNotifier.class_eval do
remove_method :template_root
ExceptionNotifier.template_root = "#{RAILS_ROOT}/vendor/plugins/exception_notification/lib/../views"
end
assert_raise(FiberError){
Fiber.yield
}
# Returns the path to the rails/init.rb file for the given extension,
# or nil if no gem provides it.
def init_path_for_extension(extension)
return if extension.blank?
return unless spec = Gem.searcher.find(extension.to_s)
returning File.join(spec.full_gem_path, 'rails', 'init.rb') do |path|
return unless File.file?(path)
end
end
diff --git a/lib/query_memcached.rb b/lib/query_memcached.rb
index c911388..715c47d 100644
--- a/lib/query_memcached.rb
+++ b/lib/query_memcached.rb
@@ -88,6 +88,7 @@ module ActiveRecord
end
+if ActiveRecord::ConnectionAdapters.const_defined?( 'PostgreSQLAdapter' )
class PostgreSQLAdapter < AbstractAdapter
module Technoweenie
module AttachmentFu
module InstanceMethods
def self.included( base )
base.define_callbacks *[:after_resize, :after_attachment_saved, :before_thumbnail_saved]
end
def callback_with_args(method, arg = self)
lourens$ sudo gem install caffeine
Building native extensions. This could take a while...
caffeine.c: In function 'key_from_segments':
caffeine.c:712: warning: incompatible implicit declaration of built-in function 'mempcpy'
caffeine.c: In function 'md5_digest':
caffeine.c:872: warning: pointer targets in passing argument 1 of 'MD5' differ in signedness
/usr/bin/ld: warning multiple definitions of symbol _setregid
/opt/local/lib/libruby.dylib(process.o) definition of _setregid
/usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../libpthread.dylib(setregid.So) definition of _setregid
/usr/bin/ld: warning multiple definitions of symbol _setreuid
libmemcache-1.4.0.rc2 lourens$ ./configure && make && make install
e2fsprogs-1.39 lourens$ cd lib/uuid
e2fsprogs-1.39 lourens$ make && sudo make install