Module: Sequel::Rails
- Defined in:
- lib/sequel/rails/core.rb,
lib/sequel/rails/setup.rb,
lib/sequel/rails/railtie.rb,
lib/sequel/rails/storage.rb,
lib/sequel/rails/version.rb,
lib/sequel/rails/migrations.rb,
lib/sequel/rails/configuration.rb,
lib/sequel/rails/session_store.rb,
lib/sequel/rails/log_subscriber.rb,
lib/sequel/rails.rb
Defined Under Namespace
Modules: Configuration, Generators, Railties
Classes: LogSubscriber, Migrations, Railtie, SessionStore, Storage
Constant Summary
collapse
- PATH =
::File.expand_path('../../../..', __FILE__)
- LIBPATH =
::File.join(PATH, 'lib')
- VERSION =
'0.3.9'
Class Method Summary
collapse
Class Method Details
.configuration ⇒ Object
5
6
7
|
# File 'lib/sequel/rails.rb', line 5
def self.configuration
Configuration
end
|
.connect(environment) ⇒ Object
9
10
11
|
# File 'lib/sequel/rails.rb', line 9
def self.connect(environment)
@db = Sequel.connect(configuration.db_config_for(environment))
end
|
.connected? ⇒ Boolean
17
18
19
|
# File 'lib/sequel/rails.rb', line 17
def self.connected?
!!@db
end
|
.db ⇒ Object
13
14
15
|
# File 'lib/sequel/rails.rb', line 13
def self.db
@db
end
|
.libpath(*args) ⇒ Object
Get the library path of the project. If any arguments are given, they are
concatenated to the path using File.join.
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/sequel/rails/core.rb', line 34
def self.libpath(*args)
rv = ::File.join(LIBPATH, args.flatten)
if block_given?
begin
$LOAD_PATH.unshift(LIBPATH)
rv = yield
ensure
$LOAD_PATH.shift
end
end
return rv
end
|
.path(*args) ⇒ Object
Get the root path of the project. If any arguments are given, they are
concatenated to the path using File.join.
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/sequel/rails/core.rb', line 18
def self.path(*args)
rv = ::File.join(PATH, args.flatten)
if block_given?
begin
$LOAD_PATH.unshift(PATH)
rv = yield
ensure
$LOAD_PATH.shift
end
end
return rv
end
|
.storage ⇒ Object
7
8
9
|
# File 'lib/sequel/rails/storage.rb', line 7
def self.storage
Storage
end
|
.version ⇒ Object
4
|
# File 'lib/sequel/rails/version.rb', line 4
def self.version; VERSION; end
|