This file contains 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 EnumThing | |
def categories | |
@categories ||= connection.execute("SELECT category FROM #{table_name} GROUP BY category").collect{|r|r[0]} | |
end | |
include InstanceMethods | |
module InstanceMethod | |
def categories | |
self.class.categories | |
end |
This file contains 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
# FUCK NO | |
class Person | |
include Mongoid::Document | |
field :athing, :type => String, :default => "Something" | |
validates_format_of :athing, :with => /[A-Za-z]/ | |
end | |
# HELL YES | |
class Person |
This file contains 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
# HELL NO | |
defaults: &defaults | |
adapter: mongo | |
host: localhost | |
development: | |
<<: *defaults | |
database: fanboy_dev | |
production: |
This file contains 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
# Can I get a "HELL YEAH?" | |
Mongoid.environments do | |
environment :development do | |
adapter :mongo | |
host :localhost | |
database :fanboy_dev | |
end | |
environment :production do | |
adapter :mongo |
This file contains 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
# Can I get a "FUCK YEAH?" | |
Mongoid.environments do | |
@defaults = {:adapter => :mongo, :host => :localhost} | |
environment :development do | |
self.settings.merge!(@defaults) | |
database :fanboy_dev | |
end | |
environment :production do |
This file contains 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 'openssl' | |
module AESCrypt | |
# Decrypts a block of data (encrypted_data) given an encryption key | |
# and an initialization vector (iv). Keys, iv's, and the data | |
# returned are all binary strings. Cipher_type should be | |
# "AES-256-CBC", "AES-256-ECB", or any of the cipher types | |
# supported by OpenSSL. Pass nil for the iv if the encryption type | |
# doesn't use iv's (like ECB). | |
#:return: => String |
This file contains 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 DataMapper | |
module Adapters | |
class RedisAdapter < AbstractAdapter | |
def find_matches(query, operand) | |
@redis.smembers("#{query.model.to_s.downcase}:#{operand.subject.name}:#{encode(operand.value)}").collect{|k| k.gsub(/\[|\]/, "")} | |
end | |
end | |
end | |
end |
This file contains 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
ssssoooosmMMNmmhdhhys+/+oosyyyyyyyssssssssssssoooooooooooooooo+++++++++++++++++++++++++++++///////// | |
ssssooooomMNmddddhdhhyo+++oossssyyssssssssssssoooooooooooooooo+++++++++++++++++++++++++++++///////// | |
ssssooooomMNmmmmhysyhhhyso+oooooossssssssssssoooooooooooooo+o++++++++++++++++++++++++++++++///////// | |
ssssooooodMMNmddhdddhhyyysssoooo++ossssssssssoooooooooooooooo++++++++++++++++++++++++++++/////////// | |
sssoooooohMMNNmmmdhysshyyhysyso+oo+oyssssssssssosssooooooooo+o+++++++++++++++++++++++++///////////// | |
sssooooosyMMMNddysssssyysyyhydhyosssyyyyyhhhyyhyyhyhsssosoooooo++++++++++++++++++++++++++++ooossssso | |
sssoooosssNMMMMNmdhhyyysyhdmNdmmhssyyyyyhhhhhdhhhhyyyssysssysssooooo++++++++oooooossssyhddmdhhyssooo | |
ssssosossyNMMMMMNdyyhhhdmNMMMMmNmhssddhyhhhdhhhhhhyyyoosyyysyyyyyyyssssssyhdmmmmNNNNmmdhyysooosssso+ | |
yyyssssssyNMMMMNmmdmmNNNMMMMMMMmNmdhmmdhhhyhyyhhdhyhs++ssyyssyyyhddhmmddmmNNNMNNNdhhsssssyyyyyssooo+ | |
yyyyyysyyhMMMMMMMNNNNNMMMMMMMMMNdmNNNmdhdhyhyhhdhdyhys+osysssssyhdmmmmdmNmmdddhhhhhhyhyyyhhyyysooso+ |
This file contains 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
/Users/epeterson/.rvm/rubies/ruby-1.9.2-p290/bin/ruby vm/codegen/field_extract.rb vm/builtin/basicobject.hpp vm/builtin/object.hpp vm/builtin/integer.hpp vm/builtin/fixnum.hpp vm/builtin/array.hpp vm/builtin/bignum.hpp vm/builtin/executable.hpp vm/builtin/access_variable.hpp vm/builtin/alias.hpp vm/builtin/block_environment.hpp vm/builtin/block_as_method.hpp vm/builtin/bytearray.hpp vm/builtin/chararray.hpp vm/builtin/io.hpp vm/builtin/channel.hpp vm/builtin/module.hpp vm/builtin/class.hpp vm/builtin/compiledmethod.hpp vm/builtin/data.hpp vm/builtin/dir.hpp vm/builtin/exception.hpp vm/builtin/float.hpp vm/builtin/immediates.hpp vm/builtin/iseq.hpp vm/builtin/list.hpp vm/builtin/lookuptable.hpp vm/builtin/ffi_pointer.hpp vm/builtin/methodtable.hpp vm/builtin/nativefunction.hpp vm/builtin/packed_object.hpp vm/builtin/randomizer.hpp vm/builtin/regexp.hpp vm/builtin/staticscope.hpp vm/builtin/string.hpp vm/builtin/symbol.hpp vm/builtin/thread.hpp vm/builtin/tuple.hpp vm/builtin/compactlookuptable.hpp vm/builtin/t |
This file contains 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
epeterson@ep:~/Sites/rubinius locks ✔ ⇧ $ bin/mspec ci -T -X19 spec/ruby/core/array/rotate_spec.rb | |
rubinius 2.0.0dev (1.9.2 f145b1bb yyyy-mm-dd JI) [x86_64-apple-darwin10.8.0] | |
EEEEEEEEF | |
1) | |
Array#rotate returns a copy of the array whose first n elements is moved to the last ERROR | |
NoMethodError: undefined method `rotate' on an instance of Array. | |
Kernel(Array)#rotate (method_missing) at kernel/delta/kernel.rb:79 | |
{ } in Object#__script__ at spec/ruby/core/array/rotate_spec.rb:8 | |
BasicObject(Object)#instance_eval at kernel/common/eval19.rb:43 |
OlderNewer