order_query 0.3.4 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Configure Rails Environment
2
4
  ENV['RAILS_ENV'] = ENV['RACK_ENV'] = 'test'
3
5
  if ENV['COVERAGE'] && !%w[rbx jruby].include?(RUBY_ENGINE)
@@ -11,4 +13,25 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
11
13
  require 'fileutils'
12
14
  FileUtils.mkpath 'log' unless File.directory? 'log'
13
15
  ActiveRecord::Base.logger = Logger.new('log/test-queries.log')
14
- ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
16
+ adapter = ENV.fetch('DB', 'sqlite3')
17
+ case adapter
18
+ when 'mysql2', 'postgresql'
19
+ system({ 'DB' => adapter }, 'script/create-db-users') unless ENV['TRAVIS']
20
+ config = {
21
+ # Host 127.0.0.1 required for default postgres installation on Ubuntu.
22
+ host: '127.0.0.1',
23
+ database: 'order_query_gem_test',
24
+ encoding: 'utf8',
25
+ min_messages: 'WARNING',
26
+ adapter: adapter,
27
+ username: ENV['DB_USERNAME'] || 'order_query',
28
+ password: ENV['DB_PASSWORD'] || 'order_query'
29
+ }
30
+ ActiveRecord::Tasks::DatabaseTasks.create config.stringify_keys
31
+ ActiveRecord::Base.establish_connection config
32
+ when 'sqlite3'
33
+ ActiveRecord::Base.establish_connection adapter: adapter, database: ':memory:'
34
+ else
35
+ fail "Unknown DB adapter #{adapter}. "\
36
+ 'Valid adapters are: mysql2, postgresql, sqlite3.'
37
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: order_query
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gleb Mazovetskiy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-24 00:00:00.000000000 Z
11
+ date: 2018-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
19
+ version: '5.0'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '6.0'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '4.0'
29
+ version: '5.0'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '6.0'
@@ -36,7 +36,7 @@ dependencies:
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: '4.0'
39
+ version: '5.0'
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
42
  version: '6.0'
@@ -46,10 +46,24 @@ dependencies:
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: '4.0'
49
+ version: '5.0'
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: '6.0'
53
+ - !ruby/object:Gem::Dependency
54
+ name: rake
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '10.2'
60
+ type: :development
61
+ prerelease: false
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - "~>"
65
+ - !ruby/object:Gem::Version
66
+ version: '10.2'
53
67
  - !ruby/object:Gem::Dependency
54
68
  name: rspec
55
69
  requirement: !ruby/object:Gem::Requirement
@@ -65,19 +79,19 @@ dependencies:
65
79
  - !ruby/object:Gem::Version
66
80
  version: '3.4'
67
81
  - !ruby/object:Gem::Dependency
68
- name: rake
82
+ name: rubocop
69
83
  requirement: !ruby/object:Gem::Requirement
70
84
  requirements:
71
- - - "~>"
85
+ - - ">="
72
86
  - !ruby/object:Gem::Version
73
- version: '10.2'
87
+ version: '0'
74
88
  type: :development
75
89
  prerelease: false
76
90
  version_requirements: !ruby/object:Gem::Requirement
77
91
  requirements:
78
- - - "~>"
92
+ - - ">="
79
93
  - !ruby/object:Gem::Version
80
- version: '10.2'
94
+ version: '0'
81
95
  - !ruby/object:Gem::Dependency
82
96
  name: simplecov
83
97
  requirement: !ruby/object:Gem::Requirement
@@ -106,15 +120,17 @@ files:
106
120
  - lib/order_query.rb
107
121
  - lib/order_query/column.rb
108
122
  - lib/order_query/direction.rb
123
+ - lib/order_query/errors.rb
124
+ - lib/order_query/nulls_direction.rb
109
125
  - lib/order_query/point.rb
110
126
  - lib/order_query/space.rb
111
127
  - lib/order_query/sql/column.rb
112
128
  - lib/order_query/sql/order_by.rb
113
129
  - lib/order_query/sql/where.rb
114
130
  - lib/order_query/version.rb
115
- - spec/gemfiles/rails_4_2.gemfile
116
131
  - spec/gemfiles/rails_5_0.gemfile
117
132
  - spec/gemfiles/rails_5_1.gemfile
133
+ - spec/gemfiles/rails_5_2.gemfile
118
134
  - spec/order_query_spec.rb
119
135
  - spec/spec_helper.rb
120
136
  homepage: https://github.com/glebm/order_query
@@ -138,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
154
  version: '0'
139
155
  requirements: []
140
156
  rubyforge_project:
141
- rubygems_version: 2.6.12
157
+ rubygems_version: 2.6.13
142
158
  signing_key:
143
159
  specification_version: 4
144
160
  summary: Find next / previous Active Record(s) in one query
@@ -146,5 +162,5 @@ test_files:
146
162
  - spec/order_query_spec.rb
147
163
  - spec/spec_helper.rb
148
164
  - spec/gemfiles/rails_5_1.gemfile
149
- - spec/gemfiles/rails_4_2.gemfile
165
+ - spec/gemfiles/rails_5_2.gemfile
150
166
  - spec/gemfiles/rails_5_0.gemfile
@@ -1,9 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec path: '../../'
4
-
5
- gem 'activerecord', '~> 4.2.9'
6
- gem 'activesupport', '~> 4.2.9'
7
-
8
- eval_gemfile './shared.gemfile'
9
-