appoxy-simple_record 1.1.14 → 1.1.16

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.
data/lib/results_array.rb CHANGED
@@ -13,6 +13,7 @@ module SimpleRecord
13
13
  #puts 'class=' + clz.inspect
14
14
  @params = params
15
15
  @items = items
16
+ @currentset_items = items
16
17
  @next_token = next_token
17
18
  @i = 0
18
19
  end
@@ -67,7 +68,7 @@ module SimpleRecord
67
68
  params[1] = options
68
69
  end
69
70
 
70
- @items.each do |v|
71
+ @currentset_items.each do |v|
71
72
  #puts @i.to_s
72
73
  yield v
73
74
  @i += 1
@@ -81,10 +82,12 @@ module SimpleRecord
81
82
  unless next_token.nil?
82
83
  #puts 'finding more items...'
83
84
  #puts 'params in block=' + params.inspect
85
+ #puts "i from results_array = " + @i.to_s
86
+
84
87
  options[:next_token] = next_token
85
88
  res = clz.find(*params)
86
- items = res.items # get the real items array from the ResultsArray
87
- items.each do |item|
89
+ @currentset_items = res.items # get the real items array from the ResultsArray
90
+ @currentset_items.each do |item|
88
91
  @items << item
89
92
  end
90
93
  @next_token = res.next_token
@@ -102,4 +105,3 @@ module SimpleRecord
102
105
 
103
106
  end
104
107
  end
105
-
data/lib/simple_record.rb CHANGED
@@ -1007,6 +1007,14 @@ module SimpleRecord
1007
1007
  return load << ob
1008
1008
  end
1009
1009
 
1010
+ def count
1011
+ return load.count
1012
+ end
1013
+
1014
+ def size
1015
+ return count
1016
+ end
1017
+
1010
1018
  def each(*params, &block)
1011
1019
  return load.each(*params){|record| block.call(record)}
1012
1020
  end
metadata CHANGED
@@ -1,16 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appoxy-simple_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.14
4
+ version: 1.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis Reeder
8
+ - Chad Arimura
8
9
  - RightScale
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
13
 
13
- date: 2009-09-12 00:00:00 -07:00
14
+ date: 2009-09-18 00:00:00 -07:00
14
15
  default_executable:
15
16
  dependencies: []
16
17
 
@@ -27,8 +28,9 @@ files:
27
28
  - lib/simple_record.rb
28
29
  - lib/stats.rb
29
30
  - README.markdown
30
- has_rdoc: true
31
+ has_rdoc: false
31
32
  homepage: http://github.com/appoxy/simple_record/
33
+ licenses:
32
34
  post_install_message:
33
35
  rdoc_options:
34
36
  - --charset=UTF-8
@@ -49,9 +51,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
49
51
  requirements: []
50
52
 
51
53
  rubyforge_project:
52
- rubygems_version: 1.2.0
54
+ rubygems_version: 1.3.5
53
55
  signing_key:
54
- specification_version: 2
56
+ specification_version: 3
55
57
  summary: Drop in replacement for ActiveRecord to Amazon SimpleDB instead.
56
58
  test_files:
57
59
  - test/my_child_model.rb