recentpopularlog in

edavey : ruby   245

« earlier  
Thor - Home
Thor is a toolkit for building powerful command-line interfaces.
ruby  cli 
february 2019 by edavey
Awesome Ruby
A categorized community-driven collection of awesome Ruby libraries, tools, frameworks and software. The essential Ruby to build modern Apps and Web Apps.
gems  ruby 
september 2017 by edavey
thredded/thredded: The best Rails forums engine ever.
Thredded is a Rails 4.2+ forum/messageboard engine. Its goal is to be as simple and feature rich as possible.

Some of the features currently in Thredded:

Markdown post formatting with some BBCode support (by default).
(Un)read posts tracking.
Email notifications, topic subscriptions, @-mentions, per-messageboard notification settings.
Private group messaging.
Full-text search using the database.
Pinned and locked topics.
List of currently online users, for all forums and per-messageboard.
Flexible permissions system.
Basic moderation.
Lightweight default theme configurable via Sass.
blog  ruby  rails 
june 2016 by edavey
Wrap a use block around the code's original behavior, and wrap try around the new behavior. will always return whatever the use block returns, but it does a bunch of stuff behind the scenes:

It decides whether or not to run the try block,
Randomizes the order in which use and try blocks are run,
Measures the durations of all behaviors,
Compares the result of try to the result of use,
Swallows (but records) any exceptions raised in the try block, and
Publishes all this information.
The use block is called the control. The try block is called the candidate.
refactoring  ruby 
december 2015 by edavey
kiba/ at master · thbar/kiba
Writing reliable, concise, well-tested & maintainable data-processing code is tricky.

Kiba lets you define and run such high-quality ETL (Extract-Transform-Load) jobs, using Ruby (see supported versions).
etl  ruby 
november 2015 by edavey
.:: Phrack Magazine: attacking rails apps ::.
This little article aims to give an introduction to the topic of attacking
Ruby on Rails applications. It's neither complete nor dropping 0day. It's
rather the authors attempt to accumulate the interesting attack paths and
techniques in one write up. As yours truly spend most of his work on Ruby
on Rails applications in the time when Rails version 3 was current, some of
the described techniques are not applicable to Rails 4 any more. However
there is still a broad attack surface of older applications as migrating
Rails code up one or two version appears to be a real pain in the ass for
lager projects (if you doubt this ask your local Rails startup peeps :)
rails  ruby  security 
october 2015 by edavey
3 steps to fix encoding problems in Ruby - Weissblog
You only really think about a string’s encoding when it breaks. When you check your exception tracker and see

Encoding::InvalidByteSequenceError: "\xFE" on UTF-8
staring you in the face. Or maybe “they’re” starts showing up as “they’re”.

So, when you have a bad encoding, how do you figure out what broke? And how can you fix it?
ruby  encoding 
september 2015 by edavey
Flipper: Insanely Easy Feature Flipping // RailsTips by John Nunemaker
Flipper started as a simple ripoff of rollout with the primary difference being the use of adapters for storage instead of forcing redis. I struggled through awkward terminology and messy code for a while, until a great conversation with Brandon Keepers led me to the lingo flipper uses today: Actor, Feature and Gate (thanks Brandon!)

An actor is the thing trying to do something. It can be anything. On GitHub, the actor can be a user, organization or even a repository. Actors must respond to flipper_id. If you plan on using multiple types of actors, you can namespace the flipper_id with the type (ie: “User:6”, “Organization:12”, or “Repository: 2”).

A feature is something that you want to control enabled-ness for. On SpeakerDeck, I have a feature for search. With the click of a button, I can disable search if it is causing issues. On GitHub, we do thousands of feature checks per second across nearly 30 features (at the time of this writing) in different states of enabled-ness. If I told you what they were for I would have to kill you.

A gate determines if a feature is enabled for an actor. There are currently five gates — boolean, actor, group, % of actors and % of time. Amongst these you can rollout a new feature or control an existing one in whatever way you desire.
august 2015 by edavey
reek is a tool that examines Ruby classes, modules and methods and reports any Code Smells it finds

reek currently includes checks for some aspects of Control Couple, Data Clump, Feature Envy, Large Class, Long Parameter List, Simulated Polymorphism, Too Many Statements, Uncommunicative Name, Unused Parameters and more. See the Code Smells for up to date details of exactly what reek will check in your code.
july 2015 by edavey
Importing CSV files seems easy until you deal with real users uploading their real CSV file. You then have to deal with ASCII-8BIT formats, missing columns, empty rows, malformed headers, wild separators, etc. Reporting progress and errors to the end-user is also key for a good experience.

I went through this many times so I decided to build CSV Importer to save us a lot of trouble.

