Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 50 lines (40 sloc) 1.369 kb
41f41f0 Pratik Moving files from cramp and updating module names
authored
1 require 'eventmachine'
2 EM.epoll
3
4 require 'active_support'
5 require 'active_support/core_ext/class/inheritable_attributes'
6 require 'active_support/core_ext/class/attribute_accessors'
7 require 'active_support/core_ext/module/aliasing'
8 require 'active_support/core_ext/module/attribute_accessors'
9 require 'active_support/core_ext/kernel/reporting'
10 require 'active_support/concern'
11 require 'active_support/core_ext/hash/indifferent_access'
12 require 'active_support/buffered_logger'
13
14 require 'tramp/evented_mysql'
15 require 'tramp/emysql_ext'
16 require 'mysqlplus'
17 require 'arel'
18 require 'tramp/arel_monkey_patches'
19 require 'active_model'
20
21 module Tramp
fcc1087 Pratik Bump dependencies
authored
22 VERSION = '0.2'
41f41f0 Pratik Moving files from cramp and updating module names
authored
23
24 mattr_accessor :logger
25
26 autoload :Quoting, "tramp/quoting"
27 autoload :Engine, "tramp/engine"
28 autoload :Column, "tramp/column"
29 autoload :Relation, "tramp/relation"
30
31 autoload :Base, "tramp/base"
32 autoload :Finders, "tramp/finders"
33 autoload :Attribute, "tramp/attribute"
34 autoload :AttributeMethods, "tramp/attribute_methods"
35 autoload :Status, "tramp/status"
36 autoload :Callbacks, "tramp/callbacks"
37
38 def self.init(settings)
39 Arel::Table.engine = Tramp::Engine.new(settings)
40 end
41
42 def self.select(query, callback = nil, &block)
43 callback ||= block
44
45 EventedMysql.select(query) do |rows|
46 callback.arity == 1 ? callback.call(rows) : callback.call if callback
47 end
48 end
49 end
Something went wrong with that request. Please try again.