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
# Add to: | |
# Rails.root/config/environments/development.rb | |
# Faster rendering: | |
# Technique described here: | |
# http://rails.lighthouseapp.com/projects/8994/tickets/5847-rails-301-configaction_viewcache_template_loading-is-missing | |
# | |
# According to Jose this is already in Rails 3.1 | |
raise NotImplementedError if Rails.version.starts_with?("3.1") |
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
# Rails.root/.gitignore | |
config/watchr.notify |
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
# app/controllers/bubbles_controller.rb | |
class BubblesController < ApplicationController | |
has_widgets do |root| | |
root << widget(:facebook) | |
end | |
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
require 'guard' | |
require 'guard/guard' | |
require 'libnotify' | |
require 'thread' | |
module Guard | |
class Development < Guard | |
Sempahore = Mutex.new |
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
#!/bin/bash | |
bundle exec rake "$@" | |
if [ $? = 0 ]; | |
then | |
notify-send -u critical "Yeah" -i $HOME/bin/notify-images/happy.jpg | |
else | |
notify-send -u critical "fffuck!" -i $HOME/bin/notify-images/fffuuu.jpg | |
fi |
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
desc 'Runs test:units, test:functionals, test:integration together (also available: test:benchmark, test:profile, test:plugins)' | |
task :test do | |
errors = %w(test:units test:functionals test:integration).collect do |task| | |
begin | |
Rake::Task[task].invoke | |
nil | |
rescue => e | |
task | |
end | |
end.compact |
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 'test/unit' | |
class KeyTest < Test::Unit::TestCase | |
def test_key | |
object = Object.new | |
assert_equal(:submit, object_key(object)) | |
def object.persisted?; true end | |
assert_equal(:update, object_key(object)) |
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
people = 2 | |
nap = 35 | |
admins = people.times.map{ TestUser(:driver => :selenium, :login => admin_login, :password => admin_passwd).extend(Adm) } | |
admins.each{|a| a.sign_in; a.click_link("Business Objects") } | |
# sleep and click | |
admins.each{|a| a.sleep(nap); a.click_link("Dictionaries") } |
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
14:41 <ruby-1.9.2-p180> ~/develop/gavdihrpif (master) > irb | |
ruby-1.9.2-p180-fastrequire :001 > install | |
NameError: undefined local variable or method `install' for main:Object | |
from (irb):1 | |
from /home/rupert/.rvm/rubies/ruby-1.9.2-p180-fastrequire/bin/irb:16:in `<main>' | |
ruby-1.9.2-p180-fastrequire :002 > require 'rake' | |
true | |
ruby-1.9.2-p180-fastrequire :003 > install | |
ArgumentError: wrong number of arguments (1 for 2) | |
from /home/rupert/.rvm/rubies/ruby-1.9.2-p180-fastrequire/lib/ruby/1.9.1/fileutils.rb:846:in `install' |
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
14:59 <ruby-1.9.2-p180> ~/develop/gavdihrpif (master) > irb | |
ruby-1.9.2-p180-fastrequire :001 > module Rake | |
ruby-1.9.2-p180-fastrequire :002?> REDUCE_COMPAT = true | |
ruby-1.9.2-p180-fastrequire :003?> end | |
true | |
ruby-1.9.2-p180-fastrequire :004 > gem 'rake', '0.9.3.beta.1' | |
true | |
ruby-1.9.2-p180-fastrequire :005 > install | |
NameError: undefined local variable or method `install' for main:Object | |
from (irb):5 |