This file contains hidden or 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
require 'rubygems' | |
require 'minitest/unit' | |
require 'colored' | |
module MiniTest | |
class SpecRunner < Unit | |
def before_suites | |
super if defined?(super) | |
end |
This file contains hidden or 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 Packager | |
class Compressor | |
attr_accessor :templates, :javascripts | |
def initialize(config) | |
@templates = config['templates'] || {} | |
@javascripts = config['javascripts'] || {} | |
end | |
This file contains hidden or 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
after_filter :add_flash_messages | |
# Adds flash messages to the HTTP headers so they can be used on the current request with AJAX | |
def add_flash_messages | |
return true unless response.content_type.to_s.match(/javascript/i) | |
return true if flash.keys.empty? | |
response.headers['X-Flash-Messages'] = flash.to_json | |
flash.discard | |
end |
This file contains hidden or 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
/* | |
Sets up any compass imports, as well as variables used throughout css files. This way all files can access the libraries, but without | |
adding additional code to every css file. | |
*/ | |
//////////////////////////////////////////////// | |
// Import Blueprint defaults | |
//////////////////////////////////////////////// | |
@import "blueprint/grid"; | |
@import "blueprint/typography"; |
This file contains hidden or 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 JabberBot | |
attr_accessor :daemon | |
attr_accessor :messenger | |
def initialize | |
end | |
def activate! | |
@daemon = Daemons.run_proc('dev_bot', :dir => "#{Rails.root}/tmp/pids", :dir_mode => :normal, :monitor => false, :log_output => true ) do |
This file contains hidden or 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 Growl | |
attr_accessor :report, :status | |
def initialize(report, opts = {}) | |
@report, options = report, create_options(opts) | |
message = create_message | |
opts = options.inject([]) do |arr, item| | |
key, value = item.first, item.last |
This file contains hidden or 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
somepackage: | |
- somefile.js | |
anotherpackage: | |
- somefile.js |
This file contains hidden or 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 is copied to spec/ when you run 'rails generate rspec:install' | |
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path("../../config/environment", __FILE__) | |
require 'rspec/rails' | |
# Requires supporting ruby files with custom matchers and macros, etc, | |
# in spec/support/ and its subdirectories. | |
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} | |
RSpec.configure do |config| |
This file contains hidden or 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
# vim:set filetype=ruby: | |
def growl | |
title = "Watchr Test Results" | |
image = $?.success? ? "~/.watchr/images/passed.png" : "~/.watchr/images/failed.png" | |
message = $?.success? ? "success" : "failed" | |
growlnotify = `which growlnotify`.chomp | |
options = "-w -n Watchr --image '#{File.expand_path(image)}' -m '#{message}' '#{title}'" | |
system %(#{growlnotify} #{options} &) | |
end |
This file contains hidden or 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
namespace :factories do | |
task :generate => :environment do | |
# Make a new factory file, moving the old one to factories_old.rb if one exists. | |
factory_file = "#{Rails.root}/spec/factories" | |
FileUtils.mv("#{factory_file}.rb", "#{factory_file}_old.rb") if File.exists?("#{factory_file}.rb") | |
fixture_file = File.open("#{factory_file}.rb", 'w') do |file| | |
NewerOlder