yaqb 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +63 -1
- data/lib/yaqb/query_builders/query_orchestrator.rb +2 -2
- data/lib/yaqb/query_builders/sort.rb +1 -1
- data/lib/yaqb/version.rb +1 -1
- data/yaqb.gemspec +13 -5
- metadata +78 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6900d62c250df501da50847ec038628327320dd8ac1f21595e194bd92590ffb
|
4
|
+
data.tar.gz: ee4b38cd10df9679c0464485170af85e185e4affafe195d8d264eb39d1d5478b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59c8d91b6ce0adff23f0deac63245e43e7ad442ce82d34c1c9208f618bcadfe9f880bf67c6101601a4fc5af68221917beb465a4a6b1627a9a108fd6b3988adfc
|
7
|
+
data.tar.gz: f63f88671310b5866f2c96a759259e13ce7fbf4e599fa8f6d6977df7d279b91c8b00abf12c5bca17466357053a4dfe0baf5956ce9c3796a503a0e4129e0aaaae
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,17 +1,69 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
yaqb (0.5.
|
4
|
+
yaqb (0.5.2)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
+
actionview (6.0.0)
|
10
|
+
activesupport (= 6.0.0)
|
11
|
+
builder (~> 3.1)
|
12
|
+
erubi (~> 1.4)
|
13
|
+
rails-dom-testing (~> 2.0)
|
14
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
15
|
+
activemodel (6.0.0)
|
16
|
+
activesupport (= 6.0.0)
|
17
|
+
activerecord (6.0.0)
|
18
|
+
activemodel (= 6.0.0)
|
19
|
+
activesupport (= 6.0.0)
|
20
|
+
activesupport (6.0.0)
|
21
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
22
|
+
i18n (>= 0.7, < 2)
|
23
|
+
minitest (~> 5.1)
|
24
|
+
tzinfo (~> 1.1)
|
25
|
+
zeitwerk (~> 2.1, >= 2.1.8)
|
26
|
+
builder (3.2.3)
|
9
27
|
coderay (1.1.2)
|
28
|
+
concurrent-ruby (1.1.5)
|
29
|
+
crass (1.0.5)
|
30
|
+
database_cleaner (1.7.0)
|
10
31
|
diff-lcs (1.3)
|
32
|
+
erubi (1.9.0)
|
33
|
+
factory_bot (5.0.2)
|
34
|
+
activesupport (>= 4.2.0)
|
35
|
+
faker (2.6.0)
|
36
|
+
i18n (>= 1.6, < 1.8)
|
37
|
+
i18n (1.7.0)
|
38
|
+
concurrent-ruby (~> 1.0)
|
39
|
+
kaminari (1.1.1)
|
40
|
+
activesupport (>= 4.1.0)
|
41
|
+
kaminari-actionview (= 1.1.1)
|
42
|
+
kaminari-activerecord (= 1.1.1)
|
43
|
+
kaminari-core (= 1.1.1)
|
44
|
+
kaminari-actionview (1.1.1)
|
45
|
+
actionview
|
46
|
+
kaminari-core (= 1.1.1)
|
47
|
+
kaminari-activerecord (1.1.1)
|
48
|
+
activerecord
|
49
|
+
kaminari-core (= 1.1.1)
|
50
|
+
kaminari-core (1.1.1)
|
51
|
+
loofah (2.3.0)
|
52
|
+
crass (~> 1.0.2)
|
53
|
+
nokogiri (>= 1.5.9)
|
11
54
|
method_source (0.9.2)
|
55
|
+
mini_portile2 (2.4.0)
|
56
|
+
minitest (5.12.2)
|
57
|
+
nokogiri (1.10.4)
|
58
|
+
mini_portile2 (~> 2.4.0)
|
12
59
|
pry (0.12.2)
|
13
60
|
coderay (~> 1.1.0)
|
14
61
|
method_source (~> 0.9.0)
|
62
|
+
rails-dom-testing (2.0.3)
|
63
|
+
activesupport (>= 4.2.0)
|
64
|
+
nokogiri (>= 1.6)
|
65
|
+
rails-html-sanitizer (1.3.0)
|
66
|
+
loofah (~> 2.3)
|
15
67
|
rake (12.3.3)
|
16
68
|
rspec (3.8.0)
|
17
69
|
rspec-core (~> 3.8.0)
|
@@ -26,15 +78,25 @@ GEM
|
|
26
78
|
diff-lcs (>= 1.2.0, < 2.0)
|
27
79
|
rspec-support (~> 3.8.0)
|
28
80
|
rspec-support (3.8.2)
|
81
|
+
sqlite3 (1.4.1)
|
82
|
+
thread_safe (0.3.6)
|
83
|
+
tzinfo (1.2.5)
|
84
|
+
thread_safe (~> 0.1)
|
85
|
+
zeitwerk (2.2.0)
|
29
86
|
|
30
87
|
PLATFORMS
|
31
88
|
ruby
|
32
89
|
|
33
90
|
DEPENDENCIES
|
34
91
|
bundler (~> 2.0)
|
92
|
+
database_cleaner
|
93
|
+
factory_bot
|
94
|
+
faker
|
95
|
+
kaminari
|
35
96
|
pry
|
36
97
|
rake (~> 12.3.0)
|
37
98
|
rspec (~> 3.8.0)
|
99
|
+
sqlite3
|
38
100
|
yaqb!
|
39
101
|
|
40
102
|
BUNDLED WITH
|
@@ -29,7 +29,7 @@ module Yaqb
|
|
29
29
|
|
30
30
|
def paginate
|
31
31
|
current_url = @request.base_url + @request.path
|
32
|
-
paginator = Paginate.new(@scope, @
|
32
|
+
paginator = Paginate.new(@scope, @params, current_url)
|
33
33
|
@response.headers['Link'] = @links = paginator.links
|
34
34
|
paginator.paginate
|
35
35
|
end
|
@@ -39,7 +39,7 @@ module Yaqb
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def filter
|
42
|
-
Filter.new(@scope, @params
|
42
|
+
Filter.new(@scope, @params, @presenter).filter
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
@@ -25,7 +25,7 @@ module Yaqb
|
|
25
25
|
|
26
26
|
def validate!(name, value)
|
27
27
|
columns = @presenter.sort_attributes.join(', ')
|
28
|
-
raise QueryBuilderError.new("#{name}=#{value}"),
|
28
|
+
raise Errors::QueryBuilderError.new("#{name}=#{value}"),
|
29
29
|
"Invalid sorting params. sort: (#{columns}), 'dir': asc, desc"
|
30
30
|
end
|
31
31
|
end
|
data/lib/yaqb/version.rb
CHANGED
data/yaqb.gemspec
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
2
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
require
|
5
|
+
require 'yaqb/version'
|
4
6
|
|
5
7
|
Gem::Specification.new do |spec|
|
6
|
-
spec.name =
|
8
|
+
spec.name = 'yaqb'
|
7
9
|
spec.version = Yaqb::VERSION
|
8
10
|
spec.authors = ['Ronald Chacon']
|
9
11
|
spec.email = ['ronald.chacon87@gmail.com']
|
@@ -18,13 +20,14 @@ Gem::Specification.new do |spec|
|
|
18
20
|
spec.metadata['changelog_uri'] = spec.homepage
|
19
21
|
|
20
22
|
spec.required_ruby_version = '>= 2.3.0'
|
23
|
+
spec.requirements << 'Ruby on Rails'
|
21
24
|
spec.requirements << 'Kaminari'
|
22
25
|
spec.requirements << 'WillPaginate'
|
23
26
|
spec.requirements << 'Pagy'
|
24
27
|
|
25
28
|
# Specify which files should be added to the gem when it is released.
|
26
29
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
27
|
-
spec.files
|
30
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
28
31
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
29
32
|
end
|
30
33
|
spec.bindir = 'exe'
|
@@ -32,7 +35,12 @@ Gem::Specification.new do |spec|
|
|
32
35
|
spec.require_paths = ['lib']
|
33
36
|
|
34
37
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
35
|
-
spec.add_development_dependency 'pry'
|
36
38
|
spec.add_development_dependency 'rake', '~> 12.3.0'
|
39
|
+
spec.add_development_dependency 'pry'
|
40
|
+
spec.add_development_dependency 'sqlite3'
|
37
41
|
spec.add_development_dependency 'rspec', '~> 3.8.0'
|
42
|
+
spec.add_development_dependency 'database_cleaner'
|
43
|
+
spec.add_development_dependency 'factory_bot'
|
44
|
+
spec.add_development_dependency 'faker'
|
45
|
+
spec.add_development_dependency 'kaminari'
|
38
46
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yaqb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ronald Chacon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 12.3.0
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 12.3.0
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: pry
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,19 +53,19 @@ dependencies:
|
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
56
|
+
name: sqlite3
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- - "
|
59
|
+
- - ">="
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
61
|
+
version: '0'
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- - "
|
66
|
+
- - ">="
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rspec
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +80,62 @@ dependencies:
|
|
66
80
|
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: 3.8.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: database_cleaner
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: factory_bot
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: faker
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: kaminari
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
69
139
|
description: Yet Another Query Builder
|
70
140
|
email:
|
71
141
|
- ronald.chacon87@gmail.com
|
@@ -121,6 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
191
|
- !ruby/object:Gem::Version
|
122
192
|
version: '0'
|
123
193
|
requirements:
|
194
|
+
- Ruby on Rails
|
124
195
|
- Kaminari
|
125
196
|
- WillPaginate
|
126
197
|
- Pagy
|