rrepo 0.2.11 → 0.2.12

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: 3616a898d94447ed80145666edd196ca2533418c
4
- data.tar.gz: 2a75b1567bf103e3b5a1194438be6cc68d668474
3
+ metadata.gz: b7ef34219d9291afe5c3f07188ee92d3fe962d95
4
+ data.tar.gz: c8307046469b2136f707438cc55b231cce454a83
5
5
  SHA512:
6
- metadata.gz: aefb621f45c8ece72b827fa63c316a3b3dd596439483c1b3fc02c2221b8e772b10e4658291d7036b0be2864f8187145af049d8626dfa1f1862ded6468339a532
7
- data.tar.gz: 817fed44ca09437733aab2175bdb4affb399016a70d59e22f54718a16f9f01d4e87d4fcc545ae567f4513d7e18aa18d3483db71b38955dceff4709097ac9b915
6
+ metadata.gz: 926a4e4404ea47929938087e9023ab43a68710c3eff1adf7c53a0d6666773a26aa101bf64c0f6d56ac9bee0383adbe28211710604ff2b9297cd9b6426f9e9ebb
7
+ data.tar.gz: 7f707650f65bb31920deb39b9fdc3a8f1c5e9e5433f2dc93f1698c8572fae4ee29cd6f394da2d91b2e90f5bc88aa4aa26159229203b8008e623c713c35ea3ebf
@@ -5,6 +5,9 @@ module RRepo
5
5
  # A mongodb adapter
6
6
  class Mongo < Base
7
7
  include ::Mongo
8
+
9
+ attr_reader :db
10
+
8
11
  def initialize(options)
9
12
  db_name = options.delete(:db)
10
13
  @client = MongoClient.new(options.delete(:host), options)
@@ -52,7 +52,13 @@ module RRepo
52
52
 
53
53
  def all
54
54
  result = adapter.all(collection)
55
- result.map(&method(:model_for))
55
+ Enumerator.new do |y|
56
+ loop do
57
+ doc = result.next_document
58
+ break if doc.nil
59
+ y << model_for(doc)
60
+ end
61
+ end
56
62
  end
57
63
 
58
64
  def find(id = nil, &block)
data/lib/rrepo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RRepo
2
- VERSION = '0.2.11'.freeze
2
+ VERSION = '0.2.12'.freeze
3
3
  end
data/rrepo.gemspec CHANGED
@@ -24,6 +24,8 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "bundler", "~> 1.8"
25
25
  spec.add_development_dependency "rake", "~> 10.0"
26
26
  spec.add_development_dependency 'database_cleaner', '~> 1.4'
27
+ spec.add_development_dependency 'rspec', '~> 3.2'
28
+ spec.add_development_dependency 'simplecov', '~> 0.9'
27
29
 
28
30
  spec.add_dependency 'activesupport', '~> 4.2'
29
31
  spec.add_dependency 'abstractize', '~> 0.1'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rrepo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.11
4
+ version: 0.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joakim Reinert
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-03-26 00:00:00.000000000 Z
11
+ date: 2015-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,34 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.4'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.2'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.2'
69
+ - !ruby/object:Gem::Dependency
70
+ name: simplecov
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.9'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.9'
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: activesupport
57
85
  requirement: !ruby/object:Gem::Requirement