toystore-mongo 0.9.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +9 -0
- data/Gemfile +16 -7
- data/Guardfile +15 -0
- data/{README.rdoc → README.md} +15 -11
- data/lib/toy/mongo/querying.rb +2 -10
- data/lib/toy/mongo/version.rb +1 -1
- data/spec/helper.rb +3 -15
- data/spec/toy/mongo/querying_spec.rb +1 -1
- data/toystore-mongo.gemspec +3 -3
- metadata +49 -74
data/.travis.yml
ADDED
data/Gemfile
CHANGED
@@ -1,10 +1,19 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
gemspec
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
4
|
+
gem 'rake', '~> 0.9.0'
|
5
|
+
|
6
|
+
# keep mongo and bson ext at same version
|
7
|
+
gem 'mongo', '~> 1.6.0'
|
8
|
+
gem 'bson_ext', '~> 1.6.0', :require => false
|
9
|
+
|
10
|
+
group(:guard) do
|
11
|
+
gem 'guard', '~> 1.0.0'
|
12
|
+
gem 'guard-rspec', '~> 0.6.0'
|
13
|
+
gem 'guard-bundler', '~> 0.1.0'
|
14
|
+
gem 'growl', '~> 1.0.0'
|
15
|
+
end
|
16
|
+
|
17
|
+
group(:test) do
|
18
|
+
gem 'rspec', '~> 2.8'
|
19
|
+
end
|
data/Guardfile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
rspec_options = {
|
2
|
+
:all_after_pass => false,
|
3
|
+
:all_on_start => false,
|
4
|
+
}
|
5
|
+
|
6
|
+
guard 'rspec', rspec_options do
|
7
|
+
watch(%r{^spec/.+_spec\.rb$})
|
8
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
9
|
+
watch('spec/helper.rb') { "spec" }
|
10
|
+
end
|
11
|
+
|
12
|
+
guard 'bundler' do
|
13
|
+
watch('Gemfile')
|
14
|
+
watch(/^.+\.gemspec/)
|
15
|
+
end
|
data/{README.rdoc → README.md}
RENAMED
@@ -1,19 +1,23 @@
|
|
1
|
-
|
1
|
+
# Toystore Mongo
|
2
2
|
|
3
3
|
Mongo integration for Toystore.
|
4
4
|
|
5
|
-
|
5
|
+
## Install
|
6
6
|
|
7
|
-
|
7
|
+
```
|
8
|
+
gem install toystore-mongo
|
9
|
+
```
|
8
10
|
|
9
|
-
|
11
|
+
## Usage
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
-
|
13
|
+
```ruby
|
14
|
+
class User
|
15
|
+
include Toy::Mongo
|
16
|
+
adapter :mongo, Mongo::Connection.new.db('myapp')['users']
|
14
17
|
|
15
|
-
|
16
|
-
|
18
|
+
attribute :name, String
|
19
|
+
end
|
20
|
+
```
|
17
21
|
|
18
22
|
Including Toy::Mongo includes Toy::Store and then does a few things:
|
19
23
|
|
@@ -23,7 +27,7 @@ Including Toy::Mongo includes Toy::Store and then does a few things:
|
|
23
27
|
* Overrides get_multi so that it performs one query instead of one query per id
|
24
28
|
* Adds instance method atomic_update_attributes for persisting only the changes (see #persistable_changes)
|
25
29
|
|
26
|
-
|
30
|
+
## Contributing
|
27
31
|
|
28
32
|
* Fork the project.
|
29
33
|
* Make your feature addition or bug fix.
|
@@ -31,6 +35,6 @@ Including Toy::Mongo includes Toy::Store and then does a few things:
|
|
31
35
|
* Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
32
36
|
* Send me a pull request. Bonus points for topic branches.
|
33
37
|
|
34
|
-
|
38
|
+
## Copyright
|
35
39
|
|
36
40
|
See LICENSE for details.
|
data/lib/toy/mongo/querying.rb
CHANGED
@@ -3,15 +3,7 @@ module Toy
|
|
3
3
|
module Querying
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
|
6
|
-
PluckyMethods =
|
7
|
-
:where, :filter, :limit, :skip, :offset, :sort, :order,
|
8
|
-
:fields, :ignore, :only,
|
9
|
-
:each, :find_each,
|
10
|
-
:count, :size, :distinct,
|
11
|
-
:last, :first, :all, :paginate,
|
12
|
-
:exists?, :exist?, :empty?,
|
13
|
-
:to_a, :remove,
|
14
|
-
]
|
6
|
+
PluckyMethods = Plucky::Methods
|
15
7
|
|
16
8
|
module ClassMethods
|
17
9
|
def transformer
|
@@ -108,4 +100,4 @@ module Toy
|
|
108
100
|
end
|
109
101
|
end
|
110
102
|
end
|
111
|
-
end
|
103
|
+
end
|
data/lib/toy/mongo/version.rb
CHANGED
data/spec/helper.rb
CHANGED
@@ -1,28 +1,16 @@
|
|
1
1
|
$:.unshift(File.expand_path('../../lib', __FILE__))
|
2
2
|
|
3
3
|
require 'pathname'
|
4
|
-
require 'logger'
|
5
|
-
|
6
|
-
root_path = Pathname(__FILE__).dirname.join('..').expand_path
|
7
|
-
lib_path = root_path.join('lib')
|
8
|
-
log_path = root_path.join('log')
|
9
|
-
log_path.mkpath
|
10
|
-
|
11
4
|
require 'rubygems'
|
12
5
|
require 'bundler'
|
13
6
|
|
14
|
-
Bundler.require(:
|
7
|
+
Bundler.require(:default, :test)
|
15
8
|
|
16
9
|
require 'toy/mongo'
|
17
10
|
require 'support/constants'
|
18
11
|
require 'support/callbacks_helper'
|
19
12
|
|
20
|
-
STORE = Mongo::Connection.new.db('testing')[
|
21
|
-
|
22
|
-
Logger.new(log_path.join('test.log')).tap do |log|
|
23
|
-
LogBuddy.init(:logger => log)
|
24
|
-
Toy.logger = log
|
25
|
-
end
|
13
|
+
STORE = Mongo::Connection.new.db('testing')["toystore-mongo-#{RUBY_VERSION}"]
|
26
14
|
|
27
15
|
RSpec.configure do |c|
|
28
16
|
c.include(Support::Constants)
|
@@ -30,4 +18,4 @@ RSpec.configure do |c|
|
|
30
18
|
c.before(:each) do
|
31
19
|
STORE.remove
|
32
20
|
end
|
33
|
-
end
|
21
|
+
end
|
data/toystore-mongo.gemspec
CHANGED
@@ -12,9 +12,9 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.summary = %q{Mongo integration for Toystore}
|
13
13
|
s.description = %q{Mongo integration for Toystore}
|
14
14
|
|
15
|
-
s.add_dependency('plucky', '~> 0.
|
16
|
-
s.add_dependency('toystore', '~> 0.
|
17
|
-
s.add_dependency('adapter-mongo', '~> 0.5
|
15
|
+
s.add_dependency('plucky', '~> 0.5')
|
16
|
+
s.add_dependency('toystore', '~> 0.10')
|
17
|
+
s.add_dependency('adapter-mongo', '~> 0.5')
|
18
18
|
|
19
19
|
s.files = `git ls-files`.split("\n") - ['specs.watchr']
|
20
20
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
metadata
CHANGED
@@ -1,84 +1,62 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: toystore-mongo
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.10.0
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 9
|
9
|
-
- 0
|
10
|
-
version: 0.9.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- John Nunemaker
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-04-20 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: plucky
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70141056408660 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
18
|
+
requirements:
|
26
19
|
- - ~>
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
- 4
|
32
|
-
- 1
|
33
|
-
version: 0.4.1
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0.5'
|
34
22
|
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: toystore
|
38
23
|
prerelease: false
|
39
|
-
|
24
|
+
version_requirements: *70141056408660
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: toystore
|
27
|
+
requirement: &70141056407780 !ruby/object:Gem::Requirement
|
40
28
|
none: false
|
41
|
-
requirements:
|
29
|
+
requirements:
|
42
30
|
- - ~>
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
|
45
|
-
segments:
|
46
|
-
- 0
|
47
|
-
- 9
|
48
|
-
- 0
|
49
|
-
version: 0.9.0
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0.10'
|
50
33
|
type: :runtime
|
51
|
-
version_requirements: *id002
|
52
|
-
- !ruby/object:Gem::Dependency
|
53
|
-
name: adapter-mongo
|
54
34
|
prerelease: false
|
55
|
-
|
35
|
+
version_requirements: *70141056407780
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: adapter-mongo
|
38
|
+
requirement: &70141056406040 !ruby/object:Gem::Requirement
|
56
39
|
none: false
|
57
|
-
requirements:
|
40
|
+
requirements:
|
58
41
|
- - ~>
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
|
61
|
-
segments:
|
62
|
-
- 0
|
63
|
-
- 5
|
64
|
-
- 3
|
65
|
-
version: 0.5.3
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0.5'
|
66
44
|
type: :runtime
|
67
|
-
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70141056406040
|
68
47
|
description: Mongo integration for Toystore
|
69
|
-
email:
|
48
|
+
email:
|
70
49
|
- nunemaker@gmail.com
|
71
50
|
executables: []
|
72
|
-
|
73
51
|
extensions: []
|
74
|
-
|
75
52
|
extra_rdoc_files: []
|
76
|
-
|
77
|
-
files:
|
53
|
+
files:
|
78
54
|
- .gitignore
|
55
|
+
- .travis.yml
|
79
56
|
- Gemfile
|
57
|
+
- Guardfile
|
80
58
|
- LICENSE
|
81
|
-
- README.
|
59
|
+
- README.md
|
82
60
|
- Rakefile
|
83
61
|
- lib/toy/extensions/bson_object_id.rb
|
84
62
|
- lib/toy/identity/object_id_key_factory.rb
|
@@ -95,40 +73,37 @@ files:
|
|
95
73
|
- spec/toy/mongo/querying_spec.rb
|
96
74
|
- spec/toy/mongo_spec.rb
|
97
75
|
- toystore-mongo.gemspec
|
98
|
-
homepage:
|
76
|
+
homepage: ''
|
99
77
|
licenses: []
|
100
|
-
|
101
78
|
post_install_message:
|
102
79
|
rdoc_options: []
|
103
|
-
|
104
|
-
require_paths:
|
80
|
+
require_paths:
|
105
81
|
- lib
|
106
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
82
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
107
83
|
none: false
|
108
|
-
requirements:
|
109
|
-
- -
|
110
|
-
- !ruby/object:Gem::Version
|
111
|
-
|
112
|
-
segments:
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
segments:
|
113
89
|
- 0
|
114
|
-
|
115
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
|
+
hash: 401565545603804982
|
91
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
92
|
none: false
|
117
|
-
requirements:
|
118
|
-
- -
|
119
|
-
- !ruby/object:Gem::Version
|
120
|
-
|
121
|
-
segments:
|
93
|
+
requirements:
|
94
|
+
- - ! '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
segments:
|
122
98
|
- 0
|
123
|
-
|
99
|
+
hash: 401565545603804982
|
124
100
|
requirements: []
|
125
|
-
|
126
101
|
rubyforge_project:
|
127
102
|
rubygems_version: 1.8.10
|
128
103
|
signing_key:
|
129
104
|
specification_version: 3
|
130
105
|
summary: Mongo integration for Toystore
|
131
|
-
test_files:
|
106
|
+
test_files:
|
132
107
|
- spec/helper.rb
|
133
108
|
- spec/spec.opts
|
134
109
|
- spec/support/callbacks_helper.rb
|