sequel-rails 0.9.11 → 0.9.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/.travis.yml +24 -41
- data/History.md +8 -0
- data/README.md +38 -3
- data/ci/rails-3.2.gemfile +3 -0
- data/ci/rails-5.0.gemfile +25 -0
- data/lib/action_dispatch/middleware/session/sequel_store.rb +1 -1
- data/lib/generators/sequel/migration/migration_generator.rb +32 -16
- data/lib/sequel_rails.rb +23 -0
- data/lib/sequel_rails/configuration.rb +5 -4
- data/lib/sequel_rails/db_config.rb +19 -19
- data/lib/sequel_rails/railtie.rb +19 -9
- data/lib/sequel_rails/railties/controller_runtime.rb +2 -1
- data/lib/sequel_rails/railties/database.rake +30 -30
- data/lib/sequel_rails/railties/log_subscriber.rb +4 -2
- data/lib/sequel_rails/railties/spring_support.rb +13 -0
- data/lib/sequel_rails/sequel/database/active_support_notification.rb +2 -2
- data/lib/sequel_rails/shellwords.rb +1 -1
- data/lib/sequel_rails/storage.rb +1 -1
- data/lib/sequel_rails/storage/abstract.rb +3 -4
- data/lib/sequel_rails/storage/postgres.rb +0 -1
- data/lib/sequel_rails/version.rb +1 -1
- data/rubocop-todo.yml +9 -0
- data/sequel-rails.gemspec +3 -3
- data/spec/internal/config/database.yml +6 -0
- data/spec/internal/db/migrate/1273253849_add_twitter_handle_to_users.rb +0 -2
- data/spec/lib/generators/sequel/migration_spec.rb +0 -1
- data/spec/lib/generators/sequel/session_migration_spec.rb +0 -1
- data/spec/lib/sequel_rails/configuration_spec.rb +12 -27
- data/spec/lib/sequel_rails/db_config_spec.rb +26 -20
- data/spec/lib/sequel_rails/railtie_spec.rb +4 -4
- data/spec/lib/sequel_rails/railties/database_rake_spec.rb +18 -19
- data/spec/lib/sequel_rails/storage/postgres_spec.rb +1 -1
- metadata +15 -7
@@ -65,41 +65,47 @@ describe SequelRails::DbConfig do
|
|
65
65
|
|
66
66
|
describe '#url' do
|
67
67
|
it 'creates plain sqlite URLs' do
|
68
|
-
expect(
|
69
|
-
|
68
|
+
expect(
|
69
|
+
from(:adapter => :sqlite, :database => :some).url
|
70
|
+
).to eq "sqlite://#{root}/some"
|
70
71
|
end
|
71
72
|
|
72
73
|
it 'creates opaque sqlite URL for memory' do
|
73
|
-
expect(
|
74
|
-
|
74
|
+
expect(
|
75
|
+
from(:adapter => :sqlite, :database => ':memory:').url
|
76
|
+
).to eq 'sqlite::memory:'
|
75
77
|
end
|
76
78
|
|
77
79
|
it 'creates nice URLs' do
|
78
|
-
expect(
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
80
|
+
expect(
|
81
|
+
%w(postgres://bar:42/foo?something=hi%21&user=linus
|
82
|
+
postgres://bar:42/foo?user=linus&something=hi%21)
|
83
|
+
).to include from(
|
84
|
+
:adapter => :postgresql, :database => :foo, :host => 'bar', :port => 42,
|
85
|
+
:something => 'hi!', :user => 'linus'
|
86
|
+
).url
|
84
87
|
end
|
85
88
|
|
86
89
|
it 'creates triple slash urls when without host' do
|
87
|
-
expect(
|
88
|
-
|
90
|
+
expect(
|
91
|
+
from(:adapter => :foo, :database => :bar).url
|
92
|
+
).to eq 'foo:///bar'
|
89
93
|
end
|
90
94
|
|
91
95
|
it 'creates proper JDBC URLs' do
|
92
|
-
expect(
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
96
|
+
expect(
|
97
|
+
%w(jdbc:postgresql://bar:42/foo?something=hi%21&user=linus
|
98
|
+
jdbc:postgresql://bar:42/foo?user=linus&something=hi%21)
|
99
|
+
).to include from(
|
100
|
+
:adapter => 'jdbc:postgresql', :database => :foo, :host => 'bar',
|
101
|
+
:port => 42, :something => 'hi!', :user => 'linus'
|
102
|
+
).url
|
98
103
|
end
|
99
104
|
|
100
105
|
it 'creates proper magic Sqlite JDBC URLs' do
|
101
|
-
expect(
|
102
|
-
|
106
|
+
expect(
|
107
|
+
from(:adapter => 'jdbc:sqlite', :database => ':memory:').url
|
108
|
+
).to eq 'jdbc:sqlite::memory:'
|
103
109
|
end
|
104
110
|
end
|
105
111
|
end
|
@@ -6,9 +6,9 @@ describe SequelRails::Railtie do
|
|
6
6
|
|
7
7
|
it 'registers ::Sequel::Railtie::LogSubscriber to receive :sequel notification' do
|
8
8
|
expect(
|
9
|
-
ActiveSupport::LogSubscriber.log_subscribers.
|
9
|
+
ActiveSupport::LogSubscriber.log_subscribers.count do |subscriber|
|
10
10
|
subscriber.is_a?(SequelRails::Railties::LogSubscriber)
|
11
|
-
end
|
11
|
+
end
|
12
12
|
).to eq 1
|
13
13
|
end
|
14
14
|
|
@@ -88,7 +88,7 @@ describe SequelRails::Railtie do
|
|
88
88
|
|
89
89
|
include IOSpecHelper
|
90
90
|
before do
|
91
|
-
pretend_file_not_exists(
|
91
|
+
pretend_file_not_exists(%r{/database.yml$})
|
92
92
|
end
|
93
93
|
|
94
94
|
context 'and DATABASE_URL is defined' do
|
@@ -134,6 +134,6 @@ describe SequelRails::Railtie do
|
|
134
134
|
class_context = self
|
135
135
|
end
|
136
136
|
app
|
137
|
-
expect(
|
137
|
+
expect(class_context).to be ::Sequel::Model
|
138
138
|
end
|
139
139
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe 'Database rake tasks', :no_transaction => true do
|
4
|
-
|
5
4
|
let(:app) { Combustion::Application }
|
6
5
|
let(:app_root) { app.root }
|
7
6
|
let(:schema) { "#{app_root}/db/schema.rb" }
|
@@ -29,24 +28,24 @@ describe 'Database rake tasks', :no_transaction => true do
|
|
29
28
|
sql = Sequel::Model.db.from(
|
30
29
|
:schema_migrations
|
31
30
|
).insert_sql(:filename => '1273253849_add_twitter_handle_to_users.rb')
|
32
|
-
content = if ENV['TEST_ADAPTER']=='postgresql'
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
31
|
+
content = if ENV['TEST_ADAPTER'] == 'postgresql'
|
32
|
+
<<-EOS.strip_heredoc
|
33
|
+
Sequel.migration do
|
34
|
+
change do
|
35
|
+
self << "SET search_path TO \\"$user\\", public"
|
36
|
+
self << #{sql.inspect}
|
37
|
+
end
|
38
|
+
end
|
39
|
+
EOS
|
40
|
+
else
|
41
|
+
<<-EOS.strip_heredoc
|
42
|
+
Sequel.migration do
|
43
|
+
change do
|
44
|
+
self << #{sql.inspect}
|
45
|
+
end
|
46
|
+
end
|
47
|
+
EOS
|
48
|
+
end
|
50
49
|
expect(File.read(schema)).to include content
|
51
50
|
end
|
52
51
|
end
|
@@ -87,7 +87,7 @@ describe SequelRails::Storage::Postgres, :postgres do
|
|
87
87
|
let(:dump_file_name) { 'dump.sql' }
|
88
88
|
it 'uses the pg_dump command' do
|
89
89
|
expect(subject).to receive(:`).with(
|
90
|
-
"pg_dump --username\\=#{username} --host\\=#{host} --port\\=#{port} -
|
90
|
+
"pg_dump --username\\=#{username} --host\\=#{host} --port\\=#{port} -s -x -O --file\\=#{dump_file_name} #{database}"
|
91
91
|
)
|
92
92
|
subject._dump dump_file_name
|
93
93
|
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
|
+
version: 0.9.12
|
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:
|
12
|
+
date: 2016-01-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|
@@ -136,6 +136,9 @@ dependencies:
|
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '3.1'
|
139
|
+
- - "<"
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '3.3'
|
139
142
|
type: :development
|
140
143
|
prerelease: false
|
141
144
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -143,34 +146,37 @@ dependencies:
|
|
143
146
|
- - "~>"
|
144
147
|
- !ruby/object:Gem::Version
|
145
148
|
version: '3.1'
|
149
|
+
- - "<"
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '3.3'
|
146
152
|
- !ruby/object:Gem::Dependency
|
147
153
|
name: rubocop
|
148
154
|
requirement: !ruby/object:Gem::Requirement
|
149
155
|
requirements:
|
150
156
|
- - "~>"
|
151
157
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.
|
158
|
+
version: 0.33.0
|
153
159
|
type: :development
|
154
160
|
prerelease: false
|
155
161
|
version_requirements: !ruby/object:Gem::Requirement
|
156
162
|
requirements:
|
157
163
|
- - "~>"
|
158
164
|
- !ruby/object:Gem::Version
|
159
|
-
version: 0.
|
165
|
+
version: 0.33.0
|
160
166
|
- !ruby/object:Gem::Dependency
|
161
167
|
name: ammeter
|
162
168
|
requirement: !ruby/object:Gem::Requirement
|
163
169
|
requirements:
|
164
170
|
- - '='
|
165
171
|
- !ruby/object:Gem::Version
|
166
|
-
version: 1.1.
|
172
|
+
version: 1.1.3
|
167
173
|
type: :development
|
168
174
|
prerelease: false
|
169
175
|
version_requirements: !ruby/object:Gem::Requirement
|
170
176
|
requirements:
|
171
177
|
- - '='
|
172
178
|
- !ruby/object:Gem::Version
|
173
|
-
version: 1.1.
|
179
|
+
version: 1.1.3
|
174
180
|
- !ruby/object:Gem::Dependency
|
175
181
|
name: test-unit
|
176
182
|
requirement: !ruby/object:Gem::Requirement
|
@@ -208,6 +214,7 @@ files:
|
|
208
214
|
- ci/rails-4.0.gemfile
|
209
215
|
- ci/rails-4.1.gemfile
|
210
216
|
- ci/rails-4.2.gemfile
|
217
|
+
- ci/rails-5.0.gemfile
|
211
218
|
- config.ru
|
212
219
|
- lib/action_dispatch/middleware/session/sequel_store.rb
|
213
220
|
- lib/generators/sequel.rb
|
@@ -231,6 +238,7 @@ files:
|
|
231
238
|
- lib/sequel_rails/railties/i18n_support.rb
|
232
239
|
- lib/sequel_rails/railties/legacy_model_config.rb
|
233
240
|
- lib/sequel_rails/railties/log_subscriber.rb
|
241
|
+
- lib/sequel_rails/railties/spring_support.rb
|
234
242
|
- lib/sequel_rails/sequel/database/active_support_notification.rb
|
235
243
|
- lib/sequel_rails/sequel/plugins/rails_extensions.rb
|
236
244
|
- lib/sequel_rails/shellwords.rb
|
@@ -291,7 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
291
299
|
version: '0'
|
292
300
|
requirements: []
|
293
301
|
rubyforge_project:
|
294
|
-
rubygems_version: 2.
|
302
|
+
rubygems_version: 2.5.1
|
295
303
|
signing_key:
|
296
304
|
specification_version: 4
|
297
305
|
summary: Use Sequel with Rails (3.x and 4.x)
|