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 Test::Unit::TestCase | |
def self.should_require_login(*args) | |
args = Hash[*args] | |
login_url = args.delete :login_url | |
args.each do |action, verb| | |
should "Require login for '#{action}' action" do | |
send(verb, action) | |
assert_redirected_to(login_url) | |
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
run "rm public/index.html" | |
#Dependencies | |
gem "haml" | |
gem "thoughtbot-factory_girl", :lib => "factory_girl", :source => "http://gems.github.com" | |
gem "thoughtbot-shoulda", :lib => "shoulda", :source => "http://gems.github.com" | |
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 'fileutils' | |
module GitScripts | |
class Branch | |
attr_reader :name | |
def initialize(path) | |
@path = path |
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
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
function proml { | |
local BLUE="\[\033[0;34m\]" | |
local RED="\[\033[0;31m\]" | |
local LIGHT_RED="\[\033[1;31m\]" | |
local GREEN="\[\033[0;32m\]" | |
local LIGHT_GREEN="\[\033[1;32m\]" |
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
set go-=T | |
set bg=dark | |
if has("gui_running") | |
"set fuoptions=maxvert,maxhorz | |
"au GUIEnter * set fullscreen | |
endif | |
if &background == "dark" | |
hi normal guibg=black | |
endif |
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
# SQLite version 3.x | |
# gem install sqlite3-ruby (not necessary on OS X Leopard) | |
<% | |
output = `cd #{Rails.root} && git branch` | |
branch = output.select { |e| e =~ /\A\*.+/ }.first | |
actual_branch = branch[/\*\s(.+)/, 1] | |
%> | |
development: | |
adapter: sqlite3 | |
database: db/<%= actual_branch %>_db |
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
function prompt { | |
local LIGHT_RED="\[\033[1;31m\]" | |
local LIGHT_GREEN="\[\033[1;32m\]" | |
local NO_COLOUR="\[\033[0m\]" | |
local TITLEBAR='\[\033]0;\u@\h\007\]' | |
source ~/.git-completion.bash | |
export GIT_PS1_SHOWDIRTYSTATE=true |
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
This file contains any messages produced by compilers while | |
running configure, to aid debugging if configure makes a mistake. | |
It was created by PostgreSQL configure 9.0.4, which was | |
generated by GNU Autoconf 2.63. Invocation command line was | |
$ ./configure --disable-debug --prefix=/usr/local/Cellar/postgresql/9.0.4 --enable-thread-safety --with-bonjour --with-gssapi --with-krb5 --with-openssl --with-libxml --with-libxslt --with-python --with-perl --with-ossp-uuid --datadir=/usr/local/Cellar/postgresql/9.0.4/share/postgresql --docdir=/usr/local/Cellar/postgresql/9.0.4/share/doc/postgresql ARCHFLAGS='-arch x86_64' | |
## --------- ## | |
## Platform. ## |
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
ActiveRecord::ConnectionAdapters::AbstractAdapter.class_eval do | |
def log_with_syspanel_logger(sql, name, &block) | |
if Thread.current["syspanel.sql.logger.enabled"] | |
Thread.current["syspanel.sql.logger.enabled"] = false | |
SyspanelSqlLog.create(:sql => sql, :name => name) | |
end | |
log_without_syspanel_logger(sql, name, &block) | |
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 ActiveRecord::ConnectionAdapters::MysqlAdapter | |
def execute(sql, name = nil, skip_logging = false) | |
log(sql, name) { @connection.query(sql) } unless skip_logging | |
rescue ActiveRecord::StatementInvalid => exception | |
if exception.message.split(":").first =~ /Packets out of order/ | |
raise ActiveRecord::StatementInvalid, "'Packets out of order' error was received from the database. Please update your mysql bindings (gem install mysql) and read http://dev.mysql.com/doc/mysql/en/password-hashing.html for more information. If you're on Windows, use the Instant Rails installer to get the updated mysql bindings." | |
else | |
raise | |
end |
OlderNewer