Project

uptyped

0.01
No release in over 3 years
Low commit activity in last 3 years
Adds tests to enforce that interface is only inherited from superclass unless superclass is Object.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
~> 10.3

Runtime

~> 2.0
 Project Readme

Uptyped

This gem enforces interface matching. When configured, any class that inherits from something other than Object will have tests added to make sure that the public class and instance methods match the parent class for naming and arity. This is done through testing so that there is no need for running unnecessary code during production.

Please only use inheritance when it is truly appropriate.

Installation

Add this line to your application's Gemfile:

gem 'uptyped'

And then execute:

$ bundle

Or install it yourself as:

$ gem install uptyped

Usage

require 'uptyped'

RSpec.configure do |config|
  config.include Uptyped::InheritedInterface
end

ToDo

• Come up with a new name.

• Improve configuration

• Allow for white-listing of classes/namespaces?

Contributing

  1. Fork it ( https://github.com/sendgrid/uptyped/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request