Skip to content

Instantly share code, notes, and snippets.

View r00k's full-sized avatar
💭
Working on Tuple (https://tuple.app)

Ben Orenstein r00k

💭
Working on Tuple (https://tuple.app)
View GitHub Profile
ben@town ~/code $ time git clone git://github.com/rails/rails.git
(...)
real 0m27.800s
user 0m21.590s
sys 0m2.590s
--------------------
NoMethodError in DecksController#update
undefined method `original_filename' for "07 Sweet Pea.m4a":String
RAILS_ROOT: /home/rob/code/flashcards
Application Trace | Framework Trace | Full Trace
app/models/card_sound.rb:5:in `file='
app/models/card.rb:13:in `sound_file='
app/models/deck.rb:10:in `card_attributes='
[user]
name = Ben Orenstein
email = [email protected]
[alias]
co = checkout
[color]
diff = auto
status = auto
# Show SQL in console
if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER')
require 'logger'
RAILS_DEFAULT_LOGGER = Logger.new(STDOUT)
end
def authenticate
return true if Rails.env.test?
success = authenticate_or_request_with_http_digest do |user|
ADMIN_CREDENTIALS[user]
end
# We have to explicitly check if success is true here because
# auth_or_req_w_http_digest returns a string on authorization
# failure (?!)
session[:admin] ||= success
end
require File.dirname(__FILE__) + '/../test_helper'
class ApplicationLevelTest < ActionController::TestCase
# This class holds tests for application-level components: layouts, application_controller elements, etc
class GoogleAnalyticsController < ApplicationController
def any_action
end
end
# Returns just the numbers from the phase attribute
def display_phase
case phase
when /(\d).*(\d)/
$1 + ' / ' + $2
when /(\d)/
$1
when nil
''
else
require 'rbconfig'
require 'find'
require 'ftools'
include Config
# this was adapted from rdoc's install.rb by ways of Log4r
$sitedir = CONFIG["sitelibdir"]
unless $sitedir
require 'rbconfig'
require 'find'
require 'ftools'
include Config
# this was adapted from rdoc's install.rb by ways of Log4r
$sitedir = CONFIG["sitelibdir"]
unless $sitedir
##
# Delete a (key, value) pair.
#
# ==== Example
# t = Trie.new.insert("a", 1).insert("a", 2)
# t.delete_pair("a", 1) # t now only contains the second value
#
def delete_pair(key, value)
key = key.split('') if key.is_a?(String)
if key.empty?