mercy 1.5.0 → 2.0.0
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.
- checksums.yaml +5 -5
- data/.circleci/config.yml +89 -9
- data/.claude/agents/architect.md +48 -0
- data/.claude/agents/infra.md +36 -0
- data/.claude/agents/ruby.md +45 -0
- data/.claude/configuration/arcanum-repo-config.json +3 -0
- data/.claude/scripts/check_infra.sh +6 -0
- data/.claude/scripts/check_ruby.sh +7 -0
- data/.claude/settings.json +10 -0
- data/.github/commit_message_template-2.0.md +32 -0
- data/.github/commit_message_template.md +10 -0
- data/.github/copilot-instructions.md +1 -0
- data/.github/pull_request_template.md +17 -0
- data/.gitignore +8 -0
- data/.rubocop.yml +39 -0
- data/.rubocop_todo.yml +60 -0
- data/AGENTS.md +58 -0
- data/CLAUDE.md +1 -0
- data/Dockerfile +21 -0
- data/Gemfile +26 -1
- data/README.md +13 -4
- data/Rakefile +11 -3
- data/config/check_specs.yml +7 -0
- data/config/rubycritc.rb +12 -0
- data/config/yardstick.rb +13 -0
- data/config/yardstick.yml +41 -0
- data/docker-compose.yml +14 -9
- data/docs/agents/arcanum-split-issue.md +9 -0
- data/docs/agents/architecture.md +61 -0
- data/docs/agents/contributing.md +195 -0
- data/docs/agents/flow.md +5 -0
- data/docs/agents/folder-structure.md +26 -0
- data/docs/agents/issue-enhancement.md +10 -0
- data/docs/agents/issues/.gitkeep +1 -0
- data/docs/agents/plans/.gitkeep +1 -0
- data/lib/arstotzka/type_cast_ext.rb +52 -2
- data/lib/mercy/class_methods.rb +77 -7
- data/lib/mercy/concern.rb +105 -1
- data/lib/mercy/period_parser.rb +46 -3
- data/lib/mercy/report/active_record.rb +20 -16
- data/lib/mercy/report/error.rb +6 -4
- data/lib/mercy/report/multiple.rb +26 -22
- data/lib/mercy/report/range.rb +6 -4
- data/lib/mercy/report.rb +38 -7
- data/lib/mercy/report_builder.rb +2 -0
- data/lib/mercy/report_config.rb +5 -0
- data/lib/mercy/status.rb +7 -1
- data/lib/mercy/status_builder.rb +2 -0
- data/lib/mercy/version.rb +3 -1
- data/lib/mercy.rb +2 -0
- data/mercy.gemspec +19 -25
- data/scripts/bump_version.sh +62 -0
- data/scripts/check_readme.sh +6 -0
- data/scripts/rubycritic.sh +10 -0
- data/spec/dummy/.ruby-version +1 -0
- data/spec/dummy/Rakefile +10 -0
- data/spec/dummy/app/channels/application_cable/channel.rb +6 -0
- data/spec/dummy/app/channels/application_cable/connection.rb +6 -0
- data/spec/dummy/app/controllers/application_controller.rb +4 -0
- data/spec/dummy/app/controllers/concerns/.keep +0 -0
- data/spec/dummy/app/controllers/document_report_controller.rb +34 -0
- data/spec/dummy/app/controllers/example_report_controller.rb +27 -0
- data/spec/dummy/app/helpers/application_helper.rb +4 -0
- data/spec/dummy/app/jobs/application_job.rb +4 -0
- data/spec/dummy/app/mailers/application_mailer.rb +6 -0
- data/spec/dummy/app/models/application_record.rb +5 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/models/document.rb +9 -0
- data/spec/dummy/app/models/dummy_report.rb +6 -0
- data/spec/dummy/app/models/mercy/report/doc_type_error.rb +20 -0
- data/spec/dummy/app/models/mercy/report/dummy1.rb +19 -0
- data/spec/dummy/app/models/mercy/report/dummy_report.rb +11 -0
- data/spec/dummy/app/models/mercy/report/multiple/dummy.rb +28 -0
- data/spec/dummy/app/models/mercy/report/multiple/successes.rb +28 -0
- data/spec/dummy/app/models/mercy/report/success.rb +18 -0
- data/spec/dummy/app/views/layouts/application.html.erb +15 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/bin/bundle +5 -0
- data/spec/dummy/bin/rails +6 -0
- data/spec/dummy/bin/rake +6 -0
- data/spec/dummy/bin/setup +38 -0
- data/spec/dummy/bin/update +33 -0
- data/spec/dummy/bin/yarn +11 -0
- data/spec/dummy/config/application.rb +24 -0
- data/spec/dummy/config/boot.rb +7 -0
- data/spec/dummy/config/cable.yml +10 -0
- data/spec/dummy/config/database.yml +20 -0
- data/spec/dummy/config/environment.rb +7 -0
- data/spec/dummy/config/environments/development.rb +55 -0
- data/spec/dummy/config/environments/production.rb +95 -0
- data/spec/dummy/config/environments/test.rb +52 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +10 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +9 -0
- data/spec/dummy/config/initializers/content_security_policy.rb +27 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +7 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +6 -0
- data/spec/dummy/config/initializers/inflections.rb +18 -0
- data/spec/dummy/config/initializers/mime_types.rb +6 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +16 -0
- data/spec/dummy/config/locales/en.yml +33 -0
- data/spec/dummy/config/puma.rb +36 -0
- data/spec/dummy/config/routes.rb +16 -0
- data/spec/dummy/config/spring.rb +8 -0
- data/spec/dummy/config/storage.yml +34 -0
- data/spec/dummy/config.ru +7 -0
- data/spec/dummy/db/migrate/20190508170435_create_documents.rb +13 -0
- data/spec/dummy/db/schema.rb +27 -0
- data/spec/dummy/log/.keep +0 -0
- data/spec/dummy/package.json +5 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/storage/.keep +0 -0
- data/spec/dummy/tmp/.keep +0 -0
- data/spec/dummy/tmp/storage/.keep +0 -0
- data/spec/integration/controller/error_report_controller_spec.rb +196 -0
- data/spec/integration/controller/multiple_report_spec.rb +86 -0
- data/spec/integration/controller/range_report_spec.rb +194 -0
- data/spec/integration/yard/arstotzka/type_cast_spec.rb +43 -0
- data/spec/integration/yard/controller/example_report_controller_spec.rb +95 -0
- data/spec/integration/yard/mercy/period_parser_spec.rb +21 -0
- data/spec/lib/arstotzka/type_cast_spec.rb +10 -9
- data/spec/lib/mercy/period_parser_spec.rb +10 -9
- data/spec/lib/mercy/report/error_spec.rb +93 -70
- data/spec/lib/mercy/report/multiple_spec.rb +9 -57
- data/spec/lib/mercy/report/range_spec.rb +70 -41
- data/spec/lib/mercy/report_builder_spec.rb +34 -17
- data/spec/lib/mercy/report_config_spec.rb +48 -0
- data/spec/lib/mercy/report_spec.rb +5 -15
- data/spec/lib/mercy/status_builder_spec.rb +33 -22
- data/spec/lib/mercy/status_spec.rb +69 -49
- data/spec/spec_helper.rb +18 -7
- data/spec/support/fixture_helpers.rb +4 -2
- data/spec/support/models/arstotzka/type_cast/dummy.rb +9 -0
- data/spec/support/shared_contexts/document_setup.rb +31 -0
- data/spec/support/shared_examples/time_parser.rb +2 -0
- metadata +123 -109
- data/spec/lib/mercy/report/report_config_spec.rb +0 -39
- data/spec/support/models/document.rb +0 -6
- data/spec/support/report/dummy.rb +0 -15
- data/spec/support/schema.rb +0 -11
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'spec_helper'
|
|
2
4
|
|
|
3
5
|
describe Mercy::Status do
|
|
6
|
+
subject { described_class.new(reports) }
|
|
7
|
+
|
|
4
8
|
let(:threshold) { 0.02 }
|
|
5
|
-
let(:period)
|
|
9
|
+
let(:period) { 1.day }
|
|
6
10
|
let(:report_options) do
|
|
7
11
|
{
|
|
8
12
|
period: period,
|
|
@@ -19,13 +23,13 @@ describe Mercy::Status do
|
|
|
19
23
|
)
|
|
20
24
|
end
|
|
21
25
|
let(:errors) { 0 }
|
|
22
|
-
let(:successes)
|
|
26
|
+
let(:successes) { 1 }
|
|
23
27
|
let(:error_report) { Mercy::Report::Error.new(report_options) }
|
|
24
28
|
let(:success_report) do
|
|
25
29
|
Mercy::Report::Error.new(success_options)
|
|
26
30
|
end
|
|
27
|
-
let(:reports) { [
|
|
28
|
-
|
|
31
|
+
let(:reports) { [error_report] }
|
|
32
|
+
|
|
29
33
|
before do
|
|
30
34
|
Document.all.each(&:destroy)
|
|
31
35
|
errors.times { Document.create status: :error }
|
|
@@ -34,7 +38,7 @@ describe Mercy::Status do
|
|
|
34
38
|
|
|
35
39
|
describe '#as_json' do
|
|
36
40
|
let(:status_json) { subject.as_json }
|
|
37
|
-
let(:status)
|
|
41
|
+
let(:status) { status_json[:status] }
|
|
38
42
|
|
|
39
43
|
context 'when report is ok' do
|
|
40
44
|
it 'returns a json with ok' do
|
|
@@ -42,7 +46,7 @@ describe Mercy::Status do
|
|
|
42
46
|
end
|
|
43
47
|
|
|
44
48
|
it 'returns the report json' do
|
|
45
|
-
|
|
49
|
+
expect(status_json[:errors]).to eq(error_report.as_json)
|
|
46
50
|
end
|
|
47
51
|
end
|
|
48
52
|
|
|
@@ -58,18 +62,61 @@ describe Mercy::Status do
|
|
|
58
62
|
let(:success_report) do
|
|
59
63
|
Mercy::Report::Error.new(report_options.merge(scope: :with_success))
|
|
60
64
|
end
|
|
61
|
-
let(:reports) { [
|
|
65
|
+
let(:reports) { [success_report, error_report] }
|
|
62
66
|
|
|
63
67
|
it 'returns a json with error' do
|
|
64
68
|
expect(status).to eq(:error)
|
|
65
69
|
end
|
|
66
70
|
end
|
|
71
|
+
|
|
72
|
+
context 'when building the full summary' do
|
|
73
|
+
let(:errors) { 3 }
|
|
74
|
+
let(:ids) { Document.with_error.map(&:id) }
|
|
75
|
+
let(:expected) do
|
|
76
|
+
{
|
|
77
|
+
status: :error,
|
|
78
|
+
errors: {
|
|
79
|
+
ids: ids,
|
|
80
|
+
percentage: 0.75,
|
|
81
|
+
status: :error
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
it 'creates a summary of the reports' do
|
|
87
|
+
expect(subject.as_json).to eq(expected)
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
context 'when there are both success and error reports' do
|
|
91
|
+
let(:success_ids) { Document.with_success.map(&:id) }
|
|
92
|
+
let(:expected) do
|
|
93
|
+
{
|
|
94
|
+
status: :error,
|
|
95
|
+
errors: {
|
|
96
|
+
ids: ids,
|
|
97
|
+
percentage: 0.75,
|
|
98
|
+
status: :error
|
|
99
|
+
},
|
|
100
|
+
success: {
|
|
101
|
+
ids: success_ids,
|
|
102
|
+
percentage: 0.25,
|
|
103
|
+
status: :error
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
end
|
|
107
|
+
let(:reports) { [success_report, error_report] }
|
|
108
|
+
|
|
109
|
+
it 'creates a summary of all the reports' do
|
|
110
|
+
expect(subject.as_json).to eq(expected)
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
67
114
|
end
|
|
68
115
|
|
|
69
|
-
describe '#
|
|
116
|
+
describe '#http_status' do
|
|
70
117
|
context 'when report is ok' do
|
|
71
118
|
it do
|
|
72
|
-
expect(subject.
|
|
119
|
+
expect(subject.http_status).to eq(:ok)
|
|
73
120
|
end
|
|
74
121
|
end
|
|
75
122
|
|
|
@@ -77,58 +124,31 @@ describe Mercy::Status do
|
|
|
77
124
|
let(:errors) { 1 }
|
|
78
125
|
|
|
79
126
|
it do
|
|
80
|
-
expect(subject.
|
|
127
|
+
expect(subject.http_status).to eq(:internal_server_error)
|
|
81
128
|
end
|
|
82
129
|
end
|
|
130
|
+
end
|
|
83
131
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
132
|
+
describe '#status' do
|
|
133
|
+
context 'when report is ok' do
|
|
87
134
|
it do
|
|
88
|
-
expect(subject.status).to eq(:
|
|
135
|
+
expect(subject.status).to eq(:ok)
|
|
89
136
|
end
|
|
90
137
|
end
|
|
91
|
-
end
|
|
92
138
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
let(:ids) { Document.with_error.map(&:id) }
|
|
96
|
-
let(:expected) do
|
|
97
|
-
{
|
|
98
|
-
status: :error,
|
|
99
|
-
errors: {
|
|
100
|
-
ids: ids,
|
|
101
|
-
percentage: 0.75,
|
|
102
|
-
status: :error
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
end
|
|
139
|
+
context 'when report is not ok' do
|
|
140
|
+
let(:errors) { 1 }
|
|
106
141
|
|
|
107
|
-
|
|
108
|
-
|
|
142
|
+
it do
|
|
143
|
+
expect(subject.status).to eq(:error)
|
|
144
|
+
end
|
|
109
145
|
end
|
|
110
146
|
|
|
111
147
|
context 'when there are both success and error reports' do
|
|
112
|
-
let(:
|
|
113
|
-
let(:expected) do
|
|
114
|
-
{
|
|
115
|
-
status: :error,
|
|
116
|
-
errors: {
|
|
117
|
-
ids: ids,
|
|
118
|
-
percentage: 0.75,
|
|
119
|
-
status: :error
|
|
120
|
-
},
|
|
121
|
-
success: {
|
|
122
|
-
ids: success_ids,
|
|
123
|
-
percentage: 0.25,
|
|
124
|
-
status: :error
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
end
|
|
128
|
-
let(:reports) { [ success_report, error_report ] }
|
|
148
|
+
let(:reports) { [success_report, error_report] }
|
|
129
149
|
|
|
130
|
-
it
|
|
131
|
-
expect(subject.
|
|
150
|
+
it do
|
|
151
|
+
expect(subject.status).to eq(:error)
|
|
132
152
|
end
|
|
133
153
|
end
|
|
134
154
|
end
|
data/spec/spec_helper.rb
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'simplecov'
|
|
4
|
+
require 'simplecov-lcov'
|
|
5
|
+
|
|
6
|
+
if ENV['CI']
|
|
7
|
+
SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true
|
|
8
|
+
SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter
|
|
9
|
+
end
|
|
2
10
|
|
|
3
11
|
SimpleCov.profiles.define 'gem' do
|
|
4
12
|
add_filter '/spec/'
|
|
@@ -10,19 +18,22 @@ require 'pry-nav'
|
|
|
10
18
|
require 'mercy'
|
|
11
19
|
|
|
12
20
|
require 'active_record'
|
|
13
|
-
ActiveRecord::Base.establish_connection(
|
|
21
|
+
ActiveRecord::Base.establish_connection(
|
|
22
|
+
adapter: 'sqlite3', database: ':memory:'
|
|
23
|
+
)
|
|
14
24
|
|
|
15
|
-
|
|
16
|
-
|
|
25
|
+
require File.expand_path('spec/dummy/config/environment')
|
|
26
|
+
require File.expand_path('spec/dummy/db/schema.rb')
|
|
27
|
+
require 'rspec/rails'
|
|
28
|
+
require 'active_support/railtie'
|
|
29
|
+
|
|
30
|
+
support_files = File.expand_path('spec/support/**/*.rb')
|
|
31
|
+
Dir[support_files].each { |file| require file }
|
|
17
32
|
|
|
18
33
|
RSpec.configure do |config|
|
|
19
|
-
config.treat_symbols_as_metadata_keys_with_true_values = true
|
|
20
34
|
config.run_all_when_everything_filtered = true
|
|
21
35
|
config.filter_run :focus
|
|
22
36
|
config.filter_run_excluding :integration unless ENV['ALL']
|
|
23
37
|
|
|
24
38
|
config.order = 'random'
|
|
25
|
-
|
|
26
|
-
config.before do
|
|
27
|
-
end
|
|
28
39
|
end
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'active_support'
|
|
2
4
|
|
|
3
5
|
module FixtureHelpers
|
|
4
6
|
def load_fixture_file(filename)
|
|
5
|
-
|
|
7
|
+
File.read ['./spec/', 'fixtures', filename].join('/')
|
|
6
8
|
end
|
|
7
9
|
|
|
8
10
|
def load_json_fixture_file(filename)
|
|
@@ -12,7 +14,7 @@ module FixtureHelpers
|
|
|
12
14
|
private
|
|
13
15
|
|
|
14
16
|
def cached_json_fixture_file(filename)
|
|
15
|
-
|
|
17
|
+
ActiveSupport::JSON.decode(load_fixture_file(filename))
|
|
16
18
|
end
|
|
17
19
|
end
|
|
18
20
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
RSpec.shared_context 'with documents setup' do
|
|
4
|
+
let(:a_successes) { 0 }
|
|
5
|
+
let(:b_successes) { 0 }
|
|
6
|
+
let(:c_successes) { 0 }
|
|
7
|
+
let(:a_errors) { 0 }
|
|
8
|
+
let(:b_errors) { 0 }
|
|
9
|
+
let(:c_errors) { 0 }
|
|
10
|
+
|
|
11
|
+
let(:setup) do
|
|
12
|
+
{
|
|
13
|
+
success: { a: a_successes, b: b_successes, c: c_successes },
|
|
14
|
+
error: { a: a_errors, b: b_errors, c: c_errors }
|
|
15
|
+
}
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
before do
|
|
19
|
+
Document.delete_all
|
|
20
|
+
|
|
21
|
+
setup.each do |status, map|
|
|
22
|
+
map.each do |doc_type, quantity|
|
|
23
|
+
quantity.times do
|
|
24
|
+
Document.create(
|
|
25
|
+
status: status, doc_type: doc_type, external_id: Document.count
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mercy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Darthjee
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: activesupport
|
|
@@ -16,140 +15,56 @@ dependencies:
|
|
|
16
15
|
requirements:
|
|
17
16
|
- - "~>"
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
18
|
+
version: 7.2.x
|
|
20
19
|
type: :runtime
|
|
21
20
|
prerelease: false
|
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
22
|
requirements:
|
|
24
23
|
- - "~>"
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
|
-
version:
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: darthjee-active_ext
|
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
|
30
|
-
requirements:
|
|
31
|
-
- - ">="
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: 1.3.1
|
|
34
|
-
type: :runtime
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
-
requirements:
|
|
38
|
-
- - ">="
|
|
39
|
-
- !ruby/object:Gem::Version
|
|
40
|
-
version: 1.3.1
|
|
25
|
+
version: 7.2.x
|
|
41
26
|
- !ruby/object:Gem::Dependency
|
|
42
27
|
name: arstotzka
|
|
43
28
|
requirement: !ruby/object:Gem::Requirement
|
|
44
29
|
requirements:
|
|
45
30
|
- - ">="
|
|
46
31
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: 1.
|
|
32
|
+
version: 1.6.2
|
|
48
33
|
type: :runtime
|
|
49
34
|
prerelease: false
|
|
50
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
36
|
requirements:
|
|
52
37
|
- - ">="
|
|
53
38
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 1.
|
|
55
|
-
- !ruby/object:Gem::Dependency
|
|
56
|
-
name: activerecord
|
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
|
58
|
-
requirements:
|
|
59
|
-
- - "~>"
|
|
60
|
-
- !ruby/object:Gem::Version
|
|
61
|
-
version: 5.x
|
|
62
|
-
type: :development
|
|
63
|
-
prerelease: false
|
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
-
requirements:
|
|
66
|
-
- - "~>"
|
|
67
|
-
- !ruby/object:Gem::Version
|
|
68
|
-
version: 5.x
|
|
69
|
-
- !ruby/object:Gem::Dependency
|
|
70
|
-
name: sqlite3
|
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
|
72
|
-
requirements:
|
|
73
|
-
- - ">="
|
|
74
|
-
- !ruby/object:Gem::Version
|
|
75
|
-
version: '0'
|
|
76
|
-
type: :development
|
|
77
|
-
prerelease: false
|
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
-
requirements:
|
|
80
|
-
- - ">="
|
|
81
|
-
- !ruby/object:Gem::Version
|
|
82
|
-
version: '0'
|
|
83
|
-
- !ruby/object:Gem::Dependency
|
|
84
|
-
name: bundler
|
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
|
86
|
-
requirements:
|
|
87
|
-
- - ">="
|
|
88
|
-
- !ruby/object:Gem::Version
|
|
89
|
-
version: '0'
|
|
90
|
-
type: :development
|
|
91
|
-
prerelease: false
|
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
-
requirements:
|
|
94
|
-
- - ">="
|
|
95
|
-
- !ruby/object:Gem::Version
|
|
96
|
-
version: '0'
|
|
39
|
+
version: 1.6.2
|
|
97
40
|
- !ruby/object:Gem::Dependency
|
|
98
|
-
name:
|
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
|
100
|
-
requirements:
|
|
101
|
-
- - ">="
|
|
102
|
-
- !ruby/object:Gem::Version
|
|
103
|
-
version: '0'
|
|
104
|
-
type: :development
|
|
105
|
-
prerelease: false
|
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
-
requirements:
|
|
108
|
-
- - ">="
|
|
109
|
-
- !ruby/object:Gem::Version
|
|
110
|
-
version: '0'
|
|
111
|
-
- !ruby/object:Gem::Dependency
|
|
112
|
-
name: rspec
|
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
|
114
|
-
requirements:
|
|
115
|
-
- - ">="
|
|
116
|
-
- !ruby/object:Gem::Version
|
|
117
|
-
version: '0'
|
|
118
|
-
type: :development
|
|
119
|
-
prerelease: false
|
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
-
requirements:
|
|
122
|
-
- - ">="
|
|
123
|
-
- !ruby/object:Gem::Version
|
|
124
|
-
version: '0'
|
|
125
|
-
- !ruby/object:Gem::Dependency
|
|
126
|
-
name: pry-nav
|
|
41
|
+
name: darthjee-active_ext
|
|
127
42
|
requirement: !ruby/object:Gem::Requirement
|
|
128
43
|
requirements:
|
|
129
44
|
- - ">="
|
|
130
45
|
- !ruby/object:Gem::Version
|
|
131
|
-
version:
|
|
132
|
-
type: :
|
|
46
|
+
version: 1.4.0
|
|
47
|
+
type: :runtime
|
|
133
48
|
prerelease: false
|
|
134
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
50
|
requirements:
|
|
136
51
|
- - ">="
|
|
137
52
|
- !ruby/object:Gem::Version
|
|
138
|
-
version:
|
|
53
|
+
version: 1.4.0
|
|
139
54
|
- !ruby/object:Gem::Dependency
|
|
140
|
-
name:
|
|
55
|
+
name: darthjee-core_ext
|
|
141
56
|
requirement: !ruby/object:Gem::Requirement
|
|
142
57
|
requirements:
|
|
143
58
|
- - ">="
|
|
144
59
|
- !ruby/object:Gem::Version
|
|
145
|
-
version:
|
|
146
|
-
type: :
|
|
60
|
+
version: 3.2.0
|
|
61
|
+
type: :runtime
|
|
147
62
|
prerelease: false
|
|
148
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
149
64
|
requirements:
|
|
150
65
|
- - ">="
|
|
151
66
|
- !ruby/object:Gem::Version
|
|
152
|
-
version:
|
|
67
|
+
version: 3.2.0
|
|
153
68
|
description: Gem for easy health check
|
|
154
69
|
email:
|
|
155
70
|
- darthjee@gmail.com
|
|
@@ -158,13 +73,41 @@ extensions: []
|
|
|
158
73
|
extra_rdoc_files: []
|
|
159
74
|
files:
|
|
160
75
|
- ".circleci/config.yml"
|
|
76
|
+
- ".claude/agents/architect.md"
|
|
77
|
+
- ".claude/agents/infra.md"
|
|
78
|
+
- ".claude/agents/ruby.md"
|
|
79
|
+
- ".claude/configuration/arcanum-repo-config.json"
|
|
80
|
+
- ".claude/scripts/check_infra.sh"
|
|
81
|
+
- ".claude/scripts/check_ruby.sh"
|
|
82
|
+
- ".claude/settings.json"
|
|
83
|
+
- ".github/commit_message_template-2.0.md"
|
|
84
|
+
- ".github/commit_message_template.md"
|
|
85
|
+
- ".github/copilot-instructions.md"
|
|
86
|
+
- ".github/pull_request_template.md"
|
|
161
87
|
- ".gitignore"
|
|
162
88
|
- ".rspec"
|
|
89
|
+
- ".rubocop.yml"
|
|
90
|
+
- ".rubocop_todo.yml"
|
|
91
|
+
- AGENTS.md
|
|
92
|
+
- CLAUDE.md
|
|
93
|
+
- Dockerfile
|
|
163
94
|
- Gemfile
|
|
164
95
|
- LICENSE
|
|
165
96
|
- README.md
|
|
166
97
|
- Rakefile
|
|
98
|
+
- config/check_specs.yml
|
|
99
|
+
- config/rubycritc.rb
|
|
100
|
+
- config/yardstick.rb
|
|
101
|
+
- config/yardstick.yml
|
|
167
102
|
- docker-compose.yml
|
|
103
|
+
- docs/agents/arcanum-split-issue.md
|
|
104
|
+
- docs/agents/architecture.md
|
|
105
|
+
- docs/agents/contributing.md
|
|
106
|
+
- docs/agents/flow.md
|
|
107
|
+
- docs/agents/folder-structure.md
|
|
108
|
+
- docs/agents/issue-enhancement.md
|
|
109
|
+
- docs/agents/issues/.gitkeep
|
|
110
|
+
- docs/agents/plans/.gitkeep
|
|
168
111
|
- lib/arstotzka/type_cast_ext.rb
|
|
169
112
|
- lib/mercy.rb
|
|
170
113
|
- lib/mercy/class_methods.rb
|
|
@@ -182,26 +125,99 @@ files:
|
|
|
182
125
|
- lib/mercy/version.rb
|
|
183
126
|
- mercy.gemspec
|
|
184
127
|
- mercy.jpg
|
|
128
|
+
- scripts/bump_version.sh
|
|
129
|
+
- scripts/check_readme.sh
|
|
130
|
+
- scripts/rubycritic.sh
|
|
131
|
+
- spec/dummy/.ruby-version
|
|
132
|
+
- spec/dummy/Rakefile
|
|
133
|
+
- spec/dummy/app/channels/application_cable/channel.rb
|
|
134
|
+
- spec/dummy/app/channels/application_cable/connection.rb
|
|
135
|
+
- spec/dummy/app/controllers/application_controller.rb
|
|
136
|
+
- spec/dummy/app/controllers/concerns/.keep
|
|
137
|
+
- spec/dummy/app/controllers/document_report_controller.rb
|
|
138
|
+
- spec/dummy/app/controllers/example_report_controller.rb
|
|
139
|
+
- spec/dummy/app/helpers/application_helper.rb
|
|
140
|
+
- spec/dummy/app/jobs/application_job.rb
|
|
141
|
+
- spec/dummy/app/mailers/application_mailer.rb
|
|
142
|
+
- spec/dummy/app/models/application_record.rb
|
|
143
|
+
- spec/dummy/app/models/concerns/.keep
|
|
144
|
+
- spec/dummy/app/models/document.rb
|
|
145
|
+
- spec/dummy/app/models/dummy_report.rb
|
|
146
|
+
- spec/dummy/app/models/mercy/report/doc_type_error.rb
|
|
147
|
+
- spec/dummy/app/models/mercy/report/dummy1.rb
|
|
148
|
+
- spec/dummy/app/models/mercy/report/dummy_report.rb
|
|
149
|
+
- spec/dummy/app/models/mercy/report/multiple/dummy.rb
|
|
150
|
+
- spec/dummy/app/models/mercy/report/multiple/successes.rb
|
|
151
|
+
- spec/dummy/app/models/mercy/report/success.rb
|
|
152
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
|
153
|
+
- spec/dummy/app/views/layouts/mailer.html.erb
|
|
154
|
+
- spec/dummy/app/views/layouts/mailer.text.erb
|
|
155
|
+
- spec/dummy/bin/bundle
|
|
156
|
+
- spec/dummy/bin/rails
|
|
157
|
+
- spec/dummy/bin/rake
|
|
158
|
+
- spec/dummy/bin/setup
|
|
159
|
+
- spec/dummy/bin/update
|
|
160
|
+
- spec/dummy/bin/yarn
|
|
161
|
+
- spec/dummy/config.ru
|
|
162
|
+
- spec/dummy/config/application.rb
|
|
163
|
+
- spec/dummy/config/boot.rb
|
|
164
|
+
- spec/dummy/config/cable.yml
|
|
165
|
+
- spec/dummy/config/database.yml
|
|
166
|
+
- spec/dummy/config/environment.rb
|
|
167
|
+
- spec/dummy/config/environments/development.rb
|
|
168
|
+
- spec/dummy/config/environments/production.rb
|
|
169
|
+
- spec/dummy/config/environments/test.rb
|
|
170
|
+
- spec/dummy/config/initializers/application_controller_renderer.rb
|
|
171
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
|
172
|
+
- spec/dummy/config/initializers/content_security_policy.rb
|
|
173
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
|
174
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
|
175
|
+
- spec/dummy/config/initializers/inflections.rb
|
|
176
|
+
- spec/dummy/config/initializers/mime_types.rb
|
|
177
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
|
178
|
+
- spec/dummy/config/locales/en.yml
|
|
179
|
+
- spec/dummy/config/puma.rb
|
|
180
|
+
- spec/dummy/config/routes.rb
|
|
181
|
+
- spec/dummy/config/spring.rb
|
|
182
|
+
- spec/dummy/config/storage.yml
|
|
183
|
+
- spec/dummy/db/migrate/20190508170435_create_documents.rb
|
|
184
|
+
- spec/dummy/db/schema.rb
|
|
185
|
+
- spec/dummy/log/.keep
|
|
186
|
+
- spec/dummy/package.json
|
|
187
|
+
- spec/dummy/public/404.html
|
|
188
|
+
- spec/dummy/public/422.html
|
|
189
|
+
- spec/dummy/public/500.html
|
|
190
|
+
- spec/dummy/public/apple-touch-icon-precomposed.png
|
|
191
|
+
- spec/dummy/public/apple-touch-icon.png
|
|
192
|
+
- spec/dummy/public/favicon.ico
|
|
193
|
+
- spec/dummy/storage/.keep
|
|
194
|
+
- spec/dummy/tmp/.keep
|
|
195
|
+
- spec/dummy/tmp/storage/.keep
|
|
196
|
+
- spec/integration/controller/error_report_controller_spec.rb
|
|
197
|
+
- spec/integration/controller/multiple_report_spec.rb
|
|
198
|
+
- spec/integration/controller/range_report_spec.rb
|
|
199
|
+
- spec/integration/yard/arstotzka/type_cast_spec.rb
|
|
200
|
+
- spec/integration/yard/controller/example_report_controller_spec.rb
|
|
201
|
+
- spec/integration/yard/mercy/period_parser_spec.rb
|
|
185
202
|
- spec/lib/arstotzka/type_cast_spec.rb
|
|
186
203
|
- spec/lib/mercy/period_parser_spec.rb
|
|
187
204
|
- spec/lib/mercy/report/error_spec.rb
|
|
188
205
|
- spec/lib/mercy/report/multiple_spec.rb
|
|
189
206
|
- spec/lib/mercy/report/range_spec.rb
|
|
190
|
-
- spec/lib/mercy/report/report_config_spec.rb
|
|
191
207
|
- spec/lib/mercy/report_builder_spec.rb
|
|
208
|
+
- spec/lib/mercy/report_config_spec.rb
|
|
192
209
|
- spec/lib/mercy/report_spec.rb
|
|
193
210
|
- spec/lib/mercy/status_builder_spec.rb
|
|
194
211
|
- spec/lib/mercy/status_spec.rb
|
|
195
212
|
- spec/spec_helper.rb
|
|
196
213
|
- spec/support/fixture_helpers.rb
|
|
197
|
-
- spec/support/models/
|
|
198
|
-
- spec/support/
|
|
199
|
-
- spec/support/schema.rb
|
|
214
|
+
- spec/support/models/arstotzka/type_cast/dummy.rb
|
|
215
|
+
- spec/support/shared_contexts/document_setup.rb
|
|
200
216
|
- spec/support/shared_examples/time_parser.rb
|
|
201
217
|
homepage: https://github.com/darthjee/mercy
|
|
202
218
|
licenses: []
|
|
203
|
-
metadata:
|
|
204
|
-
|
|
219
|
+
metadata:
|
|
220
|
+
rubygems_mfa_required: 'false'
|
|
205
221
|
rdoc_options: []
|
|
206
222
|
require_paths:
|
|
207
223
|
- lib
|
|
@@ -209,16 +225,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
209
225
|
requirements:
|
|
210
226
|
- - ">="
|
|
211
227
|
- !ruby/object:Gem::Version
|
|
212
|
-
version:
|
|
228
|
+
version: 3.4.0
|
|
213
229
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
214
230
|
requirements:
|
|
215
231
|
- - ">="
|
|
216
232
|
- !ruby/object:Gem::Version
|
|
217
233
|
version: '0'
|
|
218
234
|
requirements: []
|
|
219
|
-
|
|
220
|
-
rubygems_version: 2.6.11
|
|
221
|
-
signing_key:
|
|
235
|
+
rubygems_version: 4.0.23
|
|
222
236
|
specification_version: 4
|
|
223
237
|
summary: Gem for easy health check
|
|
224
238
|
test_files: []
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe Mercy::ReportConfig do
|
|
4
|
-
let(:config) { {} }
|
|
5
|
-
let(:parameters) { {} }
|
|
6
|
-
let(:subject) { described_class.new(config) }
|
|
7
|
-
|
|
8
|
-
describe '#build' do
|
|
9
|
-
context 'when no config is given' do
|
|
10
|
-
it do
|
|
11
|
-
expect(subject.build(parameters)).to be_a(Mercy::Report::Error)
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
context 'when a dummy type is given' do
|
|
16
|
-
let(:config) { { type: :dummy } }
|
|
17
|
-
|
|
18
|
-
it do
|
|
19
|
-
expect(subject.build(parameters)).to be_a(Mercy::Report::Dummy)
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
context 'when a class is given as type' do
|
|
24
|
-
let(:config) { { type: Mercy::Report::Dummy } }
|
|
25
|
-
|
|
26
|
-
it do
|
|
27
|
-
expect(subject.build(parameters)).to be_a(Mercy::Report::Dummy)
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
context 'when a global class is given as type' do
|
|
32
|
-
let(:config) { { type: Dummy } }
|
|
33
|
-
|
|
34
|
-
it do
|
|
35
|
-
expect(subject.build(parameters)).to be_a(Dummy)
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|