This file contains hidden or 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
# @settings and anything in it could be nil or blank at any time | |
def get_backlog_issues(exclude_ids=[]) | |
return [[]] unless @settings.present? && | |
@settings['panes'].present? && | |
@settings['panes']['backlog'].present? && | |
@settings['panes']['backlog']['status'].present? && | |
@settings['panes']['backlog']['limit'].present? | |
# ... |

This file contains hidden or 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
# Put this file in your config/initializers directory and behold a tastier auto_link! | |
module ActionView | |
module Helpers | |
module TextHelper | |
# Use auto_link and friends from Rails 3. They do the right thing (tm). | |
remove_const(:AUTO_LINK_RE) if defined?(AUTO_LINK_RE) | |
AUTO_LINK_RE = %r{ | |
( https?:// | www\. ) |
This file contains hidden or 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
t = Thread.start do | |
l = '/ - \ |'.split | |
print "\e[?25l" | |
loop do | |
c = l.shift | |
print "\r#{c}" | |
STDOUT.flush | |
sleep 0.1 | |
l.push c | |
end |
This file contains hidden or 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
# Everything you need to do to get started with Rails 2.3.8 | |
# | |
# As of June 14th, 2010 @ 2:30 p.m. MST | |
# | |
# This gist now features instructions to get Rails 3 up and running with: | |
# - Ruby 1.8.7-p174 | |
# - Bundler 0.9.26 | |
# - Cucumber 0.8.0 | |
# - Rspec 1.3.0 + Rspec-Rails 1.3.2 | |
# - RVM |
This file contains hidden or 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
function git_deleted { | |
[[ $(git status 2> /dev/null | grep deleted:) != "" ]] && echo "-" | |
} | |
function git_added { | |
[[ $(git status 2> /dev/null | grep "Untracked files:") != "" ]] && echo '+' | |
} | |
function git_modified { | |
[[ $(git status 2> /dev/null | grep modified:) != "" ]] && echo "*" |
This file contains hidden or 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
function detect_rvm { | |
local gemset=$(echo $GEM_HOME | awk -F'@' '{print $2}') | |
[ "$gemset" != "" ] && gemset="@$gemset" | |
local version=$(echo $MY_RUBY_HOME | awk -F'-' '{print $2}') | |
[ "$version" != "" ] && version="$version" | |
local full="$version$gemset" | |
[ "$full" != "" ] && echo "$full" | |
} | |
function git_deleted { |
This file contains hidden or 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 "rubygems" | |
require "ap" | |
unless IRB.version.include?('DietRB') | |
IRB::Irb.class_eval do | |
def output_value | |
ap @context.last_value | |
end | |
end | |
else # MacRuby |
This file contains hidden or 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
### 1) Added $stderr tracing in gems/activesupport-3.0.3/lib/active_support/xml_mini.rb | |
### | |
FORMATTING = { | |
"symbol" => Proc.new { |symbol| symbol.to_s }, | |
"date" => Proc.new { |date| date.to_s(:db) }, | |
"datetime" => Proc.new { |time| $stderr.puts "3.0.3: time.xmlschema for <#{time.class.inspect}>"; time.xmlschema }, | |
"binary" => Proc.new { |binary| ActiveSupport::Base64.encode64(binary) }, | |
"yaml" => Proc.new { |yaml| yaml.to_yaml } | |
} unless defined?(FORMATTING) |
This file contains hidden or 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 ActiveModel | |
# == Active Model XML Serializer | |
module Serializers | |
module Xml | |
extend ActiveSupport::Concern | |
include ActiveModel::Serialization | |
class Serializer #:nodoc: | |
class Attribute #:nodoc: | |
attr_reader :name, :value, :type |