ordinare 0.2.5 → 0.2.6

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: 71fd92e8f0fe714048ec3dc905e1d6d6db0eca26
4
- data.tar.gz: bdb7ed7e1d2903c6d232054545dea7e4e193e5c7
3
+ metadata.gz: cb185750f4b23bbdec925ff6b38a33f74094c32b
4
+ data.tar.gz: d0119b694f3e421366a139327f1c90446042b7aa
5
5
  SHA512:
6
- metadata.gz: c05d6eb983d685e6094d28cd1f0715b077180fe56b53da566fc9921304530d94081e59a3badb7c710a4c979ac32737134dce1108642c6a0f4a26857a3fbfe3c8
7
- data.tar.gz: dd855cb23b01ddce082dff55deeed5d7b8ef5f5ec76d7d69f42583ab6676e35586f0c1a2a4e170adc0497beb11acf26a33b85cc29753cadd4bca56cbc1fbd20f
6
+ metadata.gz: e348f905c418e5913a8d077b3d3316032c5404860b6f26636c7f3a310ece18fa6d9709ed8c339b681b3671994be5d1075cfe6edb297cafa44eb93d9657a53b82
7
+ data.tar.gz: e7c8c7c8d47df594dba57a498bfd2b946fdf92a03e01bc817e8f823a3bbbba63d2601e47868b5d1ff4694146df1575b85a4552783b77f4c13b644b37b011908a
@@ -64,11 +64,15 @@ module Ordinare
64
64
 
65
65
  if gem && !gems[index - 1]
66
66
  current_range[:start_index] = index
67
+ current_range[:end_index] = index if index == gems.length - 1
67
68
 
68
- ranges_to_sort << current_range
69
+ ranges_to_sort << current_range unless ranges_to_sort.any? { |range| range[:start_index] == index }
69
70
  elsif gem && gems[index - 1] && !gems[index + 1]
70
71
  ranges_to_sort.map do |range|
71
- range[:start_index] == start_index ? current_range[:end_index] = index : range
72
+ if range[:start_index] == start_index
73
+ range[:end_index] = index
74
+ end
75
+
72
76
  range
73
77
  end
74
78
  end
@@ -1,3 +1,3 @@
1
1
  module Ordinare
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ordinare
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikola Đuza
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-31 00:00:00.000000000 Z
11
+ date: 2017-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec