inquery 1.0.4 → 1.0.9

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
  SHA256:
3
- metadata.gz: 705cf4cd798bece378f6bb8f58f6fe8c4cc8e5175519bff8d292bcb1c718ffa9
4
- data.tar.gz: 4aad1d32fc5725ad02d1361d351f225304115006fd974f98ea587f2e7e0dcfa7
3
+ metadata.gz: 90b7d62f5ccf00b1ddd813840b80e2bf702d50ae5523a19714130c0c6a3ad570
4
+ data.tar.gz: 9e45803cfbf729c3d8b1cdc8edbe94b02be8c1d3a700dbd64f8fdeb004884974
5
5
  SHA512:
6
- metadata.gz: 54ca20f922c48be73d09f88519323a9133837fb621721b3fc7ad4ba68e612df6f1aabcd2343322440d0a6102691bdd29de704b440007168ff068547f20021c5f
7
- data.tar.gz: 46ddba74947a1c088216e3467a20c0ddf4716e471f4b6f3fab1a96e8b0d5e624bc935bfd4cfbbfc44ac6515dac0380aebfcfae80fff77ae2b7ec70fd83599611
6
+ metadata.gz: c6c71a8976c53fc140110fb6a74f3d5aafe680feedbd92622f39323a0042accd82214229e46b6e6e97e52ee78b1e6d07b660641cd0288010c950bc5d8c9879d7
7
+ data.tar.gz: 6832e0f4bc345cf8262a64f063d4d4c4d8a0d82922c635130e383720e08ca9b3ca60afada6baa9ba87f72aaf7693eacc57c8b018409252c6cabb0f82b94b6576
data/.releaser_config CHANGED
@@ -2,3 +2,4 @@ version_file: VERSION
2
2
  always_from_master: true
3
3
  yard_path: doc
4
4
  gem_style: github
5
+ ruby_command: ruby -S
data/.rubocop.yml CHANGED
@@ -1,15 +1,32 @@
1
1
  AllCops:
2
+ NewCops: enable
2
3
  Exclude:
3
4
  - 'local/**/*'
4
5
  - 'vendor/**/*'
5
6
  - 'tmp/**/*'
6
- - '*.gemspec'
7
+ - 'inquery.gemspec'
7
8
 
8
9
  DisplayCopNames: true
9
10
 
11
+ Style/SignalException:
12
+ EnforcedStyle: only_fail
13
+
10
14
  Metrics/MethodLength:
11
15
  Enabled: false
12
16
 
17
+ Metrics/ClassLength:
18
+ Enabled: false
19
+
20
+ Metrics/ModuleLength:
21
+ Enabled: false
22
+
23
+ Metrics/BlockLength:
24
+ Enabled: false
25
+
26
+ Metrics/ParameterLists:
27
+ Max: 5
28
+ CountKeywordArgs: false
29
+
13
30
  Metrics/AbcSize:
14
31
  Enabled: False
15
32
 
@@ -19,9 +36,12 @@ Metrics/CyclomaticComplexity:
19
36
  Metrics/PerceivedComplexity:
20
37
  Enabled: False
21
38
 
22
- Metrics/LineLength:
39
+ Layout/LineLength:
23
40
  Max: 160
24
41
 
42
+ Metrics/BlockNesting:
43
+ Enabled: false
44
+
25
45
  Style/IfUnlessModifier:
26
46
  Enabled: false
27
47
 
@@ -31,6 +51,9 @@ Style/Documentation:
31
51
  Style/RedundantReturn:
32
52
  Enabled: false
33
53
 
54
+ Style/AsciiComments:
55
+ Enabled: false
56
+
34
57
  Style/GuardClause:
35
58
  Enabled: false
36
59
 
@@ -40,3 +63,41 @@ Style/ClassAndModuleChildren:
40
63
  SupportedStyles:
41
64
  - nested
42
65
  - compact