CSV Importer provides:

a DSL to define the mapping between CSV columns and your model
good reporting to the end user
support for wild encodings and CSV formats.
ruby  csv 
june 2015 by edavey
Using Null Objects can make life a lot easier and avoid having excessive nil? checks. Avdi Grimm made an excellent library called Naught which makes working with and building Null Objects easier.
ruby  rails  null_object 
april 2015 by edavey
Naught is a toolkit for building Null Objects in Ruby by Avdi Grimm
ruby  nil  null_object 
april 2015 by edavey
Interact with remote REST services in an ActiveRecord-like manner.

Fast handling of even large amounts of JSON
Proper support for scopes
Ability to define custom URIs for associations
ActiveRecord-like log output
Googlable name! :)
api  rest  ruby 
january 2015 by edavey
Simple, declarative, role-based access control system for Rails and Ruby
ruby  rails  roles 
november 2014 by edavey
The definitive guide to Arel, the SQL manager for Ruby - Jiri Pospisil's blog
Behind the scenes, ActiveRecord uses Arel to build the queries and ultimately calls out to it to get the final SQL before shipping it to the database of your choice.

So how exactly Arel achieves building the queries in such a flexible way? By building an AST. Arel internally operates on AST nodes - you modify the query via a method call, Arel modifies or creates the appropriate node in the tree.
arel  rails  ruby 
september 2014 by edavey
RuboCop is a Ruby static code analyzer. Out of the box it will enforce many of the guidelines outlined in the community Ruby Style Guide.

Most aspects of its behavior can be tweaked via various configuration options.

Apart from reporting problems in your code, RuboCop can also automatically fix some of the problems for you.
ruby  development 
august 2014 by edavey
Wisper is a Ruby library for decoupling and managing the dependencies of your domain models.
pubsub  rails  ruby  soa 
august 2014 by edavey
Use .pluck If You Only Need a Subset of Model Attributes | Viget
IF YOU ONLY REQUIRE a few attributes from a table, rather than instantiating a collection of models and then running a .map over them to get the data you need, it’s much more efficient to use .pluck to pull back only the attributes you need as an array. The benefits are twofold: better SQL performance and less time and memory spent in Rubyland.
rails  ruby  pluck 
august 2014 by edavey
Factory Girl without Active Record // Collective Idea | Crafting web and mobile software based in Holland, Michigan
But what about those pesky models that fall outside of your ORM? Fear not… Factory Girl’s got you covered there too!
ruby  factory_girl 
november 2013 by edavey
Installs Ruby, JRuby, Rubinius or MagLev.


Supports installing arbitrary versions.
Supports installing into /opt/rubies/ for root and ~/.rubies/ for users by default.
Supports installing into arbitrary directories.
Supports downloading from mirrors.
Supports downloading/applying patches.
Supports applying arbitrary patches.
Supports specifying arbitrary ./configure options.
Supports downloading archives using wget or curl.
Supports verifying downloaded archives using md5sum or md5.
Supports installing build dependencies via the package manager:
Has tests.

Does not require updating every time a new Ruby version comes out.
Does not require recipes for each individual Ruby version or configuration.
november 2013 by edavey
Changes the current Ruby.


Updates $PATH.
Also adds RubyGems bin/ directories to $PATH.
Correctly sets $GEM_HOME and $GEM_PATH.
Users: gems are installed into ~/.gem/$ruby/$version.
Root: gems are installed directly into /path/to/$ruby/$gemdir.
Optionally sets $RUBYOPT if second argument is given.
Calls hash -r to clear the command-lookup hash-table.
Fuzzy matching of Rubies by name.
Defaults to the system Ruby.
Optionally supports auto-switching and the .ruby-version file.
Supports bash and zsh.
Small (~90 LOC).
Has tests.

Does not hook cd.
Does not install executable shims.
Does not require Rubies be installed into your home directory.
Does not automatically switch Rubies by default.
Does not require write-access to the Ruby directory in order to install gems.
november 2013 by edavey
Slow Tests Are the Symptom, Not the Cause | via @codeship
In this refactoring walk-through we will see how small, incremental improvements to the design of a rails app, and specifically, decoupling, naturally lead to faster tests. We will extract service objects, completely remove all rails dependencies in test time and otherwise reduce the amount of coupling in the app.
ruby  rails  refactoring  oo_design 
october 2013 by edavey
Hutch: Inter-Service Communication with RabbitMQ — GoCardless Blog
Hutch is a Ruby library for enabling asynchronous inter-service communication in a service-oriented architecture, using RabbitMQ.
SOA  messaging  ruby  development 
september 2013 by edavey
Myron Marston » RSpec 2.14 is released!
including "Shared example groups are scoped to the context they are defined in"
rspec  testing  ruby  development 
july 2013 by edavey
RSpec's new message expectation syntax - Tea is awesome.
We’ve developed a new syntax for message expectations in RSpec, which brings message expectations in line with the new expect syntax for state based expectations.
rspec  ruby  mocking 
may 2013 by edavey
Sandi Metz’ rules for developers
Sandi Metz’ rules for developers

