Kurt StephensNerd Up! | ||||||||||||||||||||||
rubyRuby DataMapper : dm-more Gem cannot be installed
dm-more depends on merb_datamapper (!?!) version 0.9.3 which does not appear to exist yet: ++ gem install dm-more ERROR: Error installing dm-more: dm-more requires merb_datamapper (= 0.9.3, runtime) Not sure what to do about it. Postgres and Ruby: Blocking LISTENs for NOTIFY
http://devblog.famundo.com/articles/2006/12/07/improving-postgres-listen... Unfortunately this hack blocks all threads. It should use rb_thread_select(), not select(). Ruby 1.9 : postgres gem patch
I did this little hackage during a boring PGcon 2008 talk… This patch allows the postgres gem 0.7.9.2008.01.28 to be compiled under Ruby 1.9 against PostgreSQL 8.3.0 client libraries. It appears to work against a PostgreSQL 8.1 server, but I have not run any detailed testing, yet. --- ext/extconf.rb.orig 2008-05-22 09:47:06.000000000 -0500 +++ ext/extconf.rb 2008-05-22 09:52:28.000000000 -0500 @@ -1,6 +1,9 @@ +# Ruby 1.9 +PLATFORM = RUBY_PLATFORM unless defined? PLATFORM + # windows compatibility, need different library name if(PLATFORM =~ /mingw|mswin/) then <br class="clear" /> Ruby Internals: Why RUBY_FIXNUM_FLAG should be 0x00
Type tags in Ruby VALUEInternally, values in Ruby are 32-bit (at least for 32-bit processors). Some of the least-significant bits are used to store type information. See the Ruby uses a single-bit tag of Ruby : Regexp#to_proc
Helpful in IRB:
class Regexp
def to_proc
@proc ||= lambda { | x | self.match(x) }
end
end
As in: irb(main):001:0> pp Object.methods.sort.select(&/meth/) ["instance_method", "instance_methods", "method", "method_defined?", "methods", "private_class_method", "private_instance_methods", "private_method_defined?", "private_methods", "protected_instance_methods", "protected_method_defined?", "protected_methods", "public_class_method", "public_instance_methods", "public_method_defined?", "public_methods", "singleton_methods"] <br class="clear" /> RubyGems : Gem::SourceIndex does not honor GEM_PATH ordering
Gem::SourceIndex does not honor GEM_PATH ordering. See: http://rubyforge.org/tracker/index.php?func=detail&aid=14816&group_id=12... Gem::SourceIndex#load_gems_in calls #add_spec for all gems found in #spec_dirs, in the order of Gem.path, however #add_spec Ruby : Tight Code, Floppy Performance
So you’re coding some ruby, and you do the obligatory caching of a computation:
def foo(x)
666
end
$cache = nil
def cryptic_cached_foo
($cache ||= [ foo("bar") ]).first
end
def nicey_cached_foo
unless $cache
$cache = [ foo("bar") ]
end
$cache.first
end
A discussion came up at work: is Ruby on Rails Caching
Links about Caching in Rails.
Ruby 1.9 : Changes
http://eigenclass.org/hiki/Changes+in+Ruby+1.9 Excellent synopsis of changes to Ruby 1.9. Other goodies: http://eigenclass.org/hiki/non-synthetic-benchmarks-for-yarv http://eigenclass.org/hiki/porting-rails-to-ruby-1.9 rcov : BUG : rcov 0.8.0.2 does not return target script exit code, PATCH INCLUDED!
Here is a patch to rcov 0.8.0.2 to rethrow any exception generated by the scripts to be traced, after report generation (most importantly SystemExit). This allows the exit code from test runners (like spec) to be used under rake. |
||||||||||||||||||||||
Recent comments
5 days 23 hours ago
3 weeks 1 day ago
3 weeks 1 day ago
6 weeks 3 days ago
6 weeks 3 days ago
8 weeks 2 days ago
8 weeks 5 days ago
8 weeks 5 days ago
8 weeks 5 days ago
27 weeks 13 hours ago