66
+ # Checks the style of children definitions at classes and modules.
67
+ #
68
+ # Basically there are two different styles:
69
+ #
70
+ # `nested` - have each child on a separate line
71
+ # class Foo
72
+ # class Bar
73
+ # end
74
+ # end
75
+ #
76
+ # `compact` - combine definitions as much as possible
77
+ # class Foo::Bar
78
+ # end
79
+ #
80
+ # The compact style is only forced, for classes / modules with one child.
81
+
82
+ Style/FormatString:
83
+ Enabled: false
84
+
85
+ # Multiline hashes should be aligned cleanly as a table to improve readability.
86
+ Layout/HashAlignment:
87
+ EnforcedHashRocketStyle: table
88
+ EnforcedColonStyle: table
89
+
90
+ Style/FrozenStringLiteralComment:
91
+ Enabled: false
92
+
93
+ Style/AccessorGrouping:
94
+ Enabled: false
95
+
96
+ Style/DoubleNegation:
97
+ Enabled: false
98
+
99
+ Style/ConditionalAssignment:
100
+ Enabled: false
101
+
102
+ Style/CaseLikeIf:
103
+ Enabled: false
data/.travis.yml CHANGED
@@ -1,6 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.3.0
3
+ - 2.5.1
4
+ - 2.6.2
5
+ - 2.7.1
6
+ - 3.0.0
4
7
  script:
5
8
  - bundle install
6
9
  - bundle exec rake test
data/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # Change log
2
2
 
3
+ ## 1.0.9 (2021-02-24)
4
+
5
+ - Update `schemacop` to version `~> 3.0.8`
6
+
7
+ - Add the following ruby versions to travis testing:
8
+ - `2.5.1`
9
+ - `2.6.2`
10
+ - `2.7.1`
11
+ - `3.0.0`
12
+
13
+ - Remove ruby `2.3.0` from travis testing
14
+
15
+ ## 1.0.8 (2020-11-24)
16
+
17
+ - Improve support for schemacop 3.x
18
+
19
+ ## 1.0.7 (2020-11-24)
20
+
21
+ - Improve support for schemacop 3.x
22
+
23
+ ## 1.0.6 (2020-11-24)
24
+
25
+ - Improve support for schemacop 3.x
26
+
27
+ ## 1.0.5 (2020-11-24)
28
+
29
+ - Improve support for schemacop 3.x and document it
30
+
3
31
  ## 1.0.4 (2020-11-24)
4
32
 
5
33
  - Add support for schemacop 3.x (but still using 2.x schema version)
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020 Sitrox
3
+ Copyright © 2016 - 2021 Sitrox
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -20,6 +20,17 @@ to your `Gemfile`:
20
20
  gem 'inquery'
21
21
  ```
22
22
 
23
+ ## Compatibility
24
+
25
+ Inquery is tested with the following ruby versions:
26
+
27
+ * 2.5.1
28
+ * 2.6.2
29
+ * 2.7.1
30
+ * 3.0.0
31
+
32
+ Other ruby versions might work but are not covered by our Travis tests.
33
+
23
34
  ## Basic usage
24
35
 
25
36
  ```ruby
@@ -284,6 +295,9 @@ class SomeQueryClass < Inquery::Query
284
295
  end
