Sha256: c6586e89e8735a6ef805ab8aaa1165439cb441211595ef3d0a17d2db2fe72afe

Contents?: true

Size: 1.01 KB

Versions: 3

Compression:

Stored size: 1.01 KB

Contents

require 'rubygems'

begin
  gem 'sequel', '=3.16.0'
  require('sequel')
rescue LoadError => e
  raise("To use Fossil you need the sequel gem:\n '$ sudo gem install sequel -v=3.16.0'")
end

dir = File.dirname(__FILE__)
files = [File.join(dir,'number_helper.rb')] +
        [File.join(dir,'hash_extentions.rb')] +
        [File.join(dir,'date_extentions.rb')] +
        [File.join(dir,'delegate_method.rb')] +
        [File.join(dir,'sequel','serializer','serializer.rb')] +
        Dir.glob(File.join(dir,'sequel','*.rb')) +
        Dir.glob(File.join(dir,'models','*.rb'))


class MockDataset < Sequel::Dataset
  def insert(*args); end
  def insert_select(*args); end
  def update(*args); end
  def fetch_rows(sql); end
  def quoted_identifier(c); end
end

class MockDatabase < Sequel::Database
  def execute(sql, opts={}); end
  def reset; end
  def transaction(opts={}); end
  def dataset; MockDataset.new(self); end
end

MOCK_DB = MockDatabase.new unless defined?(MOCK_DB)

Sequel::Model.db = MOCK_DB

files.each{|file| require file}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fossil-0.5.7 lib/fossil.rb
fossil-0.5.6 lib/fossil.rb
fossil-0.5.5 lib/fossil.rb