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.
How to write an MVC-framework in Ruby
What if we wrote a web application similar to a typical rails-application? I.e. it will have MVC, routing, migrations, some configs, all in all, everything like it’s supposed to be. But all this will be a very-very simplified version of our favorite framework Rails. There will be no generators and interactive console, beautiful layouts and messing with assets. - https://mkdev.me/en/posts/how-to-write-an-mvc-framework-in-ruby
Better File Uploads with Shrine: Metadata
This is the 5th article in the series of posts about the Shrine file attachment library. In this post I talk about how Shrine extracts and saves file metadata during upload. Read all about it here.
tty-file initial release!
The tty-file provides higher level utilities for manipulating files and directories. This is initial release so please be gentle when using. Please report any issues or suggestions here.
HexaPDF Performance Benchmark
My pure Ruby PDF library HexaPDF contains a CLI application for working with PDFs. In this post I look at how this application performs in comparison to other such applications.
A simple usage of the cells gem
Loading data via a before_filter in your ApplicationController is still the de-factor standard for displaying data across your application. Here is an alternative approach using the cells gem.
Quick Rails Performance Wins
I did a blog post with some input from colleagues about our top 10 quickest performance wins we’ve seen in the wild. The list isn’t exhaustive, just meant to be quick, but it still has some good reminders for things that definitely can affect performance. Hope you like it! [more inside]
manpages - man pages for ruby
I love man pages. And I am a bit disappointed that most command line tools written in ruby don’t offer one. Maybe it’s because of the poor support of rubygems for it. To help fix this, I developed the manpages gem. It scans for man pages in your gem during the installation phase and links them to a folder that the man command can find. Please give it a try.
factbook gem updated - scripts for the world factbook - 250+ country profiles
Hello, I’ve updated the factbook gem that lets you read (public domain) counrtry profile pages (from the CIA World Factbook) and turns the HTML into structured data (e.g. JSON or a nested ruby hash). Build yourself an Almanac in 30 lines of ruby, for example, or find out what countries have the most oil reserves or most cell phones or internet hosts and so on. Happy exploring the world w/ ruby. Cheers.
‘Learn Ruby on Rails’ Book for Rails 5.0
My Learn Ruby on Rails book, which is free and has been called “the best Rails book for beginners,” is now up to date for Rails 5.0. This is a book that provides more depth and explanation than other Rails books, making it easier for beginners to get started.
Run services in the background
Something about Service pattern in Rails. How to run our services in the background and how to be lazy. Read more on our blog!
Hello, Minima! Theme - Get Started w/ GitHub Pages in 60 Seconds (Update V2)
Hello, I’ve updated the Hello, Minima! getting started in 60 seconds guide - using the latest and greatest Jekyll 3.3 version w/ Minima 2.0 (now running live on GitHub Pages). What’s news? Now just two steps to get started (add a _config.yml and an index.md). That’s it. No more step 3 required (that is, importing a style sheet) it will now get included automatically. See the Henry’s Hello, Minima! repo for the article and live demo. Cheers.
Using private attr_accessors is wrong
I’m working on an existing Rails application and there’s one pattern I see repeating often that I’m puzzled with. It’s especially common in service objects. Here’s couple of reasons you should not use private attr_accessors.
How BDD and Continuous Delivery Help Developers Maintain Flow
In this post I explore how BDD and CI/CD help us stay in the zone, where we do our best work.
Making Ruby Hash#dig even more awesome. Introducing Hash#dig_and_collect
In this blog post I will introduce Hash#dig_and_collect , a simple utility method that is built on top of Hash#dig to help you navigate nested hashes mixed up with arrays. [more inside]
It took me 2 days to solve my ruby/excon/openssl problem
https://gist.github.com/davidpaulhunt/1b78697e4f69c56a210cd9017ed198ad [more inside]
Mocking in Ruby with Minitest
Mocking is used to improve the performance of your tests. This tutorial will show you how to use mocks and stubs in Ruby with Minitest. [more inside]
Role based authorization module in Rails
This article shows how to implement a module that adds authorization logic to a controller class at action level based on user’s role.
Rubycoders is online
Rubycoders is a place where ruby programmers can find job announcements. The app is in beta testing, I need feedback! Free feel to register and explore the main features, then, if you want, you can drop me a line.
swift_client 0.1.5 released
This release of swift_client (a gem to interact with OpenStack Swift Object Storage) brings chunked downloads. https://github.com/mrkamel/swift_client
Duck typing vs type safety
If you ever thought you don’t need type safety in Ruby because of duck typing, check out my article on this subject which explains what type safety means in Ruby.
Introduction to fragment caching in Rails
This is a short introduction to fragment caching in Rails - how it works, some gotchas and things to remember. The article also shows what Russian-doll caching is. http://blog.ragnarson.com/2016/11/02/introduction-to-fragment-caching-in-rails.html
Purposes & Properties of Value Objects
What is and what makes a good Value Object? Learn how to implement their fundamental purposes and properties. https://blog.dnsimple.com/2016/11/purposes-and-properties-of-value-objects