ohm-sorted 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OGIxYjAxZmZiNTBlMmUwZTk0MDRkMTFlYTNjYjdmMGIyN2FmYTZhYQ==
4
+ NTdhZWUxZTMxMjI1Y2E4OTliM2MzYjI2OTRmMDkxYjNlMzA1OTgzNg==
5
5
  data.tar.gz: !binary |-
6
- NjAzZjNkNWFiNTM0MjI1OWUyOTA4ZWQ0MGJkY2QzNGZlODU0ODg0MA==
6
+ NDMzNzZhMzZhMTIyMTRlODc0Njc1ZmQwNzg4NWY5YjY4NGE1NDVkMQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MWE3NjZlMDc4ZDY2MDhlODIyZTU1NzZiZTBlMWQyYzI3ZjcyMmU5YzhkZTlk
10
- M2EyNTc3MTRjOWUyMjU1MGFmZTE0OTVlOGU5MTNmMzFmMTZjYjkzNTgxYTYw
11
- YzM4MGQ0MGQ0MDcyNmQ3ZmQ3OTgwZWI1OWUwMTg1MjU4MWMyZWI=
9
+ MDMyM2E5NjgxODMxNjI1MmZmMDRjZjU1YzFhNDJkNWRjMzliOTZjMjc2ZWY4
10
+ MTlkZDY5NmZhZjZmNjVlNGNmMTU2ZTRkM2Q1MTM5ODA1NjA0MWVmZjgyNzli
11
+ NWRlZjQzNjAyODFlNzQzNmY4MTM5NWYwMGI2M2ZhODA2NzA4Y2Q=
12
12
  data.tar.gz: !binary |-
13
- MzUxODc5YzgzZDgzZjdmZDQ1ZjRiYmJkMWJlZGM1N2I4YzNlYjRkNTNjYWU0
14
- ZDEyNDIzMjM3MjRkMmU1ZDhhYTU5OGUwYTEzOTM5YzkyNGZkNGExZWJiMWIx
15
- MDA3NDUyZGUwZWQxYTdhMDlmOTg0NWFkNGQxNWViYjZlMTc0YTE=
13
+ NzBjNmIwYTdhYmJjNDM3NTAwOTFhZDhhZDM5YTYyOTRhMGIzNDU5Y2ZlMWMx
14
+ Y2VmNmIzZGZlNGZkZmE1YWZmMDIzMmQ5NTczNzViYWRhMGVjN2ViMDJjNjU4
15
+ YTc5YmFhOTdmYWE1MTA1MzRlN2U3MWQ4M2I0NWMzN2Q2YmZmZjM=
@@ -1,3 +1,12 @@
1
+ ### 0.2.1
2
+
3
+ - Fix empty? method for SortedSet in Ohm legacy
4
+
5
+ ### 0.2.0
6
+
7
+ - Major refactor of the plugin internals
8
+ - Change syntax for declaring sorted indices
9
+
1
10
  ### 0.1.0
2
11
 
3
12
  - Initial release
@@ -113,6 +113,10 @@ module Ohm
113
113
  db.zcard(key)
114
114
  end
115
115
 
116
+ def empty?
117
+ size == 0
118
+ end
119
+
116
120
  def all
117
121
  ids.map(&model)
118
122
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'ohm-sorted'
3
- s.version = '0.2.0'
3
+ s.version = '0.2.1'
4
4
  s.summary = "Sorted indices for Ohm."
5
5
  s.description = "An plugin for Ohm that lets you create sorted indices."
6
6
  s.author = "Federico Bond"
@@ -145,4 +145,14 @@ class SortedTest < Test::Unit::TestCase
145
145
  sorted_set = Post.sorted_find(:order, status: "draft")
146
146
  assert_equal 1, sorted_set.size
147
147
  end
148
+
149
+ def test_sorted_set_empty
150
+ sorted_set = Post.sorted_find(:order)
151
+ assert sorted_set.empty?
152
+
153
+ Post.create(order: 1)
154
+
155
+ sorted_set = Post.sorted_find(:order)
156
+ assert !sorted_set.empty?
157
+ end
148
158
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ohm-sorted
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Federico Bond