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
def connect | |
if @ssh.nil? | |
# @password => {:password=>"..."} if a password is provided, otherwise => {} | |
options = @password.merge({ | |
:timeout=>2, | |
# :auth_methods => %w(publickey hostbased password, keyboard-interactive) | |
:auth_methods => %w(publickey hostbased password) | |
}) | |
options = @password.merge({:verbose=>Logger::DEBUG}) if @choices[:ssh_debug] | |
@logger.debug { "connect: @machine=>#{@machine}, @user=>#{@user}, options=>#{options.inspect}" } |
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
#!/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' | |
require "gtk2" | |
require 'dm-core' |
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
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 |
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
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 |
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
#!/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' |
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
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 |
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 'rubygems' | |
require 'dm-core' | |
require 'spec' | |
# run: spec -cfs 1-n.rb | |
DataMapper::Logger.new(STDOUT, :debug) | |
DataMapper.setup(:default, 'sqlite3::memory:') | |
class Team |
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
## | |
# 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 |
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
# 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' |
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 'mongomapper' | |
require 'spec' | |
MongoMapper.connection = XGen::Mongo::Driver::Connection.new('localhost') | |
MongoMapper.database = 'tmp' | |
class Person | |
include MongoMapper::Document | |
key :title, String | |
key :_keywords, Array |