Skip to content

Instantly share code, notes, and snippets.

require 'mongo_mapper'
require 'spec'
MongoMapper.connection = Mongo::Connection.new('localhost')
MongoMapper.database = 'tmp'
class Cast
include MongoMapper::EmbeddedDocument
key :person, Integer
key :name, String
royw-macbook:tmp royw$ cat search_indexing.rb
require 'mongomapper'
require 'spec'
MongoMapper.connection = XGen::Mongo::Driver::Connection.new('localhost')
MongoMapper.database = 'tmp'
class Person
include MongoMapper::Document
key :title, String
# demos unexpected behavior when using logical functions on find result sets
require 'mongomapper'
require 'spec'
require 'ruby-debug'
MongoMapper.connection = XGen::Mongo::Driver::Connection.new('localhost')
MongoMapper.database = 'features_test'
require 'rubygems'
require 'dm-core'
require 'spec'
# run: spec -cfs 1-n.rb
DataMapper::Logger.new(STDOUT, :debug)
DataMapper.setup(:default, 'sqlite3::memory:')
class Team
##
# Container object for a set boolean Tag objects
class Tagset
include DataMapper::Resource
include DataMapper::Timestamp
include DataMapper::Serialize
property :id, Serial
property :name, String, :index => true, :nullable => false
property :select_mode, Boolean, :index => true, :default => true
property :asserted_tags, Text, :default => '', :lazy => true
class Tagset
include DataMapper::Resource
include DataMapper::Timestamp
include DataMapper::Serialize
property :id, Serial
property :name, String, :index => true, :nullable => false
property :select_mode, Boolean, :index => true, :default => true
property :asserted_tags, Text, :default => '', :lazy => true
property :created_at, DateTime
property :updated_at, DateTime
royw-gentoo royw # emerge --info
Portage 2.2_rc33 (default/linux/x86/2008.0, gcc-4.3.3, glibc-2.10.1-r0, 2.6.30-gentoo-r1 i686)
=================================================================
System uname: Linux-2.6.30-gentoo-r1-i686-Intel-R-_Core-TM-2_Quad_CPU_Q9300_@_2.50GHz-with-gentoo-2.0.1
Timestamp of tree: Fri, 31 Jul 2009 07:45:01 +0000
distcc 3.1 i686-pc-linux-gnu [disabled]
ccache version 2.4 [enabled]
app-shells/bash: 4.0_p28
dev-java/java-config: 2.1.8-r1
dev-lang/python: 2.6.2-r1
royw@royw-gentoo ~/views/gtk-demo $ diff demo1-yaml.log demo1-sqlite3.log
66a67,78
> /usr/lib/ruby/gems/1.8/gems/addressable-2.0.2/lib/addressable/uri.rb:1465: warning: instance variable @host not initialized
> /usr/lib/ruby/gems/1.8/gems/addressable-2.0.2/lib/addressable/uri.rb:1465: warning: instance variable @host not initialized
> /usr/lib/ruby/gems/1.8/gems/addressable-2.0.2/lib/addressable/uri.rb:1465: warning: instance variable @host not initialized
> /usr/lib/ruby/gems/1.8/gems/addressable-2.0.2/lib/addressable/uri.rb:1621: warning: instance variable @port not initialized
> /usr/lib/ruby/gems/1.8/gems/addressable-2.0.2/lib/addressable/uri.rb:1297: warning: instance variable @user not initialized
> /usr/lib/ruby/gems/1.8/gems/addressable-2.0.2/lib/addressable/uri.rb:1350: warning: instance variable @password not initialized
> /usr/lib/ruby/gems/1.8/gems/addressable-2.0.2/lib/addressable/uri.rb:1297: warning: instance variable @user not
#!/usr/bin/env ruby
# demos a problem between ruby-gnome2-0.19.0 and datamapper-0.10.0 (also 0.9.11)
# basically if a datamapper model is used, then created Gtk::Window objects will
# be drawn empty (i.e., the windows are blank looking).
require 'rubygems'
gem 'dm-core', '=0.9.11'
#gem 'dm-core', '=0.10.0'