Skip to content

Instantly share code, notes, and snippets.

View caifara's full-sized avatar

Ivo Dancet caifara

View GitHub Profile
# Sets up the Rails environment for Cucumber
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
require 'cucumber/rails/world'
require 'webrat'
require 'cucumber/rails/rspec'
config.include Haml::Helpers
config.include ActionView::Helpers
config.before(:each) do
init_haml_helpers
end
config.include Webrat::HaveTagMatcher
# Usage in console:
# app.rinfo => list of all route helper methods (ending on path without the
# hash_for methods)
# app.rinfo "user" => same list, but only routes containing "user".
# app.rinfo "user", "edit" => same list, but only routes containing "user"
# and "edit".
class ActionDispatch::Integration::Session
def rinfo(*parts)
methods = self.methods.select { |m| m =~ /.*_path$/ && m[0..3] != "hash" }
@caifara
caifara / hudson.rake
Created November 6, 2010 10:40
lib/tasks/hudson.rake
# most of this came from: http://reprocessed.org/blog/easy_rails_ci_with_hudson
namespace :hudson do
def report_path
"hudson/reports/features/"
end
Cucumber::Rake::Task.new({'cucumber' => [:report_setup]}) do |t|
t.cucumber_opts = %{--format junit --out #{report_path}}
t.rcov = true
#!/bin/bash -x
cp config/database.ci.yml config/database.yml
#!/usr/bin/env rvm-shell
bundle install --no-color
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function Send_to_Screen(text)
if !exists("g:slime")
call Screen_Vars()
end
let escaped_text = substitute(shellescape(a:text), "\\\\\n", "\n", "g")
call system("screen -S " . g:slime["sessionname"] . " -p " . g:slime["windowname"] . " -X stuff " . escaped_text)
# add this to your bash_profile
alias vimroom="mvim -S ~/.focus.vim"
template_extension: jst.haml
template_function: Haml
javascripts:
lib:
- public/javascripts/lib/rails.js
- public/javascripts/lib/underscore-min.js
- public/javascripts/lib/backbone-min.js
- public/javascripts/lib/haml.js