Code Monkey home page Code Monkey logo

interloper's People

Contributors

afred avatar

Watchers

 avatar

interloper's Issues

Fix LocalJumpError: no block given

Background: this is happening when .inherit_callbacks_for :some_method is called in a child class, but only one of the before or after callbacks is defined in the parent. This causes the child class to end up with a callback that is nil.

Done when: child class can call inherit_callbacks_for :some_method where only the before (or after) callback is defined in the parent, and it will inherit the defined callback without throwing a LocalJumpError: no block given.

Callbacks not being called for non-anonymous subclasses

Callbacks are being called for anonymous subclasses generated with test_class_factory method in our tests, but once we try to use non-anonymous classes, any callbacks defined on a subclass are not being called.

Done when: callbacks defined on a subclass are called, when the subclass and it's parent have actual constant names (i.e. are not anonymous).

Allow running a callback just once (or maybe N times?)

One use case for this is when you want to log an error or warning under certain circumstances when a method is called, but you only want to log it on the first time, and not on every subsequent time.

This could be implemented either with a parmeter, or as a new class method...

# as a parameter
before(:foo, times: 1) do
  # ...
end

# as a class method...
once_before(:foo) do
  # ...
end

Done when: can run a callback just once for a given method call.

Fix some YARD method documentation

Done when:

  • make sure types of params and return values are enclosed in square brackets.
  • add @private to methods that don't need to be doc'd (i think this is how it works anyway).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.