Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: master
Fetching contributors…
Cannot retrieve contributors at this time
52 lines (40 sloc) 2.04 KB
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "wrapped-rails/version" do |s| = "wrapped-rails"
s.version = Wrapped::Rails::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Mike Burns"] = [""]
s.homepage = ""
s.summary = %q{Auto-wrap optional data values in your Rails app for your protection.}
s.description = %q{
Databases are a wild West of NULL values. Sure, you put some NOT NULL
constraints here and there but, in general? Mostly NULL. That turns into
nil, which turns into NoMethodError, which turns into a Cucumber scenario,
which turns into #try, and in general it's exhausting.
Catch this all before the push to production by using wrapped-rails.
This gem inspects your models for presence-checking validations. For each that
it does _not_ find it wraps the value. You must then unwrap the value.
Why the extra work? Because you want to do it now, not later.
<%= @user.middle_name.unwrap_or('Q') { |mn| mn.first } %>
Is this more code than #try or #|| ? Hardly, but you're asking the wrong
question here. This is more careful code. This is code where testing the
"happy path" is good enough 80% of the time. This is code that lets you
spend more time writing code and less time tracking errors.
This is what people mean when they talk about caring about your work.
s.rubyforge_project = "wrapped-rails"
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
Jump to Line
Something went wrong with that request. Please try again.