qfill 0.0.2 → 0.0.3

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.
@@ -49,7 +49,7 @@ module Qfill
49
49
 
50
50
  def set_next_as_current!
51
51
  next_index = self.current_index + 1
52
- if (next_index) == self.primary.length
52
+ if (next_index) >= self.primary.length
53
53
  # If we have iterated through all the queues, then we reset
54
54
  self.reset!
55
55
  else
@@ -81,5 +81,13 @@ module Qfill
81
81
  Qfill::Pusher.new(*args)
82
82
  end
83
83
 
84
+ def more_to_fill?
85
+ !self.queues.select {|x| !x.is_full?}.empty?
86
+ end
87
+
88
+ def next_to_fill
89
+ self.queues.select {|x| !x.is_full?}.first
90
+ end
91
+
84
92
  end
85
93
  end
@@ -110,7 +110,11 @@ module Qfill
110
110
  end
111
111
 
112
112
  def is_full?
113
- self.elements.length >= self.max
113
+ self.fill_count >= self.max
114
+ end
115
+
116
+ def to_s
117
+ "Qfill::Result: ratio: #{self.ratio}, list_ratios: #{self.list_ratios}, fill_tracker: #{self.fill_tracker}, fill_count: #{self.fill_count}, filter: #{!!self.filter ? 'Yes' : 'No'}, current_list_ratio_index: #{self.current_list_ratio_index}, max: #{self.max}"
114
118
  end
115
119
  end
116
120
  end
@@ -1,3 +1,3 @@
1
1
  module Qfill
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qfill
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-04 00:00:00.000000000 Z
12
+ date: 2013-03-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec