• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ruby-grape / grape / 12515799369

27 Dec 2024 12:02PM UTC coverage: 98.335% (+0.5%) from 97.809%
12515799369

push

github

web-flow
Dynamic registration (#2516)

* use `to_enum` instead of including `Enumerable` to attributes_iterator.rb and validation_errors.rb

* Remove unused build_coercer.rb

* Remove const_missing in api.rb

* Add Grape::Util::Registry
Add deregister module in spec

* Add Grape::Parser::Base and use Grape::Util::Registry

* Add Grape::Formatter::Base and use Grape::Util::Registry

* Add Grape::Middleware::Versioner::Base and use Grape::Util::Registry

* Add Grape::ErrorFormatter::Base and use Grape::Util::Registry

* Add Grape::Util::Registry to Grape::Validations
ContractScope validator has been moved to validations/validators and renamed properly

* Add `deregister in `before(:all)``

* Add `deregister` to Grape::Validations only

* Use `prepend`

* Fix Ruby 2.7
Fix rubocop

* Refactor collection_coercer_for
Refactor Grape::Validations::Types cache_key

* Add CHANGELOG.md

* Revert coercer_cache changes. Will do it another time

* Revert enumerable change

* Refactor registry

* Update CHANGELOG.md

Co-authored-by: Daniel (dB.) Doubrovkine <dblock@dblock.org>

---------

Co-authored-by: Daniel (dB.) Doubrovkine <dblock@dblock.org>

194 of 199 new or added lines in 27 files covered. (97.49%)

3544 of 3604 relevant lines covered (98.34%)

62111.55 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.5
/lib/grape/formatter/base.rb
1
# frozen_string_literal: true
2

3
module Grape
51✔
4
  module Formatter
51✔
5
    class Base
51✔
6
      def self.call(_object, _env)
51✔
NEW
7
        raise NotImplementedError
×
8
      end
9

10
      def self.inherited(klass)
51✔
11
        super
204✔
12
        Formatter.register(klass)
204✔
13
      end
14
    end
15
  end
16
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc