mongoid-embedded-errors 2.0.1 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +17 -0
- data/.rspec +3 -0
- data/.rubocop.yml +77 -0
- data/Appraisals +15 -0
- data/Gemfile +7 -3
- data/Gemfile.lock +152 -28
- data/Guardfile +42 -0
- data/README.md +4 -5
- data/Rakefile +9 -7
- data/bin/_guard-core +17 -0
- data/bin/appraisal +17 -0
- data/bin/guard +17 -0
- data/bin/rake +17 -0
- data/bin/rspec +17 -0
- data/gemfiles/mongoid_3.gemfile +11 -0
- data/gemfiles/mongoid_3.gemfile.lock +98 -0
- data/gemfiles/mongoid_4.gemfile +11 -0
- data/gemfiles/mongoid_4.gemfile.lock +110 -0
- data/gemfiles/mongoid_5.gemfile +11 -0
- data/gemfiles/mongoid_5.gemfile.lock +106 -0
- data/gemfiles/mongoid_6.gemfile +11 -0
- data/gemfiles/mongoid_6.gemfile.lock +100 -0
- data/lib/mongoid-embedded-errors.rb +2 -41
- data/lib/mongoid/embedded_errors.rb +36 -0
- data/lib/mongoid/embedded_errors/embedded_in.rb +10 -0
- data/lib/mongoid/embedded_errors/version.rb +4 -0
- data/mongoid-embedded-errors.gemspec +13 -11
- data/spec/lib/mongoid/embedded_errors_spec.rb +38 -0
- data/spec/spec_helper.rb +34 -9
- data/spec/support/models/annotation.rb +9 -0
- data/spec/support/models/article.rb +15 -0
- data/spec/support/models/page.rb +11 -0
- data/spec/support/models/section.rb +11 -0
- data/spec/support/mongoid.yml +13 -0
- metadata +51 -20
- data/lib/mongoid-embedded-errors/embedded_in.rb +0 -16
- data/lib/mongoid-embedded-errors/version.rb +0 -5
- data/spec/config.yml +0 -6
- data/spec/embedded_errors_spec.rb +0 -41
- data/spec/support/models.rb +0 -49
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf676fc1f240e90f81b9e544ab757298062d73ca
|
4
|
+
data.tar.gz: e6b81f36c32a1f8da79f99c248c69e9195cff91c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4278dd96bebd97e65cf8568f3856a84845edf20d75635686caa8b938fbf80b7e59f36ae49969c273850ee66fa1155b33ac68cb8a1e7eff5620871712fba5e7c
|
7
|
+
data.tar.gz: b3af8d97147572f1e1210d0f7f0442f93a6347b75fbf792c6d773fe7332e5c3a90b3f0c50009660d875b9d509a074e6f37375bf550b03aebc94416206130fb68
|
data/.codeclimate.yml
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
# Use RuboCop RSpec
|
2
|
+
require: rubocop-rspec
|
3
|
+
|
4
|
+
# Common configuration.
|
5
|
+
AllCops:
|
6
|
+
# Cop names are not displayed in offense messages by default. Change behavior
|
7
|
+
# by overriding DisplayCopNames, or by giving the -D/--display-cop-names
|
8
|
+
# option.
|
9
|
+
DisplayCopNames: true
|
10
|
+
Exclude:
|
11
|
+
- Guardfile
|
12
|
+
- gemfiles/*
|
13
|
+
- bin/*
|
14
|
+
|
15
|
+
Rails:
|
16
|
+
Enabled: true
|
17
|
+
|
18
|
+
Style/FileName:
|
19
|
+
Exclude:
|
20
|
+
- Appraisals
|
21
|
+
|
22
|
+
Style/SpaceInsideHashLiteralBraces:
|
23
|
+
EnforcedStyle: no_space
|
24
|
+
EnforcedStyleForEmptyBraces: no_space
|
25
|
+
SupportedStyles:
|
26
|
+
- space
|
27
|
+
- no_space
|
28
|
+
|
29
|
+
Metrics/MethodLength:
|
30
|
+
CountComments: false # count full line comments?
|
31
|
+
Max: 15
|
32
|
+
|
33
|
+
Metrics/AbcSize:
|
34
|
+
Max: 20
|
35
|
+
|
36
|
+
Style/Documentation:
|
37
|
+
Description: 'Document classes and non-namespace modules.'
|
38
|
+
Enabled: false
|
39
|
+
|
40
|
+
Style/AutoResourceCleanup:
|
41
|
+
Description: 'Suggests the usage of an auto resource cleanup version of a method (if available).'
|
42
|
+
Enabled: true
|
43
|
+
|
44
|
+
Style/CollectionMethods:
|
45
|
+
Description: 'Preferred collection methods.'
|
46
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size'
|
47
|
+
Enabled: true
|
48
|
+
|
49
|
+
Style/MethodCalledOnDoEndBlock:
|
50
|
+
Description: 'Avoid chaining a method call on a do...end block.'
|
51
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
52
|
+
Enabled: true
|
53
|
+
|
54
|
+
Style/ExtraSpacing:
|
55
|
+
Description: 'Do not use unnecessary spacing.'
|
56
|
+
Enabled: true
|
57
|
+
|
58
|
+
Style/ClassAndModuleChildren:
|
59
|
+
# Checks the style of children definitions at classes and modules.
|
60
|
+
#
|
61
|
+
# Basically there are two different styles:
|
62
|
+
#
|
63
|
+
# `nested` - have each child on a separate line
|
64
|
+
# class Foo
|
65
|
+
# class Bar
|
66
|
+
# end
|
67
|
+
# end
|
68
|
+
#
|
69
|
+
# `compact` - combine definitions as much as possible
|
70
|
+
# class Foo::Bar
|
71
|
+
# end
|
72
|
+
#
|
73
|
+
# The compact style is only forced, for classes / modules with one child.
|
74
|
+
EnforcedStyle: compact
|
75
|
+
SupportedStyles:
|
76
|
+
- nested
|
77
|
+
- compact
|
data/Appraisals
ADDED
data/Gemfile
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
# Specify your gem's dependencies in
|
3
|
+
# Specify your gem's dependencies in mongoid-embedded-errors.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
gem
|
7
|
-
gem '
|
6
|
+
gem 'rspec'
|
7
|
+
gem 'rake'
|
8
|
+
gem 'database_cleaner'
|
9
|
+
gem 'guard-rspec'
|
10
|
+
gem 'appraisal'
|
11
|
+
gem 'mutant-rspec'
|
data/Gemfile.lock
CHANGED
@@ -2,43 +2,167 @@ PATH
|
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
4
|
mongoid-embedded-errors (2.0.1)
|
5
|
-
mongoid (>= 3.0
|
5
|
+
mongoid (>= 3.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
10
|
+
abstract_type (0.0.7)
|
11
|
+
activemodel (4.2.6)
|
12
|
+
activesupport (= 4.2.6)
|
13
|
+
builder (~> 3.1)
|
14
|
+
activesupport (4.2.6)
|
15
|
+
i18n (~> 0.7)
|
16
|
+
json (~> 1.7, >= 1.7.7)
|
17
|
+
minitest (~> 5.1)
|
18
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
19
|
+
tzinfo (~> 1.1)
|
20
|
+
adamantium (0.2.0)
|
21
|
+
ice_nine (~> 0.11.0)
|
22
|
+
memoizable (~> 0.4.0)
|
23
|
+
anima (0.3.0)
|
24
|
+
abstract_type (~> 0.0.7)
|
25
|
+
adamantium (~> 0.2)
|
26
|
+
equalizer (~> 0.0.11)
|
27
|
+
appraisal (2.1.0)
|
28
|
+
bundler
|
29
|
+
rake
|
30
|
+
thor (>= 0.14.0)
|
31
|
+
ast (2.3.0)
|
32
|
+
bson (3.2.6)
|
33
|
+
builder (3.2.2)
|
34
|
+
coderay (1.1.1)
|
35
|
+
concord (0.1.5)
|
36
|
+
adamantium (~> 0.2.0)
|
37
|
+
equalizer (~> 0.0.9)
|
38
|
+
connection_pool (2.2.0)
|
39
|
+
database_cleaner (1.5.3)
|
40
|
+
diff-lcs (1.2.5)
|
41
|
+
equalizer (0.0.11)
|
42
|
+
ffi (1.9.14)
|
43
|
+
formatador (0.2.5)
|
44
|
+
guard (2.14.0)
|
45
|
+
formatador (>= 0.2.4)
|
46
|
+
listen (>= 2.7, < 4.0)
|
47
|
+
lumberjack (~> 1.0)
|
48
|
+
nenv (~> 0.1)
|
49
|
+
notiffany (~> 0.0)
|
50
|
+
pry (>= 0.9.12)
|
51
|
+
shellany (~> 0.0)
|
52
|
+
thor (>= 0.18.1)
|
53
|
+
guard-compat (1.2.1)
|
54
|
+
guard-rspec (4.7.3)
|
55
|
+
guard (~> 2.1)
|
56
|
+
guard-compat (~> 1.1)
|
57
|
+
rspec (>= 2.99.0, < 4.0)
|
58
|
+
i18n (0.7.0)
|
59
|
+
ice_nine (0.11.2)
|
60
|
+
json (1.8.3)
|
61
|
+
listen (3.1.5)
|
62
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
63
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
64
|
+
ruby_dep (~> 1.2)
|
65
|
+
lumberjack (1.0.10)
|
66
|
+
memoizable (0.4.2)
|
67
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
68
|
+
method_source (0.8.2)
|
69
|
+
minitest (5.9.0)
|
70
|
+
mongoid (4.0.2)
|
71
|
+
activemodel (~> 4.0)
|
72
|
+
moped (~> 2.0.0)
|
73
|
+
origin (~> 2.1)
|
74
|
+
tzinfo (>= 0.3.37)
|
75
|
+
moped (2.0.7)
|
76
|
+
bson (~> 3.0)
|
77
|
+
connection_pool (~> 2.0)
|
78
|
+
optionable (~> 0.2.0)
|
79
|
+
morpher (0.2.6)
|
80
|
+
abstract_type (~> 0.0.7)
|
81
|
+
adamantium (~> 0.2.0)
|
82
|
+
anima (~> 0.3.0)
|
83
|
+
ast (~> 2.2)
|
84
|
+
concord (~> 0.1.5)
|
85
|
+
equalizer (~> 0.0.9)
|
86
|
+
ice_nine (~> 0.11.0)
|
87
|
+
procto (~> 0.0.2)
|
88
|
+
mutant (0.8.11)
|
89
|
+
abstract_type (~> 0.0.7)
|
90
|
+
adamantium (~> 0.2.0)
|
91
|
+
anima (~> 0.3.0)
|
92
|
+
ast (~> 2.2)
|
93
|
+
concord (~> 0.1.5)
|
94
|
+
diff-lcs (~> 1.2)
|
95
|
+
equalizer (~> 0.0.9)
|
96
|
+
ice_nine (~> 0.11.1)
|
97
|
+
memoizable (~> 0.4.2)
|
98
|
+
morpher (~> 0.2.6)
|
99
|
+
parallel (~> 1.3)
|
100
|
+
parser (~> 2.3.0, >= 2.3.0.2)
|
101
|
+
procto (~> 0.0.2)
|
102
|
+
regexp_parser (~> 0.3.6)
|
103
|
+
unparser (~> 0.2.5)
|
104
|
+
mutant-rspec (0.8.11)
|
105
|
+
mutant (~> 0.8.11)
|
106
|
+
rspec-core (>= 3.4.0, < 3.6.0)
|
107
|
+
nenv (0.3.0)
|
108
|
+
notiffany (0.1.1)
|
109
|
+
nenv (~> 0.1)
|
110
|
+
shellany (~> 0.0)
|
111
|
+
optionable (0.2.0)
|
112
|
+
origin (2.2.0)
|
113
|
+
parallel (1.9.0)
|
114
|
+
parser (2.3.1.4)
|
115
|
+
ast (~> 2.2)
|
116
|
+
procto (0.0.3)
|
117
|
+
pry (0.10.4)
|
118
|
+
coderay (~> 1.1.0)
|
119
|
+
method_source (~> 0.8.1)
|
120
|
+
slop (~> 3.4)
|
121
|
+
rake (11.3.0)
|
122
|
+
rb-fsevent (0.9.7)
|
123
|
+
rb-inotify (0.9.7)
|
124
|
+
ffi (>= 0.5.0)
|
125
|
+
regexp_parser (0.3.6)
|
126
|
+
rspec (3.5.0)
|
127
|
+
rspec-core (~> 3.5.0)
|
128
|
+
rspec-expectations (~> 3.5.0)
|
129
|
+
rspec-mocks (~> 3.5.0)
|
130
|
+
rspec-core (3.5.3)
|
131
|
+
rspec-support (~> 3.5.0)
|
132
|
+
rspec-expectations (3.5.0)
|
133
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
134
|
+
rspec-support (~> 3.5.0)
|
135
|
+
rspec-mocks (3.5.0)
|
136
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
137
|
+
rspec-support (~> 3.5.0)
|
138
|
+
rspec-support (3.5.0)
|
139
|
+
ruby_dep (1.4.0)
|
140
|
+
shellany (0.0.1)
|
141
|
+
slop (3.6.0)
|
142
|
+
thor (0.19.1)
|
143
|
+
thread_safe (0.3.5)
|
144
|
+
tzinfo (1.2.2)
|
145
|
+
thread_safe (~> 0.1)
|
146
|
+
unparser (0.2.5)
|
147
|
+
abstract_type (~> 0.0.7)
|
148
|
+
adamantium (~> 0.2.0)
|
149
|
+
concord (~> 0.1.5)
|
150
|
+
diff-lcs (~> 1.2.5)
|
151
|
+
equalizer (~> 0.0.9)
|
152
|
+
parser (~> 2.3.0)
|
153
|
+
procto (~> 0.0.2)
|
37
154
|
|
38
155
|
PLATFORMS
|
39
156
|
ruby
|
40
157
|
|
41
158
|
DEPENDENCIES
|
159
|
+
appraisal
|
42
160
|
database_cleaner
|
161
|
+
guard-rspec
|
43
162
|
mongoid-embedded-errors!
|
163
|
+
mutant-rspec
|
164
|
+
rake
|
44
165
|
rspec
|
166
|
+
|
167
|
+
BUNDLED WITH
|
168
|
+
1.13.1
|
data/Guardfile
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
## Uncomment and set this to only include directories you want to watch
|
5
|
+
# directories %w(app lib config test spec features) \
|
6
|
+
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
|
7
|
+
|
8
|
+
## Note: if you are using the `directories` clause above and you are not
|
9
|
+
## watching the project directory ('.'), then you will want to move
|
10
|
+
## the Guardfile to a watched dir and symlink it back, e.g.
|
11
|
+
#
|
12
|
+
# $ mkdir config
|
13
|
+
# $ mv Guardfile config/
|
14
|
+
# $ ln -s config/Guardfile .
|
15
|
+
#
|
16
|
+
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
17
|
+
|
18
|
+
# Note: The cmd option is now required due to the increasing number of ways
|
19
|
+
# rspec may be run, below are examples of the most common uses.
|
20
|
+
# * bundler: 'bundle exec rspec'
|
21
|
+
# * bundler binstubs: 'bin/rspec'
|
22
|
+
# * spring: 'bin/rspec' (This will use spring if running and you have
|
23
|
+
# installed the spring binstubs per the docs)
|
24
|
+
# * zeus: 'zeus rspec' (requires the server to be started separately)
|
25
|
+
# * 'just' rspec: 'rspec'
|
26
|
+
|
27
|
+
guard :rspec, cmd: "bundle exec rspec" do
|
28
|
+
require "guard/rspec/dsl"
|
29
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
30
|
+
|
31
|
+
# Feel free to open issues for suggestions and improvements
|
32
|
+
|
33
|
+
# RSpec files
|
34
|
+
rspec = dsl.rspec
|
35
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
36
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
37
|
+
watch(rspec.spec_files)
|
38
|
+
|
39
|
+
# Ruby files
|
40
|
+
ruby = dsl.ruby
|
41
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
42
|
+
end
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Mongoid::EmbeddedErrors
|
2
|
+
[![Code Climate](https://codeclimate.com/github/glooko/mongoid-embedded-errors/badges/gpa.svg)](https://codeclimate.com/github/glooko/mongoid-embedded-errors)
|
2
3
|
|
3
|
-
Easily bubble up errors from embedded documents in Mongoid.
|
4
|
+
Easily bubble up errors from embedded documents in Mongoid 3 and newer.
|
4
5
|
|
5
6
|
## Installation
|
6
7
|
|
@@ -102,8 +103,6 @@ Now, isn't that much nicer? Yeah, I think so to.
|
|
102
103
|
4. Push to the branch (`git push origin my-new-feature`)
|
103
104
|
5. Create new Pull Request
|
104
105
|
|
105
|
-
##
|
106
|
+
## Contributors
|
106
107
|
|
107
|
-
|
108
|
-
* Evgeniy Denisov
|
109
|
-
* Nick Plante
|
108
|
+
[See here](https://github.com/glooko/mongoid-embedded-errors/graphs/contributors)
|
data/Rakefile
CHANGED
@@ -1,11 +1,13 @@
|
|
1
|
-
require '
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
|
2
4
|
Bundler::GemHelper.install_tasks
|
3
5
|
|
4
|
-
desc
|
5
|
-
task :
|
6
|
+
desc 'Run tests'
|
7
|
+
task default: [:test]
|
6
8
|
|
7
|
-
|
9
|
+
desc 'Run tests'
|
10
|
+
task spec: [:test]
|
8
11
|
|
9
|
-
|
10
|
-
|
11
|
-
end
|
12
|
+
desc 'Run tests'
|
13
|
+
task(:test) { system 'bundle exec rspec' }
|
data/bin/_guard-core
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
#
|
4
|
+
# This file was generated by Bundler.
|
5
|
+
#
|
6
|
+
# The application '_guard-core' is installed as part of a gem, and
|
7
|
+
# this file is here to facilitate running it.
|
8
|
+
#
|
9
|
+
|
10
|
+
require "pathname"
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
12
|
+
Pathname.new(__FILE__).realpath)
|
13
|
+
|
14
|
+
require "rubygems"
|
15
|
+
require "bundler/setup"
|
16
|
+
|
17
|
+
load Gem.bin_path("guard", "_guard-core")
|
data/bin/appraisal
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
#
|
4
|
+
# This file was generated by Bundler.
|
5
|
+
#
|
6
|
+
# The application 'appraisal' is installed as part of a gem, and
|
7
|
+
# this file is here to facilitate running it.
|
8
|
+
#
|
9
|
+
|
10
|
+
require "pathname"
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
12
|
+
Pathname.new(__FILE__).realpath)
|
13
|
+
|
14
|
+
require "rubygems"
|
15
|
+
require "bundler/setup"
|
16
|
+
|
17
|
+
load Gem.bin_path("appraisal", "appraisal")
|