picky 4.23.0 → 4.23.1

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
  SHA1:
3
- metadata.gz: e15709ee827c97bd8f7fa31bb40fea1b75e9dafc
4
- data.tar.gz: 017a417c0c3b37fbf61950b12542cbd76b4127f8
3
+ metadata.gz: 1f407c7c38f449050e4de2d5d5cc59d5ea35a599
4
+ data.tar.gz: 2c803828457638a549f0767979073e753e7766d7
5
5
  SHA512:
6
- metadata.gz: 12c089ea8f406347266fe790b383e6e5e00ffb582ebfe852bea83bacb8be7cb1e4a807a04a84c7489aa6857f9456fc8c7639dbb21ab3e265880c2f0c68e234fe
7
- data.tar.gz: ccc498547476f2e420a9dfa4a8ee13fba61c16a11b002d71990883f39ade4d5b77c3ab396c5f12420ce0582873d5d0530a7bdeedf9aee0bc1daa14e44cf776d0
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 be given a different id (in-ruby based)' do
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.0
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-10-30 00:00:00.000000000 Z
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: