active_model-better_errors 1.6.3 → 1.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +37 -0
- data/.rspec +4 -1
- data/.ruby-gemset +1 -0
- data/.travis.yml +5 -1
- data/Gemfile +9 -13
- data/Gemfile.devtools +66 -0
- data/Guardfile +32 -0
- data/LICENSE.txt +2 -0
- data/README.md +12 -10
- data/Rakefile +20 -49
- data/active_model-better_errors.gemspec +27 -107
- data/config/devtools.yml +4 -0
- data/config/flay.yml +3 -0
- data/config/flog.yml +2 -0
- data/config/mutant.yml +3 -0
- data/config/reek.yml +103 -0
- data/config/rubocop.yml +62 -0
- data/config/yardstick.yml +2 -0
- data/lib/active_model/better_errors.rb +64 -4
- data/lib/active_model/better_errors/array_reporter.rb +14 -0
- data/lib/active_model/{error_collecting → better_errors}/emulation.rb +15 -8
- data/lib/active_model/{error_collecting → better_errors}/error_collection.rb +14 -6
- data/lib/active_model/{error_collecting → better_errors}/error_message.rb +16 -5
- data/lib/active_model/{error_collecting → better_errors}/error_message_set.rb +7 -2
- data/lib/active_model/{error_collecting → better_errors}/errors.rb +10 -3
- data/lib/active_model/better_errors/formatter.rb +26 -0
- data/lib/active_model/better_errors/hash_reporter.rb +14 -0
- data/lib/active_model/{error_collecting → better_errors}/human_array_reporter.rb +6 -1
- data/lib/active_model/{error_collecting → better_errors}/human_hash_reporter.rb +8 -3
- data/lib/active_model/better_errors/human_message_formatter.rb +66 -0
- data/lib/active_model/{error_collecting → better_errors}/human_message_reporter.rb +19 -12
- data/lib/active_model/{error_collecting → better_errors}/machine_array_reporter.rb +10 -2
- data/lib/active_model/{error_collecting → better_errors}/machine_hash_reporter.rb +10 -3
- data/lib/active_model/{error_collecting → better_errors}/message_reporter.rb +10 -5
- data/lib/active_model/{error_collecting → better_errors}/reporter.rb +7 -2
- data/lib/active_model/better_errors/version.rb +10 -0
- data/spec/spec_helper.rb +19 -10
- data/spec/support/i18n_deprecation_silence.rb +4 -0
- data/spec/support/models.rb +11 -4
- data/spec/support/string_ext.rb +14 -0
- data/spec/{lib/active_model/error_collecting → unit/lib/active_model/better_errors}/emulation_spec.rb +8 -6
- data/spec/{lib/active_model/error_collecting → unit/lib/active_model/better_errors}/error_collection_spec.rb +66 -62
- data/spec/{lib/active_model/error_collecting → unit/lib/active_model/better_errors}/error_message_set_spec.rb +27 -25
- data/spec/unit/lib/active_model/better_errors/error_message_spec.rb +315 -0
- data/spec/unit/lib/active_model/better_errors/errors_spec.rb +98 -0
- data/spec/unit/lib/active_model/better_errors/human_array_reporter_spec.rb +39 -0
- data/spec/unit/lib/active_model/better_errors/human_hash_reporter_spec.rb +37 -0
- data/spec/{lib/active_model/error_collecting → unit/lib/active_model/better_errors}/human_message_formatter_spec.rb +13 -7
- data/spec/unit/lib/active_model/better_errors/human_message_reporter_spec.rb +65 -0
- data/spec/unit/lib/active_model/better_errors/machine_array_reporter_spec.rb +45 -0
- data/spec/unit/lib/active_model/better_errors/machine_hash_reporter_spec.rb +45 -0
- data/spec/unit/lib/active_model/better_errors_spec.rb +37 -0
- metadata +98 -143
- data/.document +0 -5
- data/VERSION +0 -1
- data/lib/active_model/error_collecting.rb +0 -49
- data/lib/active_model/error_collecting/array_reporter.rb +0 -9
- data/lib/active_model/error_collecting/core_ext.rb +0 -6
- data/lib/active_model/error_collecting/hash_reporter.rb +0 -9
- data/lib/active_model/error_collecting/human_message_formatter.rb +0 -58
- data/spec/lib/active_model/better_errors_spec.rb +0 -7
- data/spec/lib/active_model/error_collecting/error_message_spec.rb +0 -293
- data/spec/lib/active_model/error_collecting/errors_spec.rb +0 -95
- data/spec/lib/active_model/error_collecting/human_array_reporter_spec.rb +0 -33
- data/spec/lib/active_model/error_collecting/human_hash_reporter_spec.rb +0 -32
- data/spec/lib/active_model/error_collecting/human_message_reporter_spec.rb +0 -61
- data/spec/lib/active_model/error_collecting/machine_array_reporter_spec.rb +0 -40
- data/spec/lib/active_model/error_collecting/machine_hash_reporter_spec.rb +0 -40
- data/spec/lib/active_model/error_collecting_spec.rb +0 -22
- data/test/integration.rb +0 -10
@@ -0,0 +1,98 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe ActiveModel::BetterErrors::Errors do
|
6
|
+
subject(:instance) { klass.new base }
|
7
|
+
let(:klass) { ActiveModel::BetterErrors::Errors }
|
8
|
+
let(:base) { User.new }
|
9
|
+
let(:reporter_name) { :mock }
|
10
|
+
let(:mock_reporter) do
|
11
|
+
Class.new do
|
12
|
+
def initialize(collection)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
before { ActiveModel::BetterErrors.set_reporter(:mock, mock_reporter) }
|
18
|
+
after { ActiveModel::BetterErrors.set_reporter(:mock, nil) }
|
19
|
+
|
20
|
+
describe '#initialize' do
|
21
|
+
its(:base) { should be base }
|
22
|
+
end
|
23
|
+
|
24
|
+
describe '#error_collection' do
|
25
|
+
subject { instance.error_collection }
|
26
|
+
it { should be_a ActiveModel::BetterErrors::ErrorCollection }
|
27
|
+
its(:base) { should be base }
|
28
|
+
end
|
29
|
+
|
30
|
+
describe '#message_reporter' do
|
31
|
+
subject { instance.message_reporter }
|
32
|
+
before do
|
33
|
+
instance
|
34
|
+
.should_receive(:get_reporter)
|
35
|
+
.with(:message)
|
36
|
+
.and_return(mock_reporter)
|
37
|
+
end
|
38
|
+
|
39
|
+
it { should be mock_reporter }
|
40
|
+
end
|
41
|
+
|
42
|
+
describe '#hash_reporter' do
|
43
|
+
subject { instance.hash_reporter }
|
44
|
+
before do
|
45
|
+
instance
|
46
|
+
.should_receive(:get_reporter)
|
47
|
+
.with(:hash)
|
48
|
+
.and_return(mock_reporter)
|
49
|
+
end
|
50
|
+
|
51
|
+
it { should be mock_reporter }
|
52
|
+
end
|
53
|
+
|
54
|
+
describe '#array_reporter' do
|
55
|
+
subject { instance.array_reporter }
|
56
|
+
before do
|
57
|
+
instance
|
58
|
+
.should_receive(:get_reporter)
|
59
|
+
.with(:array)
|
60
|
+
.and_return(mock_reporter)
|
61
|
+
end
|
62
|
+
|
63
|
+
it { should be mock_reporter }
|
64
|
+
end
|
65
|
+
|
66
|
+
describe '#set_reporter' do
|
67
|
+
before { instance.get_reporter(:mock) }
|
68
|
+
it 'should set the reporter class' do
|
69
|
+
instance.set_reporter reporter_name, mock_reporter
|
70
|
+
reporter_classes = instance.instance_variable_get(:@reporter_classes)
|
71
|
+
reporter_classes[reporter_name.to_s].should == mock_reporter
|
72
|
+
end
|
73
|
+
|
74
|
+
it 'should delete old reporter instance' do
|
75
|
+
reporters = instance.instance_variable_get(:@reporters)
|
76
|
+
reporters[reporter_name] = double
|
77
|
+
instance.set_reporter reporter_name, mock_reporter
|
78
|
+
reporters.key?(reporter_name.to_s).should be false
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
describe '#get_reporter_class' do
|
83
|
+
subject { instance.get_reporter_class(reporter_name) }
|
84
|
+
before { instance.set_reporter reporter_name, mock_reporter }
|
85
|
+
it { should == mock_reporter }
|
86
|
+
end
|
87
|
+
|
88
|
+
describe '#get_reporter' do
|
89
|
+
subject { instance.get_reporter(reporter_name) }
|
90
|
+
before { instance.set_reporter reporter_name, mock_reporter }
|
91
|
+
it { should be_a mock_reporter }
|
92
|
+
end
|
93
|
+
|
94
|
+
describe '#reporter_classes' do
|
95
|
+
subject { instance.reporter_classes }
|
96
|
+
it { should == ::ActiveModel::BetterErrors.reporters }
|
97
|
+
end
|
98
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe ActiveModel::BetterErrors::HumanArrayReporter do
|
6
|
+
subject { reporter }
|
7
|
+
let(:reporter) { klass.new collection }
|
8
|
+
let(:klass) { ActiveModel::BetterErrors::HumanArrayReporter }
|
9
|
+
let(:collection) { ActiveModel::BetterErrors::ErrorCollection.new base }
|
10
|
+
let(:base) { User.new }
|
11
|
+
|
12
|
+
describe '#initialize' do
|
13
|
+
its(:collection) { should be collection }
|
14
|
+
end
|
15
|
+
|
16
|
+
describe '#base' do
|
17
|
+
its(:base) { should be base }
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#to_a' do
|
21
|
+
subject { reporter.to_a }
|
22
|
+
let(:expected) do
|
23
|
+
%w(foo bar)
|
24
|
+
end
|
25
|
+
|
26
|
+
before do
|
27
|
+
message_reporter = double
|
28
|
+
ActiveModel::BetterErrors::HumanMessageReporter
|
29
|
+
.should_receive(:new)
|
30
|
+
.and_return(message_reporter)
|
31
|
+
|
32
|
+
message_reporter
|
33
|
+
.should_receive(:full_messages)
|
34
|
+
.and_return(expected)
|
35
|
+
end
|
36
|
+
|
37
|
+
it { should == expected }
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe ActiveModel::BetterErrors::HumanHashReporter do
|
6
|
+
subject { reporter }
|
7
|
+
let(:reporter) { klass.new collection }
|
8
|
+
let(:klass) { ActiveModel::BetterErrors::HumanHashReporter }
|
9
|
+
let(:collection) { ActiveModel::BetterErrors::ErrorCollection.new base }
|
10
|
+
let(:base) { User.new }
|
11
|
+
|
12
|
+
describe '#initialize' do
|
13
|
+
its(:collection) { should be collection }
|
14
|
+
end
|
15
|
+
|
16
|
+
describe '#base' do
|
17
|
+
its(:base) { should be base }
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#to_hash' do
|
21
|
+
subject { reporter.to_hash }
|
22
|
+
let(:expected) do
|
23
|
+
{
|
24
|
+
first_name: ['is invalid', "can't be empty"],
|
25
|
+
last_name: ['is invalid']
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
before do
|
30
|
+
collection[:first_name] << :invalid
|
31
|
+
collection[:first_name] << :empty
|
32
|
+
collection[:last_name] << :invalid
|
33
|
+
end
|
34
|
+
|
35
|
+
it { should == expected }
|
36
|
+
end
|
37
|
+
end
|
@@ -1,12 +1,18 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
|
-
describe ActiveModel::
|
5
|
+
describe ActiveModel::BetterErrors::HumanMessageFormatter do
|
4
6
|
subject(:formatter) { klass.new base, error_message }
|
5
|
-
let(:klass) { ActiveModel::
|
7
|
+
let(:klass) { ActiveModel::BetterErrors::HumanMessageFormatter }
|
6
8
|
let(:base) { User.new }
|
7
|
-
let(:error_message)
|
9
|
+
let(:error_message) do
|
10
|
+
ActiveModel::BetterErrors::ErrorMessage.build(
|
11
|
+
base, :first_name, :invalid
|
12
|
+
)
|
13
|
+
end
|
8
14
|
|
9
|
-
describe
|
15
|
+
describe '#initialize' do
|
10
16
|
its(:base) { should be base }
|
11
17
|
its(:error_message) { should be error_message }
|
12
18
|
its(:attribute) { should be error_message.attribute }
|
@@ -15,8 +21,8 @@ describe ActiveModel::ErrorCollecting::HumanMessageFormatter do
|
|
15
21
|
its(:options) { should be error_message.options }
|
16
22
|
end
|
17
23
|
|
18
|
-
describe
|
24
|
+
describe '#format_message' do
|
19
25
|
subject { formatter.format_message }
|
20
|
-
it { should ==
|
26
|
+
it { should == 'is invalid' }
|
21
27
|
end
|
22
|
-
end
|
28
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe ActiveModel::BetterErrors::HumanMessageReporter do
|
6
|
+
subject { reporter }
|
7
|
+
let(:reporter) { klass.new collection }
|
8
|
+
let(:klass) { ActiveModel::BetterErrors::HumanMessageReporter }
|
9
|
+
let(:collection) { ActiveModel::BetterErrors::ErrorCollection.new base }
|
10
|
+
let(:base) { User.new }
|
11
|
+
|
12
|
+
describe '#initialize' do
|
13
|
+
its(:collection) { should be collection }
|
14
|
+
end
|
15
|
+
|
16
|
+
describe '#base' do
|
17
|
+
its(:base) { should be base }
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#full_message' do
|
21
|
+
subject { reporter.full_message attribute, message }
|
22
|
+
let(:attribute) { :first_name }
|
23
|
+
let(:message) { 'is invalid' }
|
24
|
+
|
25
|
+
it { should == 'First name is invalid' }
|
26
|
+
end
|
27
|
+
|
28
|
+
describe '#full_messages' do
|
29
|
+
subject { reporter.full_messages }
|
30
|
+
let(:expected) do
|
31
|
+
[
|
32
|
+
'First name is invalid',
|
33
|
+
"First name can't be empty",
|
34
|
+
'Last name is invalid'
|
35
|
+
]
|
36
|
+
end
|
37
|
+
|
38
|
+
before do
|
39
|
+
collection[:first_name] << :invalid
|
40
|
+
collection[:first_name] << :empty
|
41
|
+
collection[:last_name] << :invalid
|
42
|
+
end
|
43
|
+
|
44
|
+
it { should == expected }
|
45
|
+
end
|
46
|
+
|
47
|
+
describe '#generate_message' do
|
48
|
+
subject { reporter.generate_message attribute, type, options }
|
49
|
+
let(:attribute) { :first_name }
|
50
|
+
|
51
|
+
context 'when passing symbols as message' do
|
52
|
+
let(:type) { :too_short }
|
53
|
+
let(:options) { { count: 3 } }
|
54
|
+
let(:expected) { 'is too short (minimum is 3 characters)' }
|
55
|
+
it { should == expected }
|
56
|
+
end
|
57
|
+
|
58
|
+
context 'when passing strings as message' do
|
59
|
+
let(:type) { 'foo' }
|
60
|
+
let(:options) { nil }
|
61
|
+
let(:expected) { type }
|
62
|
+
it { should == expected }
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe ActiveModel::BetterErrors::MachineArrayReporter do
|
6
|
+
subject { reporter }
|
7
|
+
let(:reporter) { klass.new collection }
|
8
|
+
let(:klass) { ActiveModel::BetterErrors::MachineArrayReporter }
|
9
|
+
let(:collection) { ActiveModel::BetterErrors::ErrorCollection.new base }
|
10
|
+
let(:base) { User.new }
|
11
|
+
|
12
|
+
describe '#initialize' do
|
13
|
+
its(:collection) { should be collection }
|
14
|
+
end
|
15
|
+
|
16
|
+
describe '#base' do
|
17
|
+
its(:base) { should be base }
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#to_a' do
|
21
|
+
subject { reporter.to_a }
|
22
|
+
|
23
|
+
before do
|
24
|
+
collection[:first_name] << :invalid
|
25
|
+
collection[:first_name] << [:too_short, { count: 3 }]
|
26
|
+
collection[:last_name] << :invalid
|
27
|
+
end
|
28
|
+
|
29
|
+
let(:expected) do
|
30
|
+
[{
|
31
|
+
attribute: 'first_name',
|
32
|
+
type: :invalid
|
33
|
+
}, {
|
34
|
+
attribute: 'first_name',
|
35
|
+
type: :too_short,
|
36
|
+
options: { count: 3 }
|
37
|
+
}, {
|
38
|
+
attribute: 'last_name',
|
39
|
+
type: :invalid
|
40
|
+
}]
|
41
|
+
end
|
42
|
+
|
43
|
+
it { should == expected }
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe ActiveModel::BetterErrors::MachineHashReporter do
|
6
|
+
subject { reporter }
|
7
|
+
let(:reporter) { klass.new collection }
|
8
|
+
let(:klass) { ActiveModel::BetterErrors::MachineHashReporter }
|
9
|
+
let(:collection) { ActiveModel::BetterErrors::ErrorCollection.new base }
|
10
|
+
let(:base) { User.new }
|
11
|
+
|
12
|
+
describe '#initialize' do
|
13
|
+
its(:collection) { should be collection }
|
14
|
+
end
|
15
|
+
|
16
|
+
describe '#base' do
|
17
|
+
its(:base) { should be base }
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#to_hash' do
|
21
|
+
subject { reporter.to_hash }
|
22
|
+
|
23
|
+
before do
|
24
|
+
collection[:first_name] << :invalid
|
25
|
+
collection[:first_name] << [:too_short, { count: 3 }]
|
26
|
+
collection[:last_name] << :invalid
|
27
|
+
end
|
28
|
+
|
29
|
+
let(:expected) do
|
30
|
+
{
|
31
|
+
first_name: [{
|
32
|
+
type: :invalid
|
33
|
+
}, {
|
34
|
+
type: :too_short,
|
35
|
+
options: { count: 3 }
|
36
|
+
}],
|
37
|
+
last_name: [{
|
38
|
+
type: :invalid
|
39
|
+
}]
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
it { should == expected }
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe ActiveModel::BetterErrors do
|
6
|
+
describe '.set_reporter' do
|
7
|
+
subject { ActiveModel::BetterErrors.reporters[name.to_s] }
|
8
|
+
before { ActiveModel::BetterErrors.set_reporter name, reporter }
|
9
|
+
after { ActiveModel::BetterErrors.set_reporter name, nil }
|
10
|
+
let(:name) { :mock }
|
11
|
+
let(:reporter) { Class.new }
|
12
|
+
it { should be reporter }
|
13
|
+
end
|
14
|
+
|
15
|
+
describe '.reporters' do
|
16
|
+
subject { ActiveModel::BetterErrors.reporters }
|
17
|
+
let(:expected) do
|
18
|
+
{
|
19
|
+
'message' => ActiveModel::BetterErrors::HumanMessageReporter,
|
20
|
+
'array' => ActiveModel::BetterErrors::HumanArrayReporter,
|
21
|
+
'hash' => ActiveModel::BetterErrors::HumanHashReporter
|
22
|
+
}
|
23
|
+
end
|
24
|
+
it { should == expected }
|
25
|
+
end
|
26
|
+
|
27
|
+
describe '.formatter' do
|
28
|
+
subject { ActiveModel::BetterErrors.formatter }
|
29
|
+
it { should == ActiveModel::BetterErrors::HumanMessageFormatter }
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
describe 'ActiveModel Better Errors' do
|
34
|
+
it 'overrides ActiveModel Validations' do
|
35
|
+
User.new.errors.should be_a ActiveModel::BetterErrors::Errors
|
36
|
+
end
|
37
|
+
end
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_model-better_errors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
5
|
-
prerelease:
|
4
|
+
version: 1.6.5
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Aaron Qian
|
@@ -10,265 +9,221 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2014-01-12 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: activemodel
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
|
-
- -
|
18
|
+
- - '>='
|
21
19
|
- !ruby/object:Gem::Version
|
22
20
|
version: '3.0'
|
23
21
|
type: :runtime
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
|
-
- -
|
25
|
+
- - '>='
|
29
26
|
- !ruby/object:Gem::Version
|
30
27
|
version: '3.0'
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
|
-
name:
|
29
|
+
name: bundler
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
|
-
- -
|
32
|
+
- - '>='
|
37
33
|
- !ruby/object:Gem::Version
|
38
34
|
version: '0'
|
39
35
|
type: :development
|
40
36
|
prerelease: false
|
41
37
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
38
|
requirements:
|
44
|
-
- -
|
39
|
+
- - '>='
|
45
40
|
- !ruby/object:Gem::Version
|
46
41
|
version: '0'
|
47
42
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
|
-
requirements:
|
52
|
-
- - ~>
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 2.12.0
|
55
|
-
type: :development
|
56
|
-
prerelease: false
|
57
|
-
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
|
-
requirements:
|
60
|
-
- - ~>
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: 2.12.0
|
63
|
-
- !ruby/object:Gem::Dependency
|
64
|
-
name: pry
|
43
|
+
name: rake
|
65
44
|
requirement: !ruby/object:Gem::Requirement
|
66
|
-
none: false
|
67
45
|
requirements:
|
68
|
-
- -
|
46
|
+
- - '>='
|
69
47
|
- !ruby/object:Gem::Version
|
70
48
|
version: '0'
|
71
49
|
type: :development
|
72
50
|
prerelease: false
|
73
51
|
version_requirements: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
52
|
requirements:
|
76
|
-
- -
|
53
|
+
- - '>='
|
77
54
|
- !ruby/object:Gem::Version
|
78
55
|
version: '0'
|
79
56
|
- !ruby/object:Gem::Dependency
|
80
|
-
name:
|
57
|
+
name: rspec
|
81
58
|
requirement: !ruby/object:Gem::Requirement
|
82
|
-
none: false
|
83
59
|
requirements:
|
84
|
-
- -
|
60
|
+
- - ~>
|
85
61
|
- !ruby/object:Gem::Version
|
86
|
-
version:
|
62
|
+
version: 2.12.0
|
87
63
|
type: :development
|
88
64
|
prerelease: false
|
89
65
|
version_requirements: !ruby/object:Gem::Requirement
|
90
|
-
none: false
|
91
66
|
requirements:
|
92
|
-
- -
|
67
|
+
- - ~>
|
93
68
|
- !ruby/object:Gem::Version
|
94
|
-
version:
|
69
|
+
version: 2.12.0
|
95
70
|
- !ruby/object:Gem::Dependency
|
96
|
-
name:
|
71
|
+
name: mocha
|
97
72
|
requirement: !ruby/object:Gem::Requirement
|
98
|
-
none: false
|
99
73
|
requirements:
|
100
|
-
- -
|
74
|
+
- - '>='
|
101
75
|
- !ruby/object:Gem::Version
|
102
|
-
version:
|
76
|
+
version: 0.12.1
|
103
77
|
type: :development
|
104
78
|
prerelease: false
|
105
79
|
version_requirements: !ruby/object:Gem::Requirement
|
106
|
-
none: false
|
107
80
|
requirements:
|
108
|
-
- -
|
81
|
+
- - '>='
|
109
82
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
83
|
+
version: 0.12.1
|
111
84
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
85
|
+
name: simplecov
|
113
86
|
requirement: !ruby/object:Gem::Requirement
|
114
|
-
none: false
|
115
87
|
requirements:
|
116
|
-
- -
|
88
|
+
- - '>='
|
117
89
|
- !ruby/object:Gem::Version
|
118
90
|
version: '0'
|
119
91
|
type: :development
|
120
92
|
prerelease: false
|
121
93
|
version_requirements: !ruby/object:Gem::Requirement
|
122
|
-
none: false
|
123
94
|
requirements:
|
124
|
-
- -
|
95
|
+
- - '>='
|
125
96
|
- !ruby/object:Gem::Version
|
126
97
|
version: '0'
|
127
98
|
- !ruby/object:Gem::Dependency
|
128
|
-
name:
|
99
|
+
name: yard
|
129
100
|
requirement: !ruby/object:Gem::Requirement
|
130
|
-
none: false
|
131
101
|
requirements:
|
132
|
-
- -
|
102
|
+
- - '>='
|
133
103
|
- !ruby/object:Gem::Version
|
134
104
|
version: '0'
|
135
105
|
type: :development
|
136
106
|
prerelease: false
|
137
107
|
version_requirements: !ruby/object:Gem::Requirement
|
138
|
-
none: false
|
139
108
|
requirements:
|
140
|
-
- -
|
109
|
+
- - '>='
|
141
110
|
- !ruby/object:Gem::Version
|
142
111
|
version: '0'
|
143
112
|
- !ruby/object:Gem::Dependency
|
144
|
-
name:
|
113
|
+
name: rdoc
|
145
114
|
requirement: !ruby/object:Gem::Requirement
|
146
|
-
none: false
|
147
115
|
requirements:
|
148
|
-
- -
|
116
|
+
- - '>='
|
149
117
|
- !ruby/object:Gem::Version
|
150
118
|
version: '0'
|
151
119
|
type: :development
|
152
120
|
prerelease: false
|
153
121
|
version_requirements: !ruby/object:Gem::Requirement
|
154
|
-
none: false
|
155
122
|
requirements:
|
156
|
-
- -
|
123
|
+
- - '>='
|
157
124
|
- !ruby/object:Gem::Version
|
158
125
|
version: '0'
|
159
|
-
-
|
160
|
-
name: bcrypt-ruby
|
161
|
-
requirement: !ruby/object:Gem::Requirement
|
162
|
-
none: false
|
163
|
-
requirements:
|
164
|
-
- - ~>
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: 3.0.0
|
167
|
-
type: :development
|
168
|
-
prerelease: false
|
169
|
-
version_requirements: !ruby/object:Gem::Requirement
|
170
|
-
none: false
|
171
|
-
requirements:
|
172
|
-
- - ~>
|
173
|
-
- !ruby/object:Gem::Version
|
174
|
-
version: 3.0.0
|
175
|
-
- !ruby/object:Gem::Dependency
|
176
|
-
name: mocha
|
177
|
-
requirement: !ruby/object:Gem::Requirement
|
178
|
-
none: false
|
179
|
-
requirements:
|
180
|
-
- - ! '>='
|
181
|
-
- !ruby/object:Gem::Version
|
182
|
-
version: 0.12.1
|
183
|
-
type: :development
|
184
|
-
prerelease: false
|
185
|
-
version_requirements: !ruby/object:Gem::Requirement
|
186
|
-
none: false
|
187
|
-
requirements:
|
188
|
-
- - ! '>='
|
189
|
-
- !ruby/object:Gem::Version
|
190
|
-
version: 0.12.1
|
191
|
-
description: ActiveModel::Errors class is not designed for API consumption. This gem
|
192
|
-
allows for that while keeping compatibility with existing rails API.
|
126
|
+
description: API consumable error messages with ActiveModel::Errors drop-in compatibility.
|
193
127
|
email:
|
194
128
|
- aq1018@gmail.com
|
195
129
|
- byronanderson32@gmail.com
|
196
130
|
executables: []
|
197
131
|
extensions: []
|
198
|
-
extra_rdoc_files:
|
199
|
-
- LICENSE.txt
|
200
|
-
- README.md
|
132
|
+
extra_rdoc_files: []
|
201
133
|
files:
|
202
|
-
- .
|
134
|
+
- .gitignore
|
203
135
|
- .gitmodules
|
204
136
|
- .rspec
|
137
|
+
- .ruby-gemset
|
205
138
|
- .travis.yml
|
206
139
|
- Gemfile
|
140
|
+
- Gemfile.devtools
|
141
|
+
- Guardfile
|
207
142
|
- LICENSE.txt
|
208
143
|
- README.md
|
209
144
|
- Rakefile
|
210
|
-
- VERSION
|
211
145
|
- active_model-better_errors.gemspec
|
146
|
+
- config/devtools.yml
|
147
|
+
- config/flay.yml
|
148
|
+
- config/flog.yml
|
149
|
+
- config/mutant.yml
|
150
|
+
- config/reek.yml
|
151
|
+
- config/rubocop.yml
|
152
|
+
- config/yardstick.yml
|
212
153
|
- lib/active_model/better_errors.rb
|
213
|
-
- lib/active_model/
|
214
|
-
- lib/active_model/
|
215
|
-
- lib/active_model/
|
216
|
-
- lib/active_model/
|
217
|
-
- lib/active_model/
|
218
|
-
- lib/active_model/
|
219
|
-
- lib/active_model/
|
220
|
-
- lib/active_model/
|
221
|
-
- lib/active_model/
|
222
|
-
- lib/active_model/
|
223
|
-
- lib/active_model/
|
224
|
-
- lib/active_model/
|
225
|
-
- lib/active_model/
|
226
|
-
- lib/active_model/
|
227
|
-
- lib/active_model/
|
228
|
-
- lib/active_model/
|
229
|
-
- lib/active_model/
|
230
|
-
- spec/lib/active_model/better_errors_spec.rb
|
231
|
-
- spec/lib/active_model/error_collecting/emulation_spec.rb
|
232
|
-
- spec/lib/active_model/error_collecting/error_collection_spec.rb
|
233
|
-
- spec/lib/active_model/error_collecting/error_message_set_spec.rb
|
234
|
-
- spec/lib/active_model/error_collecting/error_message_spec.rb
|
235
|
-
- spec/lib/active_model/error_collecting/errors_spec.rb
|
236
|
-
- spec/lib/active_model/error_collecting/human_array_reporter_spec.rb
|
237
|
-
- spec/lib/active_model/error_collecting/human_hash_reporter_spec.rb
|
238
|
-
- spec/lib/active_model/error_collecting/human_message_formatter_spec.rb
|
239
|
-
- spec/lib/active_model/error_collecting/human_message_reporter_spec.rb
|
240
|
-
- spec/lib/active_model/error_collecting/machine_array_reporter_spec.rb
|
241
|
-
- spec/lib/active_model/error_collecting/machine_hash_reporter_spec.rb
|
242
|
-
- spec/lib/active_model/error_collecting_spec.rb
|
154
|
+
- lib/active_model/better_errors/array_reporter.rb
|
155
|
+
- lib/active_model/better_errors/emulation.rb
|
156
|
+
- lib/active_model/better_errors/error_collection.rb
|
157
|
+
- lib/active_model/better_errors/error_message.rb
|
158
|
+
- lib/active_model/better_errors/error_message_set.rb
|
159
|
+
- lib/active_model/better_errors/errors.rb
|
160
|
+
- lib/active_model/better_errors/formatter.rb
|
161
|
+
- lib/active_model/better_errors/hash_reporter.rb
|
162
|
+
- lib/active_model/better_errors/human_array_reporter.rb
|
163
|
+
- lib/active_model/better_errors/human_hash_reporter.rb
|
164
|
+
- lib/active_model/better_errors/human_message_formatter.rb
|
165
|
+
- lib/active_model/better_errors/human_message_reporter.rb
|
166
|
+
- lib/active_model/better_errors/machine_array_reporter.rb
|
167
|
+
- lib/active_model/better_errors/machine_hash_reporter.rb
|
168
|
+
- lib/active_model/better_errors/message_reporter.rb
|
169
|
+
- lib/active_model/better_errors/reporter.rb
|
170
|
+
- lib/active_model/better_errors/version.rb
|
243
171
|
- spec/spec_helper.rb
|
172
|
+
- spec/support/i18n_deprecation_silence.rb
|
244
173
|
- spec/support/models.rb
|
245
|
-
-
|
174
|
+
- spec/support/string_ext.rb
|
175
|
+
- spec/unit/lib/active_model/better_errors/emulation_spec.rb
|
176
|
+
- spec/unit/lib/active_model/better_errors/error_collection_spec.rb
|
177
|
+
- spec/unit/lib/active_model/better_errors/error_message_set_spec.rb
|
178
|
+
- spec/unit/lib/active_model/better_errors/error_message_spec.rb
|
179
|
+
- spec/unit/lib/active_model/better_errors/errors_spec.rb
|
180
|
+
- spec/unit/lib/active_model/better_errors/human_array_reporter_spec.rb
|
181
|
+
- spec/unit/lib/active_model/better_errors/human_hash_reporter_spec.rb
|
182
|
+
- spec/unit/lib/active_model/better_errors/human_message_formatter_spec.rb
|
183
|
+
- spec/unit/lib/active_model/better_errors/human_message_reporter_spec.rb
|
184
|
+
- spec/unit/lib/active_model/better_errors/machine_array_reporter_spec.rb
|
185
|
+
- spec/unit/lib/active_model/better_errors/machine_hash_reporter_spec.rb
|
186
|
+
- spec/unit/lib/active_model/better_errors_spec.rb
|
246
187
|
homepage: http://github.com/aq1018/active_model-better_errors
|
247
188
|
licenses:
|
248
189
|
- MIT
|
190
|
+
metadata: {}
|
249
191
|
post_install_message:
|
250
192
|
rdoc_options: []
|
251
193
|
require_paths:
|
252
194
|
- lib
|
253
195
|
required_ruby_version: !ruby/object:Gem::Requirement
|
254
|
-
none: false
|
255
196
|
requirements:
|
256
|
-
- -
|
197
|
+
- - '>='
|
257
198
|
- !ruby/object:Gem::Version
|
258
199
|
version: '0'
|
259
|
-
segments:
|
260
|
-
- 0
|
261
|
-
hash: -3324686996559337046
|
262
200
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
263
|
-
none: false
|
264
201
|
requirements:
|
265
|
-
- -
|
202
|
+
- - '>='
|
266
203
|
- !ruby/object:Gem::Version
|
267
204
|
version: '0'
|
268
205
|
requirements: []
|
269
206
|
rubyforge_project:
|
270
|
-
rubygems_version: 1.
|
207
|
+
rubygems_version: 2.1.11
|
271
208
|
signing_key:
|
272
|
-
specification_version:
|
273
|
-
summary:
|
274
|
-
|
209
|
+
specification_version: 4
|
210
|
+
summary: active_model-better_errors is a ActiveModel::Errors compatible library to
|
211
|
+
help you customize the presentation of your error messages.
|
212
|
+
test_files:
|
213
|
+
- spec/spec_helper.rb
|
214
|
+
- spec/support/i18n_deprecation_silence.rb
|
215
|
+
- spec/support/models.rb
|
216
|
+
- spec/support/string_ext.rb
|
217
|
+
- spec/unit/lib/active_model/better_errors/emulation_spec.rb
|
218
|
+
- spec/unit/lib/active_model/better_errors/error_collection_spec.rb
|
219
|
+
- spec/unit/lib/active_model/better_errors/error_message_set_spec.rb
|
220
|
+
- spec/unit/lib/active_model/better_errors/error_message_spec.rb
|
221
|
+
- spec/unit/lib/active_model/better_errors/errors_spec.rb
|
222
|
+
- spec/unit/lib/active_model/better_errors/human_array_reporter_spec.rb
|
223
|
+
- spec/unit/lib/active_model/better_errors/human_hash_reporter_spec.rb
|
224
|
+
- spec/unit/lib/active_model/better_errors/human_message_formatter_spec.rb
|
225
|
+
- spec/unit/lib/active_model/better_errors/human_message_reporter_spec.rb
|
226
|
+
- spec/unit/lib/active_model/better_errors/machine_array_reporter_spec.rb
|
227
|
+
- spec/unit/lib/active_model/better_errors/machine_hash_reporter_spec.rb
|
228
|
+
- spec/unit/lib/active_model/better_errors_spec.rb
|
229
|
+
has_rdoc:
|