processi

about processes and engines

gem freeze

2010/02/28 update : don’t bother reading this post, bundler is the way to go

This doesn’t deserve a gem. It’s just a plain file, so it’s packaged as a gist. It’s inspired by Rails’ rake rails:freeze:gems but I made it for my non-rails stuff.


jmettraux@sanma ~/tmp/test $ ruby frigo.rb dm-migrations
 . created dir vendor
 .. from http://gems.rubyforge.org/ got dm-migrations-0.9.10
 .. from http://gems.rubyforge.org/ got dm-core-0.9.10
 .. from http://gems.rubyforge.org/ got data_objects-0.9.11
 .. from http://gems.rubyforge.org/ got addressable-2.0.2
 .. from http://gems.rubyforge.org/ got rake-0.8.4
 .. from http://gems.rubyforge.org/ got rspec-1.2.2
 .. from http://gems.rubyforge.org/ got cucumber-0.2.2
 .. from http://gems.rubyforge.org/ got term-ansicolor-1.0.3
 .. from http://gems.rubyforge.org/ got treetop-1.2.5
 .. from http://gems.rubyforge.org/ got polyglot-0.2.5
 .. from http://gems.rubyforge.org/ got hoe-1.11.0
 .. from http://gems.rubyforge.org/ got rubyforge-1.0.3
 .. from http://gems.rubyforge.org/ got diff-lcs-1.1.2
 .. from http://gems.rubyforge.org/ got builder-2.1.2
 .. from http://gems.rubyforge.org/ got launchy-0.3.3
 .. from http://gems.rubyforge.org/ got configuration-0.0.5
 .. from http://gems.rubyforge.org/ got extlib-0.9.10

jmettraux@sanma ~/tmp/test $ ls vendor/
addressable-2.0.2       dm-core-0.9.10          polyglot-0.2.5
builder-2.1.2           dm-migrations-0.9.10    rake-0.8.4
configuration-0.0.5     extlib-0.9.10           rspec-1.2.2
cucumber-0.2.2          frozen.rb               rubyforge-1.0.3
data_objects-0.9.11     hoe-1.11.0              term-ansicolor-1.0.3
diff-lcs-1.1.2          launchy-0.3.3           treetop-1.2.5

 

OK, it downloaded dm-migrations and all its required gems under vendor/ but what is this vendor/frozen.rb thing ?

# require this file to get all the frozen/unpacked gems into the load path
#
# ( created via frigo.rb  http://gist.github.com/87639 )

here = File.expand_path(File.dirname(__FILE__))

Dir.entries(here).select { |p|
  p.match(/^[^\.]/) and File.directory?("#{here}/#{p}/lib")
}.each { |p|
  $:.unshift("#{here}/#{p}/lib")
}

“require ‘vendor/frozen.rb'” will add to the loadpath all the lib/ paths under the vendor/ dir. This frozen.rb file is added by the frigo.rb freezer.

frigo.rb is [awaiting obsolescence] at http://gist.github.com/87639

 

Written by John Mettraux

March 30, 2009 at 8:18 am

Posted in ruby

%d bloggers like this: