Add to gemspec:
# my_gem.gemspec
Gem::Specification.new do |s|
# ...
#!/usr/bin/env ruby | |
# A quick and dirty implementation of an HTTP proxy server in Ruby | |
# because I did not want to install anything. | |
# | |
# Copyright (C) 2009-2014 Torsten Becker <[email protected]> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining | |
# a copy of this software and associated documentation files (the | |
# "Software"), to deal in the Software without restriction, including | |
# without limitation the rights to use, copy, modify, merge, publish, |
#!/usr/bin/env ruby | |
require 'pty' | |
require 'socket' | |
# pump([[reader, writer], ...]) | |
# | |
# Description: | |
# pump() takes an array of arrays, with the first element of each being the read stream and the | |
# second being the write stream. pump() itself is synchronous but it uses select() to |
# | |
# Eric Lindvall <[email protected]> | |
# | |
# Update the process name for the process you're running in. | |
# | |
# This will allow top, lsof, and killall to see the process as the | |
# name you specify. | |
# | |
# Just use: | |
# |
alias server='open http://localhost:8000 && python -m SimpleHTTPServer' |
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf
using homebrew.
Just install this in your apps like so:
gem 'test-spec-mini', :git => 'git://gist.github.com/1806986.git', :require => 'mini'
require 'new_relic/agent/method_tracer' | |
class NR | |
# Convenience method for adding NewRelic tracing around specific methods of interest. | |
# | |
# Note about performance: | |
# | |
# " CAUTION - adding probes to your code adds overhead. | |
# Each probe burns about 20 microseconds of CPU. | |
# Be careful not to probe a method that's called frequently in a loop. " |
guard 'rspec', :version => 2 do | |
watch(%r{^spec/.+_spec\.rb$}) | |
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } | |
watch('spec/spec_helper.rb') { "spec" } | |
# Rails example | |
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } | |
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" } | |
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] } | |
watch(%r{^spec/support/(.+)\.rb$}) { "spec" } |
Vagrant::Config.run do |config| | |
# Make the VM host name the name of the containing folder by default | |
host = File.basename(Vagrant::Environment.new.root_path || __FILE__).gsub(/_/, '-') | |
config.vm.host_name = "#{host}.vagrantup.com" | |
end |