picky 4.23.0 → 4.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/picky/query/allocations.rb +2 -0
- data/spec/functional/sort_by_spec.rb +2 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f407c7c38f449050e4de2d5d5cc59d5ea35a599
|
4
|
+
data.tar.gz: 2c803828457638a549f0767979073e753e7766d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efb950a36fdc84745d86a8ad94e59e8bb71b1447870fa0f96e1af3680fa32b52b8f4b16c69e722ffde5a5090391c43b5c202697f6f8021e5b30533b0226be698
|
7
|
+
data.tar.gz: cf6893524ae9da400e9d583b0b84fd8235d29ba240873590279ee4cc046650f7e5679164f5f19bd43670fc4fb1e830e47d562362d268787242c13fd2922680d2
|
@@ -115,6 +115,7 @@ module Picky
|
|
115
115
|
#
|
116
116
|
def process! amount, offset = 0, terminate_early = nil, sorting = nil
|
117
117
|
each do |allocation|
|
118
|
+
sorting = nil if amount <= 0 # Stop sorting if the results aren't shown.
|
118
119
|
calculated_ids = allocation.process! amount, offset, sorting
|
119
120
|
if calculated_ids.empty?
|
120
121
|
offset = offset - allocation.count unless offset.zero?
|
@@ -140,6 +141,7 @@ module Picky
|
|
140
141
|
def process_unique! amount, offset = 0, terminate_early = nil, sorting = nil
|
141
142
|
unique_ids = []
|
142
143
|
each do |allocation|
|
144
|
+
sorting = nil if amount <= 0 # Stop sorting if the results aren't shown.
|
143
145
|
calculated_ids = allocation.process_with_illegals! amount, 0, unique_ids, sorting
|
144
146
|
projected_offset = offset - allocation.count
|
145
147
|
unique_ids += calculated_ids # uniq this? <- No, slower than just leaving duplicates.
|
@@ -4,7 +4,7 @@ require 'spec_helper'
|
|
4
4
|
|
5
5
|
describe "id option" do
|
6
6
|
|
7
|
-
it 'can
|
7
|
+
it 'can sort' do
|
8
8
|
data = Picky::Index.new :id do
|
9
9
|
id :id
|
10
10
|
category :text, partial: Picky::Partial::Postfix.new(from: 1)
|
@@ -58,5 +58,6 @@ describe "id option" do
|
|
58
58
|
|
59
59
|
results.ids.should == [1,2]
|
60
60
|
end
|
61
|
+
|
61
62
|
|
62
63
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: picky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.23.
|
4
|
+
version: 4.23.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Hanke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -561,3 +561,4 @@ test_files:
|
|
561
561
|
- spec/lib/tokenizer_spec.rb
|
562
562
|
- spec/performant_spec.rb
|
563
563
|
- spec/tools/picky/cli_spec.rb
|
564
|
+
has_rdoc:
|