Back in January, Sandi Metz introduced her rules for developers in a Ruby Rogues podcast episode episode. When Sandi’s rules were published, I was starting a new project. This post details the experience of that team applying Sandi’s rules to that project.
development  ruby  rails 
may 2013 by edavey
Chef cookbooks for busy Ruby developers -
Have you ever setup a Rails production environment from scratch, by hand? If you had, I share your pain every time when a new project started.

The process is often repetitive. To me, it seems to be a waste to do it manually every time. It also consumes time and attention. It would be great if I could spend them on tasks that bring more values to clients.

To minimize such waste, I have written two Chef cookbooks to automate the process:

rackbox - to provision rack-based web server (Nginx as front server, Unicorn and Passenger as upstream app servers, rbenv as ruby version manager).
databox - to provision database server (supports MySQL and PostgreSQL).
chef  rails  ruby  sysadmin 
april 2013 by edavey
natritmeyer/site_prism · GitHub
SitePrism gives you a simple, clean and semantic DSL for describing your site using the Page Object Model pattern, for use with Capybara in automated acceptance testing.
capybara  ruby  rails  cucumber  testing 
march 2013 by edavey
sj26/mailcatcher · GitHub
Catches mail and serves it through a dream.
mail  rails  ruby  email 
february 2013 by edavey
griddler/ at master · thoughtbot/griddler · GitHub
Receive emails in your Rails app

Griddler is a Rails engine (full plugin) that provides an endpoint for the SendGrid parse api that hands off a built email object to a class implemented by you.
development  ruby  rails  email  messaging  sendgrid 
february 2013 by edavey
maxim/skeptick · GitHub
Skeptick is an all-purpose DSL for building and running ImageMagick commands. It helps you build any transformations, from trivial resizes to complex mask algorithms and free drawing. In a nutshell, Skeptick is nothing more than a string manipulator and a process spawner. That's all it's meant to be. However, with Skeptick you get quite a few advantages over using plain shell-out or other libraries.
imagemagick  ruby  development 
february 2013 by edavey
osx - Is it possible to reinstall/fix Mac OS X's system ruby without doing a complete OS reinstall? - Super User
get homebrew working again by reinstalling system ruby using pacifist and osx installation disc
homebrew  osx  ruby 
january 2013 by edavey
A love affair with PostgreSQL [Rails 4 Countdown to 2013] | The Remarkable Labs Blog
Out of all the supported databases available in Active Record, PostgreSQL received the most amount of attention during the development of Rails 4. In today's countdown post, we are going to look at the various additions made to the PostgreSQL database adapter.
postgres  rails  ruby  rails4 
january 2013 by edavey
Squeel lets you write your ActiveRecord queries with fewer strings, and more Ruby, by making the ARel awesomeness that lies beneath ActiveRecord more accessible.
activerecord  rails  ruby  development  arel 
november 2012 by edavey
10 Things You Didn't Know Ruby Could do // Speaker Deck
JEG2: My talk from the Aloha Ruby Conference, in Honolulu, HI in October of 2012. It's a collection of random tricks you can do with Ruby.
programming  ruby 
october 2012 by edavey
Better Specs
RSpec is a great tool in the behavior driven design process of writing human readable specifications that direct and validate the development of your application.

On the web you can find several resources explaining how to use RSpec and they all give you a complete overview of what you can do. What you'll rarely find is a book or an article explaining how to use RSpec to create a great test suite.

Better Specs tries to fill this miss collecting most of the guidelines developers has been learning the hard way through years of experience.
rspec  ruby  development 
october 2012 by edavey
ActiveModel modules for all your non-persisted form data
Active Model Helper Modules reduce the complexity of validations on your plain old Ruby objects.
validation  ruby  rails  activemodel 
october 2012 by edavey
Allows access to Google Analytics feeds from Ruby.

Does not support any of the OAuth-related authentication methods, only session login.

It tries to be really simple, returning rows as Hashes rather than specific objects, and provides flexibility as to how you want to make HTTP calls via Faraday.
analytics  ruby  development 
september 2012 by edavey
Hatchet is a logging framework written from the ground up in Ruby. It has been inspired by the likes of log4j and slf4j but is not a port of either of them.

