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 A | |
def self.my_eval | |
B.class_eval do | |
puts "self in A.my_eval: #{self}" | |
yield | |
end | |
end | |
end | |
class B |
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
undefined local variable or method `o' for Gherkin::Rubify:Module | |
/var/lib/hudson/.rvm/gems/ree-1.8.7-2010.02/gems/gherkin-2.3.6/lib/gherkin/rubify.rb:19 | |
/var/lib/hudson/.rvm/gems/ree-1.8.7-2010.02/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require' | |
/var/lib/hudson/.rvm/gems/ree-1.8.7-2010.02/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require' | |
/var/lib/hudson/.rvm/gems/ree-1.8.7-2010.02/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency' | |
/var/lib/hudson/.rvm/gems/ree-1.8.7-2010.02/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in' | |
/var/lib/hudson/.rvm/gems/ree-1.8.7-2010.02/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency' | |
/var/lib/hudson/.rvm/gems/ree-1.8.7-2010.02/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require' | |
/var/lib/hudson/.rvm/gems/ree-1.8.7-2010.02/gems/cucumber-0.10.2/lib/cucumber/ast/table.rb:1 | |
/var/lib/hudson/.rvm/gems/ |
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
activemodel (3.0.3) lib/active_model/attribute_methods.rb:364:in `method_missing' | |
activerecord (3.0.3) lib/active_record/attribute_methods.rb:46:in `method_missing' | |
devise (1.1.2) lib/devise/models/database_authenticatable.rb:40:in `password=' | |
activerecord (3.0.3) lib/active_record/base.rb:1559:in `send' | |
activerecord (3.0.3) lib/active_record/base.rb:1559:in `attributes=' | |
activerecord (3.0.3) lib/active_record/base.rb:1555:in `each' | |
activerecord (3.0.3) lib/active_record/base.rb:1555:in `attributes=' | |
activerecord (3.0.3) lib/active_record/base.rb:1406:in `initialize' | |
adva-core (0.0.9) lib/patches/rails/sti_associations.rb:13:in `new' | |
adva-core (0.0.9) lib/patches/rails/sti_associations.rb:13:in `build_association' |
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
package 'debootstrap' | |
package 'apt-cacher-ng' | |
package 'inotify-tools' | |
include_recipe 'lxc::manage' | |
include_recipe 'lxc::network_bridge' | |
include_recipe 'lxc::dns' | |
host = node[:container] |
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
# now you can use | |
# form.button :submit | |
# to get a real button that is stylable | |
class SimpleForm::FormBuilder | |
def submit_button(title=nil, options={}, &block) | |
title, options = nil, title if title.is_a?(Hash) | |
title ||= submit_default_value | |
options[:type] = 'submit' | |
template.add_class_to_html_options(options, 'submit') |
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 | |
# How to run a system command from ruby within a clean bash that has never sourced rvm using a custom ruby version | |
# 1) install rvm as the correct user | |
# 2) do NOT follow the instructions about sourcing and adding this to your .bashrc | |
# 3) run the following (change the versions accordingly) | |
ruby_versions = %w(ruby-1.8.7-p330 rbx-head) |
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
# put this in config/initializer/fields_with_errors.rb | |
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| | |
if html_tag =~ /<(input|label|textarea|select)/ | |
error_class = 'error' | |
doc = Nokogiri::XML(html_tag) | |
doc.children.each do |field| | |
unless field['type'] == 'hidden' | |
unless field['class'] =~ /\berror\b/ |
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
/* | |
please do me a favour: do the following on a amd64 ubuntu | |
$ gcc -o sizeof64 sizeof64.c | |
$ ./sizeof64 | |
are they different? would this be OK? If not, what could cause this? | |
If it is OK, why is ruby 1.9 not able to implement syscall() | |
https://github.com/ruby/ruby/blob/ruby_1_9_2/io.c#L7529 |
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
# works with textnodes, too | |
Nokogiri::XML::Node.class_eval do | |
def to_hash | |
unless children.empty? | |
h = children.to_hash | |
if h.length == 1 && h.has_key?(:onlytext) | |
{ name => h[:onlytext] } | |
else | |
{ name => children.to_hash } |
NewerOlder