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
# include at least one source and the rails gem | |
source :gemcutter | |
gem 'rails', '~> 2.3.5', :require => nil | |
gem 'sqlite3-ruby', :require => 'sqlite3' | |
# Devise 1.0.2 is not a valid gem plugin for Rails, so use git until 1.0.3 | |
# gem 'devise', :git => 'git://github.com/plataformatec/devise.git', :ref => 'v1.0' | |
group :development do | |
# bundler requires these gems in development |
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 TopLevel | |
class Foo | |
puts "class Foo" | |
puts "self: #{self}" | |
puts "nesting: #{Module.nesting.inspect}" | |
puts "Method definition context: #{self}" | |
end | |
puts |
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 setup-tm { | |
mkdir -p ~/Dropbox/Settings/dotfiles/tmproj | |
ln -s ~/Dropbox/Settings/dotfiles/tmproj ~/.tmproj | |
} | |
function tm { | |
open ~/.tmproj/$1.tmproj | |
} | |
complete -W '$(ls ~/.tmproj | sed s/.tmproj//)' tm |
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
[andre ~/sw/gems/bundler](master⚡)$ spec -u -fs -c spec/cache/gems_spec.rb -e "copies the .gem file to vendor/cache" | |
bundle cache with gems when there are only gemsources | |
- copies the .gem file to vendor/cache | |
Finished in 2.096271 seconds | |
1 example, 0 failures | |
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
# Instead of this: | |
# $ ruby -rubygems -I lib bin/thing test | |
# Run this: | |
# $ druby thing test | |
function druby() { | |
ruby -rubygems -I lib bin/$@ | |
} |
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
# Enhanced mate command that can open and tab-complete tmproj files in ~/.tmproj | |
# To use, save your TM projects as ~/.tmproj/foo.tmproj, then open with `mate foo` | |
function mate { | |
if [ -a "$(cd ~/.tmproj; pwd)/$1.tmproj" ]; then | |
open "$(cd ~/.tmproj; pwd)/$1.tmproj" | |
else | |
/usr/bin/env mate "$1" | |
fi | |
} | |
complete -f -W '$(ls ~/.tmproj | sed s/.tmproj//)' mate |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.engineyard.redis</string> | |
<key>Program</key> | |
<string>/usr/local/bin/redis-server</string> | |
<key>ProgramArguments</key> | |
<array> |
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
lines = ["puts \"lines = \#{lines.inspect}\"", "lines.each{|l| puts l }"] | |
puts "lines = #{lines.inspect}" | |
lines.each{|l| puts l } |
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
# ruby -rdebug_proxy -e "DebugProxy.new('foo', :string).gsub!(/o/, 'a')" | |
# | |
# DebugProxy (string) ------------------------- | |
# | | | |
# | Method called on proxy object: | | |
# | gsub!(/o/, "a") | | |
# | | | |
# | Stack trace of method call: | | |
# | -e:1 | | |
# | | |
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
mkdir my_app | |
cd my_app | |
echo "source :rubyforge\ngem 'rails', :git => 'git://github.com/rails/rails.git'" > Gemfile | |
gem install bundler | |
bundle install | |
bundle exec rails . | |
bundle exec rails server |