Hatchet aims to integrate seamlessly with your Ruby projects and provide a single logging interface that can pass on messages to any backend you want to use.
ruby  logging  development 
july 2012 by edavey
Rack middleware that implements the Worker Pattern.

It processes GET requests with a worker backend and only serves them straight from a cache.
While processing the request it serves empty HTTP 202 responses. Your web frontend is never blocked processing the request.
rack  ruby  development 
april 2012 by edavey
This is an attempt to combine the powers of Capistrano and chef-solo.

The only thing you need is SSH access and a supported OS. At this time only Ubuntu is supported.
sysadmin  chef  capistrano  ruby  development 
april 2012 by edavey
Poltergeist 0.6.0: Javascript error handling and remote debugging: Jon Leighton
My goal with Poltergeist is to create the fastest and best Capybara driver. A common problem when using Capybara, particularly when using a headless driver, is debugging. To be the best driver, Poltergeist needs to be the easiest to debug.
capybara  testing  development  ruby  javascript  poltergeist 
april 2012 by edavey
A friendly wrapper for launchctl. Start your agents and go to lunch!

Don't you hate OSX's launchctl? You have to give it exact filenames. The syntax is annoying different from Linux's nice, simple init system and overly verbose. It's just not a very developer-friendly tool.
daemon  osx  ruby  mac  launchctl 
march 2012 by edavey
New Tabs and Cucumber // The Programming Butler
While working on an internal app at GitHub I had to write a cucumber scenario that ran expectations against a new tab that was opened. Here is how I did it.
cucumber  ruby  rails  development  testing 
march 2012 by edavey
For the best HTML e-mail delivery results, CSS should be inline. This is a huge pain and a simple newsletter becomes un-managable very quickly. This script is my solution.

CSS styles are converted to inline style attributes Checks style and link[rel=stylesheet] tags and preserves existing inline attributes
Relative paths are converted to absolute paths Checks links in href, src and CSS url('')
CSS properties are checked against e-mail client capabilities Based on the Email Standards Project’s guides
A plain text version is created Optional
ruby  development  email 
march 2012 by edavey
This gem is a no config solution for the wonderful Premailer gem to be used with Rails 3. It uses interceptors which were introduced in Rails 3 and tweaks all mails which are delivered and adds a plain text part to them and inlines all CSS rules into the HTML part.
rails  ruby  development  email 
march 2012 by edavey
paulasmuth/recommendify - GitHub
Recommendify is a ruby/redis based recommendation engine - The recommendations can be updated/processed incrementally and on multiple hosts. The worker is implemented in plain ruby and native C.
ruby  development  machine_learning  recommendations 
february 2012 by edavey
jonleighton/poltergeist - GitHub
Poltergeist is a driver for Capybara. It allows you to run your Capybara tests on a headless WebKit browser, provided by PhantomJS.
capybara  javascript  ruby  rails  development  testing  PhantomJS 
january 2012 by edavey
nbrochu/smooth_s3 - GitHub
Smooth S3 is a user-friendly superset of the S3 gem geared towards file system backup operations. It greatly simplifies regular file uploads to S3 by using Convention over Configuration™. The library also adds new features such as directory syncronization and timestamped uploads, which should come in real handy to anyone doing backup scripts on a regular basis. A decent amount of control is left to the developer: You can specify a prefix path to use with any upload and provide your own timestamp formats if desired.

The goal with Smooth S3 is to facilitate and simplify your S3 uploads. It is a library focused on the file system, so no integration with MySQL, third-party services or anything like that. Nothing prevents you from doing a mysqldump and uploading the results in the same script using Smooth S3 though ;)
ruby  s3  amazon  sysadmin 
december 2011 by edavey
njonsson/cape - GitHub

You use Capistrano to deploy your application, and
You have Rake tasks you want to run remotely — but you don’t want to hand-code Capistrano recipes for each Rake task —

You can use the Cape DSL within Capistrano recipes to dynamically add recipes for your application’s Rake tasks, and
You can run your Rake tasks on your deployed servers, friction-free, and look like a superhero. [cue fanfare]
rails  rake  ruby  development  sysadmin  deployment  capistrano 
december 2011 by edavey
myronmarston/mail_safe - GitHub
Mail safe provides a safety net while you’re developing an application that uses ActionMailer. It keeps emails from escaping into the wild.

Once you’ve installed and configured this gem, you can rest assure that your app won’t send emails to external email addresses. Instead, emails that would normally be delivered to external addresses will be sent to an address of your choosing, and the body of the email will be appended with a note stating where the email was originally intended to go.
mail  testing  ruby  rails  development 
december 2011 by edavey
« earlier      
per page:    204080120160

Copy this bookmark:

to read