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 TaggedLoggerProxy | |
def initialize(tag, logger = Rails.logger) | |
@tag = tag | |
@logger = logger | |
end | |
%w[fatal error warn info debug unknown].each do |severity| | |
eval <<-EOM, nil, __FILE__, __LINE__ + 1 | |
def #{severity}(msg = nil, &blk) | |
@logger.tagged(@tag) { @logger.#{severity}(msg, &blk) } |
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 ActiveSupport | |
class TimeZone | |
module Google | |
API = 'https://maps.googleapis.com/maps/api/timezone/json'.freeze | |
def from_coordinates(lat, lng) | |
params = { | |
location: "#{lat},#{lng}", | |
timestamp: Time.now.to_i, | |
sensor: false | |
} |
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
# Send e-mail about the deployed version | |
on_app_master do | |
# When doing rollback there's no context | |
return unless respond_to?(:deployed_by) | |
require 'bundler' | |
Bundler.setup | |
require 'ey_config' | |
require 'mail' |
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
# ey_extra.thor | |
require 'engineyard/cli' | |
class EY < EY::CLI | |
namespace 'ey' | |
COLORS = { | |
'DEBUG' => :blue, | |
'INFO' => :green, | |
'WARN' => :yellow, |
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 ActiveSupport | |
class TaggedLogging | |
%w( fatal error warn info debug unknown ).each do |severity| | |
eval <<-EOM, nil, __FILE__, __LINE__ + 1 | |
def #{severity}(message = nil, progname = nil, &block) | |
add(Logger::#{severity.upcase}, message, progname, &block) | |
end | |
EOM | |
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 'sprockets/context' | |
require 'sprockets/directive_processor' | |
# Don't require the assets which start with the underscore | |
module Sprockets | |
class Context | |
# Allow skipping but not blacklisting of assets | |
def initialize_with_skip(environment, logical_path, pathname) | |
@_skipped_assets = Set.new | |
initialize_without_skip(environment, logical_path, pathname) |
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
@import "compass/css3"; | |
@mixin kill-flicker { | |
-webkit-backface-visibility: hidden; | |
} | |
.off-canvas-wrap { | |
@include kill-flicker; | |
position: relative; | |
width: 100%; |
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 'faraday' | |
require 'multi_json' | |
module Google | |
class Geocoder | |
def initialize | |
@conn = Faraday.new('http://maps.googleapis.com/') | |
end | |
# @param [Float] lat |
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 InkHelper | |
class ColumnsCapturer | |
delegate :capture, :content_tag, :to => :@ctx | |
def initialize(ctx, &block) | |
@ctx = ctx | |
@block = block | |
@classes = ['columns'] | |
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
#!/usr/bin/env ruby | |
require 'nokogiri' | |
class BuilderBuilder | |
def initialize(file, builder = 'xml') | |
@doc = Nokogiri::XML(File.read(file)) | |
@builder = builder | |
end | |
def to_s |