The Ruby and Rails community linklog
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
Submit a post
Post Preview
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
Delegating All of The Things With Ruby Forwardable
Refactoring your code is hard. You know your code needs to improve, but you don’t know how to do it. Ruby’s Forwardable module can sometimes be a great solution for refactoring. After you read this post, you might be compelled to delegate all of the things. You’ve been warned!
Organizing Data: Self Encapsulation
First in a series of posts about Refactoring’s “Organizing Data” patterns. I started off with Self Encapsulate Field, not because it’s anything earth-shattering, but because code that doesn’t do it drives me a little bit crazy. Design is Refactoring
Benchmarking doesn't hurt
Benchmarking can be easily forgotten when working on a project, but it’s still very important. Benchmark your whole code, not just isolated calls. It doesn’t have to be complicated and it’s quite easy to set up.
Sink Utility
Sink is a ruby gem that was inspired by the DDoS of github, it was created to help keep its users secure in knowing that their repo is safer as it’s shared among several hosting services rather than one. These current hosting services are bitbucket and github, Sink is early days and contributions are encouraged, as is reporting issue, Thanks. Our Github Our Rubygems Page
Github API from the command line
I created Gitorinox a command line ruby app that lets you interact with Github API. [more inside]
Rack Middleware
Recently I tried to explain how Rack middleware works to a friend and I ended writing this small post on how to add two simple middleware to a Rack application. I hope it’s useful!
Table output generation with tty-table
With tty-table you can create tables to render back to terminal, CSV or any output you fancy. With custom renderers you can style your tables the way you like it. Give it a try and let me know what you think!
cfp for euruko, eurucamp and jrubyconf eu are open
The cfp for euruko, eurucamp and jrubyconf eu have been opened! [more inside]
Better Feedback on Keyword Argument Errors
After tripping over myself for a simple mistake while using keyword arguments, I think we could improve feedback in ArgumentError to help people recover from such mistakes more easily. [more inside]
Understanding the Resque internals – Resque::DirtyExit unveiled
Recently I had to debug Resque jobs failing because of a mysterious Resque::DirtyExit error. The documentation online is not helpful so I thought about sharing what I discovered here. [more inside]
RSpec Subject, Helpers, Hooks and Exception Handling
The first step in learning RSpec is to understand the basic structure of the describe / context + it flow. The next step is to learn the most common helpers to effectively structure your specs. Read the tutorial.
Irbtools 2.0
The IRB tools make using IRB more productive since 2010. [more inside]
Marking records as deleted without removing the data in rails
Do you really need to delete data from you database? Or is there a better way? https://intercityup.com/blog/marking-records-as-deleted-without-removing-the-data.html
New Template Engine for Ruby
Hi, inspired by Mote, I’ve built a template engine for Ruby, is minimalist and simple to use, it’s called Ate, hope you enjoy it! Also, is a good way to learn how templates engines are built looking to the source.
How to use Greg's Event Store from ruby
We experiment with Event Sourcing and Greg’s Event Store in our projects. We decided to create http connector to Greg’s tool. More here.
Refactoring - when?
This is the last part of the blog post series about refactoring, explaining when to do code refactoring. The other two posts describe how to do refactoring and… why do it in the first place. Enjoy! [more inside]
How to validate the uniqueness of an attribute across multiple models in Rails
I recently ran into the situation where I had to validate an attribute across multiple models. It can be beautifully solved with a ActiveSupport Concern and I blogged about it today. Check it out and let me know what you think in the comments!
PolyBelongsTo gem hits Version 0.2 !
Simplify ActiveRecord access by using uniform methods for all kinds of relationships. Also includes hierarchy helpers. https://github.com/danielpclark/PolyBelongsTo
Conventional Changelog Ruby
Ruby lib and executable to generate a conventional changelog [more inside]
Ruby in Production: Lessons Learned
Having deployed a variety of Ruby apps (Rails and non-Rails) over the course of many years, here are some lessons I’ve learned to keep things afloat, along with Ansible and Docker recipes.
Ruby Push Notifications
Hey there guys. Anyone using Ruby to send iOS and/or Android Push notifications? Having any issues. Try this gem and let me know your thoughts please! https://rubygems.org/gems/ruby-push-notifications
Customize Devise to support Multitenancy authentication
I created a blog to talk about how to customise Devise to support Multi-tenancy authentication. Enjoy!
Interrobang
Interrobang: convert your predicate_methods? into bang_methods! without abusing method_missing. There’s also a nifty aside in the README about testing rescue handlers. Also, did you know that method? and method! were lifted from Scheme?
Verse 0.4.0 release
In this version of verse you can truncate, wrap, pad and align content with ANSI codes. Enjoy!
Code examples of Ruby Patterns
Here https://github.com/TheBlasfem/ruby-patterns i’m sharing examples about ruby patterns, learned following the course https://code.tutsplus.com/courses/design-patterns-in-ruby