sequelizer 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/examples/database.yml +1 -1
- data/lib/sequelizer/connection_maker.rb +1 -6
- data/lib/sequelizer/gemfile_modifier.rb +2 -0
- data/lib/sequelizer/options.rb +9 -2
- data/lib/sequelizer/version.rb +1 -1
- data/test/sequelizer/test_options.rb +13 -8
- 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: f0e093599e70651e91335650ab1356e697c514ee
|
4
|
+
data.tar.gz: b46f6b86d1fe965767ed5c2a117631c44ff4ae07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 248907aecabe87161db1b2a4ce3c3ee2a917cecb8436d995ca26653e2838bedecd770731189ab01b150c48d9f12ff122290c60432f458daede237547d32154a9
|
7
|
+
data.tar.gz: 8584066aec604be6eee2f22411bb12df2d72a350218727dab1f0a0108a8395325ed8f8db5acd1a85c4936fb1846713139bc0707fa6aa6cc90d46a46eb9ec2ce6
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,21 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## 0.0.5 - 2014-08-29
|
5
|
+
|
6
|
+
### Added
|
7
|
+
- Support for TinyTDS (SQL Server) in update_gemfile command
|
8
|
+
|
9
|
+
### Deprecated
|
10
|
+
- Nothing.
|
11
|
+
|
12
|
+
### Removed
|
13
|
+
- Nothing.
|
14
|
+
|
15
|
+
### Fixed
|
16
|
+
- timeout is always converted to integer before passing to Sequel.connect
|
17
|
+
|
18
|
+
|
4
19
|
## 0.0.4 - 2014-08-18
|
5
20
|
|
6
21
|
### Added
|
@@ -16,6 +31,7 @@ All notable changes to this project will be documented in this file.
|
|
16
31
|
### Fixed
|
17
32
|
- Nothing.
|
18
33
|
|
34
|
+
|
19
35
|
## 0.0.3 - 2014-07-10
|
20
36
|
|
21
37
|
### Added
|
data/examples/database.yml
CHANGED
@@ -22,12 +22,7 @@ module Sequelizer
|
|
22
22
|
|
23
23
|
# Returns a Sequel connection to the database
|
24
24
|
def connection
|
25
|
-
|
26
|
-
cm = self
|
27
|
-
conn.define_singleton_method(:sequelizer_options) do
|
28
|
-
cm.options
|
29
|
-
end
|
30
|
-
conn
|
25
|
+
Sequel.connect(options.to_hash)
|
31
26
|
end
|
32
27
|
end
|
33
28
|
end
|
data/lib/sequelizer/options.rb
CHANGED
@@ -12,7 +12,7 @@ module Sequelizer
|
|
12
12
|
@options
|
13
13
|
end
|
14
14
|
|
15
|
-
%w(adapter database username password
|
15
|
+
%w(adapter database username password search_path).each do |name|
|
16
16
|
define_method(name) do
|
17
17
|
@options[name]
|
18
18
|
end
|
@@ -34,11 +34,18 @@ module Sequelizer
|
|
34
34
|
paths = %w(search_path schema_search_path schema).map { |key| sequelizer_options.delete(key) }.compact
|
35
35
|
|
36
36
|
unless paths.empty?
|
37
|
-
sequelizer_options[:
|
37
|
+
sequelizer_options[:search_path] = paths.first
|
38
38
|
sequelizer_options[:after_connect] = after_connect(paths.first)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
+
if sequelizer_options[:timeout]
|
43
|
+
# I'm doing a merge! here because the indifferent access part
|
44
|
+
# of OptionsHash seemed to not work when I tried
|
45
|
+
# sequelizer_options[:timeout] = sequelizer_options[:timeout].to_i
|
46
|
+
sequelizer_options.merge!(timeout: sequelizer_options[:timeout].to_i)
|
47
|
+
end
|
48
|
+
|
42
49
|
sequelizer_options
|
43
50
|
end
|
44
51
|
|
data/lib/sequelizer/version.rb
CHANGED
@@ -11,28 +11,33 @@ class TestOptions < Minitest::Test
|
|
11
11
|
assert_equal('postgres', options.to_hash['adapter'])
|
12
12
|
end
|
13
13
|
|
14
|
-
def
|
14
|
+
def test_finds_search_path_as_search_path
|
15
15
|
options = Sequelizer::Options.new(Sequelizer::OptionsHash.new(adapter: 'postgres', search_path: 'path'))
|
16
16
|
|
17
|
-
assert_equal('path', options.
|
17
|
+
assert_equal('path', options.search_path)
|
18
18
|
end
|
19
19
|
|
20
|
-
def
|
20
|
+
def test_finds_schema_as_search_path
|
21
21
|
options = Sequelizer::Options.new(Sequelizer::OptionsHash.new(adapter: 'postgres', schema: 'path'))
|
22
22
|
|
23
|
-
assert_equal('path', options.
|
23
|
+
assert_equal('path', options.search_path)
|
24
24
|
end
|
25
25
|
|
26
|
-
def
|
26
|
+
def test_finds_schema_search_path_as_search_path
|
27
27
|
options = Sequelizer::Options.new(Sequelizer::OptionsHash.new(adapter: 'postgres', schema_search_path: 'path'))
|
28
28
|
|
29
|
-
assert_equal('path', options.
|
29
|
+
assert_equal('path', options.search_path)
|
30
30
|
end
|
31
31
|
|
32
|
-
def
|
32
|
+
def test_prefers_search_path_over_schema_search_path
|
33
33
|
options = Sequelizer::Options.new(Sequelizer::OptionsHash.new(adapter: 'postgres', search_path: 'path', schema_search_path: 'path2'))
|
34
34
|
|
35
|
-
assert_equal('path', options.
|
35
|
+
assert_equal('path', options.search_path)
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_returns_timeout_as_an_integer_even_if_given_string
|
39
|
+
options = Sequelizer::Options.new({timeout: "30"})
|
40
|
+
assert_equal(30, options.to_hash[:timeout])
|
36
41
|
end
|
37
42
|
|
38
43
|
def test_returns_a_hash_even_if_given_nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequelizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Duryea
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|