tetrahedron 0.0.1.0 → 0.0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/tetrahedron/application.rb +1 -1
- data/lib/tetrahedron/database.rb +5 -0
- data/lib/tetrahedron/databases/sqlite3.rb +5 -3
- data/lib/tetrahedron/gem.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61ea8483d73a5e182ca961b32341414a5afea8fe
|
4
|
+
data.tar.gz: 0f7f8669c26bb58b1d1c8438a1b811b4c13cebb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6f8c5fd8e025bfbcfc3d7265503fb3ff53163056c1b5e26c8da05203ab361e6f6a5abcb06582bb5b56ccd098bf0e78241aa6cf62631a5071710da8e8ad81faf
|
7
|
+
data.tar.gz: 71975cc74a04f5acf058e9479ac19c9023e594db8e3a4ff72a66b9762cae2f183e013409b298a061839d10e1b0789a54e85f398c4f7882f2e68026719e1ef1ed
|
data/Gemfile.lock
CHANGED
@@ -7,7 +7,7 @@ module Tetrahedron
|
|
7
7
|
components = self.to_s.upcase.split('::')
|
8
8
|
possibilities = (components.size.downto(1).map{|n| components.first(n).join('_')+'_ENV'})
|
9
9
|
environments = (possibilities+['RACK_ENV']).map{|possibility| ENV[possibility]}
|
10
|
-
@env ||= ::ActiveSupport::StringInquirer.new(environments.reject(&:nil?).first)
|
10
|
+
@env ||= ::ActiveSupport::StringInquirer.new(environments.reject(&:nil?).first || 'development')
|
11
11
|
end
|
12
12
|
|
13
13
|
set :environment, Proc.new { self.env.to_sym }
|
data/lib/tetrahedron/database.rb
CHANGED
@@ -30,6 +30,7 @@ module Tetrahedron
|
|
30
30
|
def self.connect
|
31
31
|
configured!
|
32
32
|
connected = self.class_variable_get(:@@provider).connect
|
33
|
+
self.connection.loggers << Logger.new($stdout) if connected
|
33
34
|
# Back our models with the new connection.
|
34
35
|
model = self.class_variable_get(:@@application).const_get("Model")
|
35
36
|
model.db = self.connection if connected
|
@@ -44,6 +45,10 @@ module Tetrahedron
|
|
44
45
|
self.class_variable_get(:@@provider).disconnect
|
45
46
|
end
|
46
47
|
|
48
|
+
def self.migrate(migrations)
|
49
|
+
Sequel::IntegerMigrator.run(self.connection, migrations)
|
50
|
+
end
|
51
|
+
|
47
52
|
def self.install(application)
|
48
53
|
super(application)
|
49
54
|
|
@@ -5,9 +5,10 @@ module Tetrahedron
|
|
5
5
|
attr_accessor :path
|
6
6
|
end
|
7
7
|
|
8
|
-
def initialize
|
8
|
+
def initialize(&configurator)
|
9
9
|
@configuration = Configuration.new
|
10
|
-
|
10
|
+
# TODO(mtwilliams): Invoke such that users don't have to prepend |self|.
|
11
|
+
@configuration.instance_eval(&configurator) if block_given?
|
11
12
|
end
|
12
13
|
|
13
14
|
def connection
|
@@ -16,7 +17,8 @@ module Tetrahedron
|
|
16
17
|
|
17
18
|
def connect
|
18
19
|
# If no path was specified, default to a transient in-memory database.
|
19
|
-
|
20
|
+
puts "Connecting to SQlite3 database at #{@configuration.path}"
|
21
|
+
@connection = Sequel.sqlite(@configuration.path)
|
20
22
|
true
|
21
23
|
end
|
22
24
|
|
data/lib/tetrahedron/gem.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tetrahedron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.
|
4
|
+
version: 0.0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|