sequel-rails 0.9.4 → 0.9.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: b6d26dfaf8ce3dc258c5310ecc590fa8ef164de5
4
- data.tar.gz: 82495e78e217391ca5a50ab5ea6f45ec77516890
3
+ metadata.gz: dc0e3d05487281cba1193b28d1319abdaf4a1f7a
4
+ data.tar.gz: 7b159c411db6beeb9c1ff09bb2a39c2814d639fa
5
5
  SHA512:
6
- metadata.gz: f7d5d6dce632081523febcbe316f6cfbbb922febf43607f076649844c931ca68abbba550a8bfb9515925bafe24640cd32b887b47da50d6bb475e55b9a054f84c
7
- data.tar.gz: b5f3c6394d30180d2476e4057aa3f0930990e479632a65c033eea8a2461d181f94198bcac651121e2fcf04fc4e186b633141bd6433d34042100d7b2460db59df
6
+ metadata.gz: c8227bf0453d4b356035de10d00be3db7df7feaac230801a6a9d513cce4bf0b420f61aceeaf17efbde804dfa68dcda6c2c10693b0b87a4762dc458065e38aaff
7
+ data.tar.gz: 60bf62c8284abcdcf623dbcc392332db99b106ffdc7a21c981f547d344d3d9337b1feb35e99ac8efca483146247e89f3115cd66540c95a15cf656d2359da2719
data/History.md CHANGED
@@ -1,3 +1,9 @@
1
+ 0.9.5 (2014-08-14)
2
+ ==================
3
+
4
+ * Use `DATABASE_URL` environment variable even if there's no config (Rafał Rzepecki) [71](https://github.com/TalentBox/sequel-rails/pull/71)
5
+ * Fix spelling error in README (a3gis) [#70](https://github.com/TalentBox/sequel-rails/pull/70)
6
+
1
7
  0.9.4 (2014-07-24)
2
8
  ==================
3
9
 
data/README.md CHANGED
@@ -22,7 +22,7 @@ This was originally a fork of [brasten](https://github.com/brasten)'s
22
22
  [sequel-rails](https://github.com/brasten/sequel-rails) that has been updated to
23
23
  support newer versions of rails.
24
24
 
25
- Since January 2013, we've became the official maintainers of the gem after
25
+ Since January 2013, we've become the official maintainers of the gem after
26
26
  [brasten](https://github.com/brasten) proposed us.
27
27
 
28
28
  Using sequel-rails
@@ -346,6 +346,7 @@ Improvements has been made by those awesome contributors:
346
346
  * Chris Heisterkamp (cheister)
347
347
  * Tamir Duberstein (tamird)
348
348
  * shelling (shelling)
349
+ * a3gis (a3gis)
349
350
 
350
351
  Credits
351
352
  =======
@@ -33,7 +33,10 @@ module SequelRails
33
33
  end
34
34
 
35
35
  def environments
36
- @environments ||= raw.reduce({}) do |normalized, environment|
36
+ @environments ||= raw.reduce(
37
+ # default config - use just the environment variable
38
+ Hash.new normalize_repository_config({})
39
+ ) do |normalized, environment|
37
40
  name, config = environment.first, environment.last
38
41
  normalized[name] = normalize_repository_config(config)
39
42
  normalized
@@ -1,3 +1,3 @@
1
1
  module SequelRails
2
- VERSION = '0.9.4'
2
+ VERSION = '0.9.5'
3
3
  end
@@ -167,31 +167,46 @@ describe SequelRails::Configuration do
167
167
  yield
168
168
  ENV['DATABASE_URL'] = previous
169
169
  end
170
- context 'without url set in config' do
170
+
171
+ context 'with DATABASE_URL in ENV' do
171
172
  around do |example|
172
173
  with_database_url_env { example.call }
173
174
  end
174
- it 'uses DATABASE_URL' do
175
- expect(::Sequel).to receive(:connect) do |url, _hash|
176
- expect(url).to eq database_url
175
+
176
+ shared_examples 'uses DATABASE_URL' do
177
+ it 'uses DATABASE_URL' do
178
+ expect(::Sequel).to receive(:connect) do |url, _hash|
179
+ expect(url).to eq database_url
180
+ end
181
+ subject.connect environment
177
182
  end
178
- subject.connect environment
179
183
  end
180
- end
181
184
 
182
- context 'with url set in config' do
183
- let(:config_url) { 'another_adapter://user:pass@host/db' }
184
- around do |example|
185
- with_database_url_env do
186
- environments[environment]['url'] = config_url
187
- example.call
185
+ context 'without url set in config' do
186
+ include_examples 'uses DATABASE_URL'
187
+ end
188
+
189
+ context 'without config' do
190
+ before do
191
+ environments.delete environment
188
192
  end
193
+ include_examples 'uses DATABASE_URL'
189
194
  end
190
- it 'uses url from config' do
191
- expect(::Sequel).to receive(:connect) do |url, _hash|
192
- expect(url).to eq config_url
195
+
196
+ context 'with url set in config' do
197
+ let(:config_url) { 'another_adapter://user:pass@host/db' }
198
+ around do |example|
199
+ with_database_url_env do
200
+ environments[environment]['url'] = config_url
201
+ example.call
202
+ end
203
+ end
204
+ it 'uses url from config' do
205
+ expect(::Sequel).to receive(:connect) do |url, _hash|
206
+ expect(url).to eq config_url
207
+ end
208
+ subject.connect environment
193
209
  end
194
- subject.connect environment
195
210
  end
196
211
  end
197
212
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brasten Sager (brasten)
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-24 00:00:00.000000000 Z
12
+ date: 2014-08-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
@@ -259,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
259
259
  version: '0'
260
260
  requirements: []
261
261
  rubyforge_project:
262
- rubygems_version: 2.2.1
262
+ rubygems_version: 2.2.2
263
263
  signing_key:
264
264
  specification_version: 4
265
265
  summary: Use Sequel with Rails (3.x and 4.x)