Skip to content

Instantly share code, notes, and snippets.

View rrichards's full-sized avatar
💭
Rocking the CLI

Ryan Richards rrichards

💭
Rocking the CLI
  • R3 Technologies, Inc.
  • Edmond, OK
  • 02:30 (UTC -12:00)
  • X @rrichards
View GitHub Profile
(in /Users/ryanrichards/code/projects/grasshopper/chargify)
Using the default profile...
.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
deployer@CHRGWEBS01 current $ rake features RAILS_ENV=test --trace
(in /var/www/apps/chargify.com/releases/20100714220017)
** Invoke features (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
DEPRECATION WARNING: require "activesupport" is deprecated and will be removed in Rails 3. Use require "active_support" instead.. (called from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/activesupport.rb:2)
DEPRECATION WARNING: require "activeresource" is deprecated and will be removed in Rails 3. Use require "active_resource" instead.. (called from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activeresource-2.3.5/lib/activeresource.rb:2)
No server is running

A replacement for "livereload" gem on OS X

This script is a replacement for livereload server component designed for working with Rails. It watches the filesystem with FS Events (Mac OS X) rather than with EventMachine. This is better for large projects for wich EventMachine fails with "too many open files" exception.

Sass is supported; .sass files can also be stored in "app/styles/" directory.

Command line options are "-D" to enable debug mode. All other parameters (if given) specify a list of directories to watch. This is not compatible with livereload gem, which supports many more options and customization. If you want customization, edit this script. It's simple.

Visit the official livereload project for instructions on how to install the browser component.

# lib/tasks/restart.rake
# enable debugger locally with passenger - also see configuration block in
# config/environments/development.rb
task :restart do
system("touch tmp/restart.txt")
system("touch tmp/debug.txt") if ENV["DEBUG"] == 'true'
end
# config/environments/development.rb
# enable debugging with passenger locally. Also see related rake
# lib/tasks/restart.rake
# enable debugger locally with passenger - also see configuration block in
# config/environments/development.rb
task :restart do
system("touch tmp/restart.txt")
system("touch tmp/debug.txt") if ENV["DEBUG"] == 'true'
end
# config/environments/development.rb
# enable debugging with passenger locally. Also see related rake
ENV["WATCHR"] = "1"
system 'clear'
def growl(message)
growlnotify = `which growlnotify`.chomp
title = "Watchr Test Results"
puts message
image = message.match(/\s0\s(errors|failures)/) ? "~/.watchr_images/passed.png" : "~/.watchr_images/failed.png"
options = "-w -n Watchr --image '#{File.expand_path(image)}' -m '#{message}' '#{title}'"
system %(#{growlnotify} #{options} &)
@rrichards
rrichards / watchr.conf
Created August 3, 2010 18:15
Config for watchr
ENV["WATCHR"] = "1"
system 'clear'
def growl(message)
growlnotify = `which growlnotify`.chomp
title = "Watchr Test Results"
puts message
image = message.match(/\s0\s(errors|failures)/) ? "~/.watchr_images/passed.png" : "~/.watchr_images/failed.png"
options = "-w -n Watchr --image '#{File.expand_path(image)}' -m '#{message}' '#{title}'"
system %(#{growlnotify} #{options} &)
ENV["WATCHR"] = "1"
system 'clear'
def growl(message)
growlnotify = `which growlnotify`.chomp
title = "Watchr Test Results"
puts message
image = message.match(/\s0\s(errors|failures)/) ? "~/.watchr_images/passed.png" : "~/.watchr_images/failed.png"
options = "-w -n Watchr --image '#{File.expand_path(image)}' -m '#{message}' '#{title}'"
system %(#{growlnotify} #{options} &)
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/x-javascript js;
application/atom+xml atom;
application/rss+xml rss;
--Apple-Mail-15-894843121--
DEPRECATION WARNING: Message#original_filename is deprecated, please call Message#filename. (called from block in receive at /Users/ryanrichards/code/projects/imobilize/imobilizer3/app/models/incoming_mail_handler.rb:32)
#<NoMethodError: undefined method `to_tempfile' for #<Mail::Part:0x000001041425d0>>
/Users/ryanrichards/.rvm/gems/ruby-1.9.2-rc2@imobilize/gems/mail-2.2.5/lib/mail/message.rb:1251:in `method_missing'
/Users/ryanrichards/.rvm/gems/ruby-1.9.2-rc2@imobilize/gems/paperclip-2.3.3/lib/paperclip/attachment.rb:89:in `assign'
/Users/ryanrichards/.rvm/gems/ruby-1.9.2-rc2@imobilize/gems/paperclip-2.3.3/lib/paperclip.rb:275:in `block in has_attached_file'
/Users/ryanrichards/code/projects/imobilize/imobilizer3/app/models/incoming_mail_handler.rb:38:in `block in receive'
/Users/ryanrichards/code/projects/imobilize/imobilizer3/app/models/incoming_mail_handler.rb:29:in `each'
/Users/ryanrichards/code/projects/imobilize/imobilizer3/app/models/incoming_mail_handler.rb:29:in `receiv