Sha256: e9ef38e9e54016780487190edf02547313ae90da6b8de0171247d1db8c1a00e2

Contents?: true

Size: 1.23 KB

Versions: 63

Compression:

Stored size: 1.23 KB

Contents

#!/usr/bin/env ruby

# An example of requiring all the files in a table via the Bootstrap::lift
# method.
#
# First use the blob.rb example in this same directory to load the a.rb file
# into an example database:
#
#   ruby blob.rb store a.rb
#
# Then run this example.
#

# Require "ONLY" then binary extension, do not +require+ the ruby based code
$: << "../ext"
require 'amalgalite/amalgalite3'

# See what the load path is, notice that it is very small
puts "Before $\" : #{$LOADED_FEATURES.inspect}"

# tell the binary extension to "require" every file in the filestore.db in the
# table 'files' orderd by column 'id'.  The 'path' column is added to $LOADED_FEATURES and the
# code in 'data' is evaled.
Amalgalite::Requires::Bootstrap.lift( "dbfile"          => "filestore.db", 
                                      "table_name"      => "rubylibs", 
                                      "rowid_column"    => "id", 
                                      "filename_column" => "filename", 
                                      "contents_column" => "contents" )

# Notice that a.rb is in the list of files that has been required
puts "After $\" : #{$LOADED_FEATURES.inspect}"

# and look we prove that the code was eval'd appropriately
a = A.new
a.a

Version data entries

63 entries across 63 versions & 2 rubygems

Version Path
amalgalite-1.9.4-x64-mingw-ucrt examples/bootstrap.rb
amalgalite-1.9.4-x86-mingw32 examples/bootstrap.rb
amalgalite-1.9.4-x64-mingw32 examples/bootstrap.rb
amalgalite-1.9.4 examples/bootstrap.rb
amalgalite-1.9.1-x86-mingw32 examples/bootstrap.rb
amalgalite-1.9.1-x64-mingw32 examples/bootstrap.rb
amalgalite-1.9.1-x64-mingw-ucrt examples/bootstrap.rb
amalgalite-1.9.1 examples/bootstrap.rb
amalgalite-1.9.0-x64-mingw-ucrt examples/bootstrap.rb
amalgalite-1.9.0-x86-mingw32 examples/bootstrap.rb
amalgalite-1.9.0-x64-mingw32 examples/bootstrap.rb
amalgalite-1.9.0 examples/bootstrap.rb
amalgalite-1.8.0-x64-mingw-ucrt examples/bootstrap.rb
amalgalite-1.8.0-x64-mingw32 examples/bootstrap.rb
amalgalite-1.8.0-x86-mingw32 examples/bootstrap.rb
amalgalite-1.8.0 examples/bootstrap.rb
amalgalite-1.7.0-x86-mingw32 examples/bootstrap.rb
amalgalite-1.7.0-x64-mingw32 examples/bootstrap.rb
amalgalite-1.7.0 examples/bootstrap.rb
amalgalite-1.6.3-x86-mingw32 examples/bootstrap.rb