Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Jell/method_not_missing
Because Ruby
https://github.com/Jell/method_not_missing
Last synced: 2 months ago
JSON representation
Because Ruby
- Host: GitHub
- URL: https://github.com/Jell/method_not_missing
- Owner: Jell
- License: mit
- Created: 2014-05-19T06:53:30.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2021-04-03T08:49:18.000Z (almost 4 years ago)
- Last Synced: 2024-10-03T09:46:06.509Z (4 months ago)
- Language: Ruby
- Homepage:
- Size: 7.81 KB
- Stars: 33
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Method *not* missing
[![Build Status](https://travis-ci.org/Jell/method_not_missing.svg?branch=master)](https://travis-ci.org/Jell/method_not_missing) [![Gem Version](https://badge.fury.io/rb/method_not_missing.svg)](http://badge.fury.io/rb/method_not_missing)[![Code Climate](https://codeclimate.com/github/Jell/method_not_missing.png)](https://codeclimate.com/github/Jell/method_not_missing)Implements missing methods on the fly by googling their implementation
on rubydoc.info. Because Ruby.Instance variables are added when needed and missing classes are also
declared at runtime.There's some backtracking if the implementation found raises an error
(like stack overflows) or if a nested method lookup fails.# Installation
```sh
gem install method_not_missing
```## External dependencies
- PhantomJS ( `brew install phantomjs` on OSX )
# Example
```ruby
require "method_not_missing"object = MethodNotMissing::OmnipotentObject.new
object.update([3])
## Googling...
#=> [3]
object.update([4])
#=> [3, 4]
object.inspect
#=> #
```# Future work:
- Type Safety: since we get the arity of the requested function, we
could filter out the ones with the wrong number of argument. This is
implemented with exception-driven backtracking on ArgumentErrors
right now.- Enterprise
## Contributing
1. Fork it ( https://github.com/[my-github-username]/method_not_missing/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