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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c861615a451de131f3bc64e53d8c49ed94f28478
4
- data.tar.gz: 6b8a256ee95cb64202a6be965f8a53ac254eb53a
3
+ metadata.gz: f0e093599e70651e91335650ab1356e697c514ee
4
+ data.tar.gz: b46f6b86d1fe965767ed5c2a117631c44ff4ae07
5
5
  SHA512:
6
- metadata.gz: fcf9bd9a65a46f889495ccaab52b4eeae644a005ddeb597329ceb7a37ca2d0184a6d4b0289957f0e8dba8b62f22c8dfbd9b87fd331a5bbc2f3ece7172f0384fa
7
- data.tar.gz: b4e6facc90132c5d95f1a3c5863cbc207f7e448bf47f383df04d5b27471048e00be7dedb61df052fcc370cc99571673764afa8a80a47d79c20aa445e1dba1aac
6
+ metadata.gz: 248907aecabe87161db1b2a4ce3c3ee2a917cecb8436d995ca26653e2838bedecd770731189ab01b150c48d9f12ff122290c60432f458daede237547d32154a9
7
+ data.tar.gz: 8584066aec604be6eee2f22411bb12df2d72a350218727dab1f0a0108a8395325ed8f8db5acd1a85c4936fb1846713139bc0707fa6aa6cc90d46a46eb9ec2ce6
@@ -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
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # If all of those are nil, we'll default to development
13
13
  common: &common
14
- adapter: postgresql
14
+ adapter: postgres
15
15
  host: localhost
16
16
  username: my_username
17
17
  password: my_password
@@ -22,12 +22,7 @@ module Sequelizer
22
22
 
23
23
  # Returns a Sequel connection to the database
24
24
  def connection
25
- conn = Sequel.connect(options.to_hash)
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
@@ -36,6 +36,8 @@ module Sequelizer
36
36
  'sqlite3'
37
37
  when 'mysql'
38
38
  'mysql2'
39
+ when 'tinytds'
40
+ 'tiny_tds'
39
41
  when nil
40
42
  raise "No database adapter defined in your Sequelizer configuration"
41
43
  else
@@ -12,7 +12,7 @@ module Sequelizer
12
12
  @options
13
13
  end
14
14
 
15
- %w(adapter database username password schema_search_path).each do |name|
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[:schema_search_path] = paths.first
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
 
@@ -1,4 +1,4 @@
1
1
  module Sequelizer
2
2
  # Version for the gem
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
@@ -11,28 +11,33 @@ class TestOptions < Minitest::Test
11
11
  assert_equal('postgres', options.to_hash['adapter'])
12
12
  end
13
13
 
14
- def test_finds_schema_as_search_path
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.schema_search_path)
17
+ assert_equal('path', options.search_path)
18
18
  end
19
19
 
20
- def test_finds_schema_as_schema
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.schema_search_path)
23
+ assert_equal('path', options.search_path)
24
24
  end
25
25
 
26
- def test_finds_schema_as_schema_search_path
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.schema_search_path)
29
+ assert_equal('path', options.search_path)
30
30
  end
31
31
 
32
- def test_prefers_schema_path_over_schema_search_path
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.schema_search_path)
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
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-19 00:00:00.000000000 Z
11
+ date: 2014-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler