This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'iconv' | |
class Exporter | |
def initialize(separator = ';') | |
@separator = separator | |
@header = [] | |
@body = [] | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Contact < ActiveRecord::Base | |
has_many :responses | |
has_many :dynaforms, through: :responses | |
attr_accessible :email, :responses_attributes | |
accepts_nested_attributes_for :responses | |
def self.new_with_dynaforms | |
new.tap do |contact| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
# textmate as editor | |
Pry.config.editor = 'mate -w' | |
Pry.config.color = true | |
Pry.config.pager = true | |
# alias 'q' for 'exit' | |
Pry.config.commands.alias_command 'q', 'exit-all' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Manager | |
def self.configure(&block) | |
::Template.new(&block) | |
end | |
end | |
class Template | |
attr_reader :assets, :events | |
def initialize(&block) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Urlize | |
def urlize | |
self.gsub(/[^[:alnum:]\-\s\_]/, '').split(/[\s\-\_]+/).delete_if{|i| i.empty?}.join('-').downcase | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rake/testtask' | |
Rake::TestTask.new do |t| | |
t.libs << 'lib' | |
t.libs << 'spec' | |
t.pattern = 'spec/**/*_spec.rb' | |
t.verbose = true | |
t.warning = false | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# == God config file | |
# http://god.rubyforge.org/ | |
# Authors: Gump and [email protected] | |
# | |
# Config file for god that configures watches for each instance of a thin server for | |
# each thin configuration file found in /etc/thin. | |
# In order to get it working on Ubuntu, I had to make a change to god as noted at | |
# the following blog: | |
# http://blog.alexgirard.com/ruby-one-line-to-save-god/ | |
# |
NewerOlder