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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b9d0311bd16dd7fb7b8c35d19fcce8ae77a2036
4
- data.tar.gz: 9ee81f6f029ba59b260b1e56f49db1dbb0233e87
3
+ metadata.gz: 61ea8483d73a5e182ca961b32341414a5afea8fe
4
+ data.tar.gz: 0f7f8669c26bb58b1d1c8438a1b811b4c13cebb9
5
5
  SHA512:
6
- metadata.gz: 9c2ac0f186880b502265c894461fba56c33e30b931069e614df647627c5fdb8981a65529a3a849a584d9aae7b7dba456f14d48a0a74c5e86a72f826212897b1b
7
- data.tar.gz: 1a3cb3c6184c50a59bc0b76eff23b72af0717d4b96283646ee90b58286609cccef8386c7587a7cccf0afdc4e52c2e1e30479a8d1646fb01f17b5164d1d69b150
6
+ metadata.gz: c6f8c5fd8e025bfbcfc3d7265503fb3ff53163056c1b5e26c8da05203ab361e6f6a5abcb06582bb5b56ccd098bf0e78241aa6cf62631a5071710da8e8ad81faf
7
+ data.tar.gz: 71975cc74a04f5acf058e9479ac19c9023e594db8e3a4ff72a66b9762cae2f183e013409b298a061839d10e1b0789a54e85f398c4f7882f2e68026719e1ef1ed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tetrahedron (0.0.1.0)
4
+ tetrahedron (0.0.1.1)
5
5
  activesupport
6
6
  erubis
7
7
  mail
@@ -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 }
@@ -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
- yield @configuration if block_given?
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
- @connection = Sequel.sqlite(:database => (@configuration.path || ':memory:'))
20
+ puts "Connecting to SQlite3 database at #{@configuration.path}"
21
+ @connection = Sequel.sqlite(@configuration.path)
20
22
  true
21
23
  end
22
24
 
@@ -41,7 +41,7 @@ module Tetrahedron
41
41
  end
42
42
 
43
43
  module VERSION #:nodoc:
44
- MAJOR, MINOR, PATCH, PRE = [0, 0, 1, 0]
44
+ MAJOR, MINOR, PATCH, PRE = [0, 0, 1, 1]
45
45
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
46
46
  end
47
47
 
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.0
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-30 00:00:00.000000000 Z
11
+ date: 2015-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake