A clean workaround for running capybara tests on Rails with assets pipeline enabled.
Original: teamcapybara/capybara#500 (comment)
# NOTE hack to get SimpleCov to load MyEngine | |
# @see http://stackoverflow.com/questions/9501607/simplecov-with-multiple-apps-or-in-short-how-does-simplecov-work | |
# @see https://twitter.com/TheDeadSerious/status/349851185819299840 | |
SimpleCov.adapters.delete(:root_filter) | |
SimpleCov.filters.clear | |
SimpleCov.adapters.define 'engine_filter' do | |
add_filter do |src| | |
!(src.filename =~ /^#{SimpleCov.root}/) unless src.filename =~ /my_engine/ | |
end | |
end |
--- | |
language: objective-c | |
before_script: | |
- ./scripts/travis/add-key.sh | |
after_script: | |
- ./scripts/travis/remove-key.sh | |
after_success: | |
- ./scripts/travis/testflight.sh | |
env: | |
global: |
pdftk original.pdf output uncompressed.pdf uncompress | |
LANG=C sed -n '/^\/Annots/!p' uncompressed.pdf > stripped.pdf | |
pdftk stripped.pdf output final.pdf compress |
# config/initializers/source_maps.rb | |
if Rails.env.development? | |
module CoffeeScript | |
class SourceMapError < StandardError; end; | |
class << self | |
def compile script, options | |
script = script.read if script.respond_to?(:read) |
// automatically adds JS bindings to attach Google Analytics tracking | |
// | |
// defaults | |
// | |
// class: ga-track all elements with this class will have | |
// handlers attached on DOM ready | |
// | |
// data-ga-binding: click the binding on which to fire the tracking | |
// | |
// data-ga-event: _trackEvent the analytics event send to Google |
A clean workaround for running capybara tests on Rails with assets pipeline enabled.
Original: teamcapybara/capybara#500 (comment)
#!/usr/bin/env ruby | |
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. | |
APP_PATH = File.expand_path('../../config/application', __FILE__) | |
require File.expand_path('../../config/boot', __FILE__) | |
# Add --editor option to open generated files in editor | |
# ----------------------------------------------------- | |
module Rails | |
module Generators |
# config/initializers/source_maps.rb | |
if Rails.env.development? | |
require 'open3' | |
module CoffeeScript | |
class SourceMapError < StandardError; end; | |
class << self | |
def map_dir |
#!/bin/bash | |
# License: Public Domain. | |
# Author: Joseph Wecker, 2012 | |
# | |
# -- DEPRICATED -- | |
# This gist is slow and is missing .bashrc_once | |
# Use the one in the repo instead! https://github.com/josephwecker/bashrc_dispatch | |
# (Thanks gioele) | |
# | |
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile? |