285
296
  ```
286
297
 
298
+ Inquery supports both schemacop specification versions 2 and 3 using the methods
299
+ `schema` / `schema2` for version 2 and method `schema3` for version 3.
300
+
287
301
  ## Rails integration
288
302
 
289
303
  While it is optional, Inquery has been written from the ground up to be
@@ -322,4 +336,4 @@ in his [blog post](http://craftingruby.com/posts/2015/06/29/query-objects-throug
322
336
 
323
337
  ## Copyright
324
338
 
325
- Copyright (c) 2020 Sitrox. See `LICENSE` for further details.
339
+ Copyright © 2016 - 2021 Sitrox. See `LICENSE` for further details.
data/Rakefile CHANGED
@@ -16,12 +16,12 @@ task :gemspec do
16
16
  spec.add_development_dependency 'sqlite3'
17
17
  spec.add_development_dependency 'haml'
18
18
  spec.add_development_dependency 'yard'
19
- spec.add_development_dependency 'rubocop', '0.35.1'
19
+ spec.add_development_dependency 'rubocop', '0.92.0'
20
20
  spec.add_development_dependency 'redcarpet'
21
21
  spec.add_dependency 'minitest'
22
22
  spec.add_dependency 'activesupport'
23
23
  spec.add_dependency 'activerecord'
24
- spec.add_dependency 'schemacop', '>= 2.0'
24
+ spec.add_dependency 'schemacop', '~> 3.0.8'
25
25
  end
26
26
 
27
27
  File.open('inquery.gemspec', 'w') { |f| f.write(gemspec.to_ruby.strip) }
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.4
1
+ 1.0.9
data/doc/Inquery.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Inquery
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.26
10
10
 
11
11
  </title>
12
12
 
@@ -109,9 +109,9 @@
109
109
  </div>
110
110
 
111
111
  <div id="footer">
112
- Generated on Tue Nov 24 16:32:43 2020 by
112
+ Generated on Wed Feb 24 10:57:42 2021 by
113
113
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
114
- 0.9.25 (ruby-2.6.2).
114
+ 0.9.26 (ruby-2.6.2).
115
115
  </div>
116
116
 
117
117
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Inquery::Exceptions
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.26
10
10
 
11
11
  </title>
12
12
 
@@ -105,9 +105,9 @@
105
105
  </div>
106
106
 
107
107
  <div id="footer">
108
- Generated on Tue Nov 24 16:32:43 2020 by
108
+ Generated on Wed Feb 24 10:57:42 2021 by
109
109
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
110
- 0.9.25 (ruby-2.6.2).
110
+ 0.9.26 (ruby-2.6.2).
111
111
  </div>
112
112
 
113
113
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Exception: Inquery::Exceptions::Base
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.26
10
10
 
11
11
  </title>
12
12
 
@@ -118,9 +118,9 @@
118
118
  </div>
119
119
 
120
120
  <div id="footer">
121
- Generated on Tue Nov 24 16:32:43 2020 by
121
+ Generated on Wed Feb 24 10:57:42 2021 by
122
122
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
123
- 0.9.25 (ruby-2.6.2).
123
+ 0.9.26 (ruby-2.6.2).
124
124
  </div>
125
125
 
126
126
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Exception: Inquery::Exceptions::InvalidRelation
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.26
10
10
 
11
11
  </title>
12
12
 
@@ -122,9 +122,9 @@
122
122
  </div>
123
123
 
124
124
  <div id="footer">
125
- Generated on Tue Nov 24 16:32:43 2020 by
125
+ Generated on Wed Feb 24 10:57:42 2021 by
126
126
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
127
- 0.9.25 (ruby-2.6.2).
127
+ 0.9.26 (ruby-2.6.2).
128
128
  </div>
129
129
 
130
130
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Exception: Inquery::Exceptions::UnknownCallSignature
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.26
10
10
 
11
11
  </title>
12
12
 
@@ -122,9 +122,9 @@
122
122
  </div>
123
123
 
124
124
  <div id="footer">
125
- Generated on Tue Nov 24 16:32:43 2020 by
125
+ Generated on Wed Feb 24 10:57:42 2021 by
126
126
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
127
- 0.9.25 (ruby-2.6.2).
127
+ 0.9.26 (ruby-2.6.2).
128
128
  </div>
129
129
 
130
130
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Inquery::Mixins
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.26
10
10
 
11
11
  </title>
12
12
 
@@ -107,9 +107,9 @@
107
107
  </div>
108
108
 
109
109
  <div id="footer">
110
- Generated on Tue Nov 24 16:32:43 2020 by
110
+ Generated on Wed Feb 24 10:57:42 2021 by
111
111
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
112
- 0.9.25 (ruby-2.6.2).
112
+ 0.9.26 (ruby-2.6.2).
113
113
  </div>
114
114
 
115
115
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Inquery::Mixins::RawSqlUtils
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.26
10
10
 
11
11
  </title>
12
12
 
@@ -106,9 +106,9 @@
106
106
  </div>
107
107
 
108
108
  <div id="footer">
109
- Generated on Tue Nov 24 16:32:43 2020 by
109
+ Generated on Wed Feb 24 10:57:42 2021 by
110
110
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
111
- 0.9.25 (ruby-2.6.2).
111
+ 0.9.26 (ruby-2.6.2).
112
112
  </div>
113
113
 
114
114
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Inquery::Mixins::RelationValidation
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.26
10
10
 
11
11
  </title>
12
12
 
@@ -130,26 +130,26 @@
130
130
  </span> <span class='comment'># `nil` to not perform any checks. The `class` attribute will also be
131
131
  </span> <span class='comment'># taken to infer a default if no relation is given and you didn&#39;t
132
132
  </span> <span class='comment'># specify any `default`.
133
- </span> <span class='label'>class:</span> <span class='kw'>nil</span><span class='comma'>,</span>
133
+ </span> <span class='label'>class:</span> <span class='kw'>nil</span><span class='comma'>,</span>
134
134
 
135
135
  <span class='comment'># This allows to specify a default relation that will be taken if no
136
136
  </span> <span class='comment'># relation is given. This must be specified as a Proc returning the
137
137
  </span> <span class='comment'># relation. Set this to `false` for no default. If this is set to `nil`,
138
138
  </span> <span class='comment'># it will try to infer the default from the option `class` (if given).
139
- </span> <span class='label'>default:</span> <span class='kw'>nil</span><span class='comma'>,</span>
139
+ </span> <span class='label'>default:</span> <span class='kw'>nil</span><span class='comma'>,</span>
140
140
 
141
141
  <span class='comment'># Allows to restrict the number of fields / values the relation must
142
142
  </span> <span class='comment'># select. This is particularly useful if you&#39;re using the query as a
143
143
  </span> <span class='comment'># subquery and need it to return exactly one field. Use `nil` to not
144
144
  </span> <span class='comment'># perform any checks.
145
- </span> <span class='label'>fields:</span> <span class='kw'>nil</span><span class='comma'>,</span>
145
+ </span> <span class='label'>fields:</span> <span class='kw'>nil</span><span class='comma'>,</span>
146
146
 
147
147
  <span class='comment'># If this is set to a symbol, the relation does not have any select
148
148
  </span> <span class='comment'># fields specified (`select_values` is empty) and `fields` is &gt; 0, it
149
149
  </span> <span class='comment'># will automatically select the given field. Use `nil` to disable this
150
150
  </span> <span class='comment'># behavior.
151
151
  </span> <span class='label'>default_select:</span> <span class='symbol'>:id</span>
152
- <span class='rbrace'>}</span></pre></dd>
152
+ <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
153
153
 
154
154
  </dl>
155
155
 
@@ -304,7 +304,7 @@ options specified at class level using the <code>relation</code> method.</p>
304
304
  </span> <span class='comment'># ---------------------------------------------------------------
305
305
  </span> <span class='id identifier rubyid_fields_count'>fields_count</span> <span class='op'>=</span> <span class='id identifier rubyid_relation'>relation</span><span class='period'>.</span><span class='id identifier rubyid_select_values'>select_values</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span>
306
306
 
307
- <span class='kw'>if</span> <span class='id identifier rubyid_fields_count'>fields_count</span> <span class='op'>==</span> <span class='int'>0</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:default_select</span><span class='rbracket'>]</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:fields</span><span class='rbracket'>]</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:fields</span><span class='rbracket'>]</span> <span class='op'>&gt;</span> <span class='int'>0</span>
307
+ <span class='kw'>if</span> <span class='id identifier rubyid_fields_count'>fields_count</span><span class='period'>.</span><span class='id identifier rubyid_zero?'>zero?</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:default_select</span><span class='rbracket'>]</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:fields</span><span class='rbracket'>]</span> <span class='op'>&amp;&amp;</span> <span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:fields</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_positive?'>positive?</span>
308
308
  <span class='id identifier rubyid_relation'>relation</span> <span class='op'>=</span> <span class='id identifier rubyid_relation'>relation</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:default_select</span><span class='rbracket'>]</span><span class='rparen'>)</span>
309
309
  <span class='id identifier rubyid_fields_count'>fields_count</span> <span class='op'>=</span> <span class='int'>1</span>
310
310
  <span class='kw'>end</span>
@@ -325,9 +325,9 @@ options specified at class level using the <code>relation</code> method.</p>
325
325
  </div>
326
326
 
327
327
  <div id="footer">
328
- Generated on Tue Nov 24 16:32:43 2020 by
328
+ Generated on Wed Feb 24 10:57:42 2021 by
329
329
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
330
- 0.9.25 (ruby-2.6.2).
330
+ 0.9.26 (ruby-2.6.2).
331
331
  </div>
332
332
 
333
333
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Inquery::Mixins::RelationValidation::ClassMethods
8
8
 
9
- &mdash; Documentation by YARD 0.9.25
9
+ &mdash; Documentation by YARD 0.9.26
10
10
 
11
11
  </title>
12
12
 
@@ -178,9 +178,9 @@ on. See <span class='object_link'><a href="../RelationValidation.html#OPTIONS_SC
178
178
  </div>
179
179
 
180
180
  <div id="footer">
181
- Generated on Tue Nov 24 16:32:43 2020 by
181
+ Generated on Wed Feb 24 10:57:42 2021 by
182
182
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
183
- 0.9.25 (ruby-2.6.2).
183
+ 0.9.26 (ruby-2.6.2).
184
184
  </div>
185
185
 
186
186
  </div>