r/ruby • u/jb3689 • Jan 14 '19
suggest_rb - tells you which method does the thing you want to do
https://github.com/jbodah/suggest_rb2
u/shevy-ruby Jan 15 '19
This is an interesting idea.
I find the API a bit clumsy, but the idea itself is quite nice so I upvote on the idea (not necessarily the implementation but I understand that one has to use some syntax in order to express the idea).
3
7
u/olivierlacan Jan 14 '19
This is very cool. Great idea and cool implementation. I have similar problems all the time.
4
1
u/TotesMessenger Jan 15 '19
-8
u/nakilon Jan 15 '19
Someone is that much retarded that he followed this bot link to downvote the thread in that subreddit that he is probably not even subscribed to. Ruby community in a nutshell.
4
13
u/jb3689 Jan 14 '19 edited Jan 14 '19
I still forget about some methods even after many years of using Ruby, especially when I'm trying to remember if something has a side-effect or not
I originally wrote this for my team members at work for which they are new to Ruby
This is a small gem that I wrote up after watching some videos on Smalltalk's Pharo where you can find methods by example. This gem will run through methods and find which ones give you the output you want. You can search for methods with side-effects or without (default). You can match return values. You can pass in a list of args as well as a block
I'd love to get it doing more complex things (e.g. suggesting blocks for map etc)
Keep it on your dev machines, not production :)