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 'steak' | |
| require 'capybara' | |
| require 'capybara/dsl' | |
| require 'rack/test' | |
| RSpec.configure do |config| | |
| def app | |
| Capybara.app | |
| end | |
| config.include Capybara |
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
| Helpers.updateResizeInput = function(el, text){ | |
| if(el.localName == "input" || el[0].localName == "input"){ // inputs are a pain | |
| el.parent().prepend('<span id="test" />'); | |
| var theSpan = $('span#test', el.parent()); | |
| theSpan.value = text; | |
| Helpers.updateResizeInput(theSpan, text); | |
| el.css('font-size', theSpan.css('font-size')); | |
| el.css('margin-top', theSpan.css('margin-top')); | |
| el[0].value = text; | |
| theSpan.remove(); |
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
| ================================================================ | |
| = Trusting an .rvmrc file means that whenever you cd into this = | |
| = directory, RVM will run this .rvmrc script in your shell. = | |
| = = | |
| = If the contents of the file change, you will be re-prompted = | |
| = to review the file and adjust its trust settings. You may = | |
| = also change the trust settings manually at any time with = | |
| = the 'rvm rvmrc' command. = | |
| = = | |
| = Now that you have examined the contents of the file, do you = |
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
| # Gem: http://rubygems.org/gems/devil | |
| # Library: http://openil.sourceforge.net/ | |
| # Images for use with this: http://dl.dropbox.com/u/363740/images.zip | |
| # To install on snow leopard with homebrew: | |
| # 1. brew install devil | |
| # 2. gem install devil | |
| # 3. ??? | |
| # 4. Profit! |
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
| sroot /Developer/SDKs/MacOSX10.7.sdk -x c -c /dev/null 2>&1, NSLocalizedFailureReason=Invalid argument} | |
| 2011-10-17 22:11:05.485 xcodebuild[27904:4103] Warning: Couldn't discover the 'gcc-4.2' compiler's built-in search paths and preprocessor definitions for language dialect 'c'. | |
| Compiler: /Developer/usr/bin/gcc-4.2 | |
| Reason: /Developer/usr/bin/gcc-4.2 -v -E -dM -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.7.sdk -x c -c /dev/null 2>&1 | |
| === BUILD NATIVE TARGET PSMTabBarControlFramework OF PROJECT PSMTabBarControl WITH THE DEFAULT CONFIGURATION (Release) === | |
| Check dependencies | |
| Unsupported compiler 'GCC 4.2' selected for architecture 'x86_64' | |
| ** BUILD FAILED ** |
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
| def should_see(content_array) | |
| content_array.each { |text| page.should have_content(text) } | |
| end | |
| def should_not_see(content_array) | |
| content_array.each { |text| page.should_not have_content(text) } | |
| end | |
| def should_be_on(page) | |
| current_path = URI.parse(current_url).path |
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
| Spork.prefork do | |
| require 'cucumber/rails' | |
| require 'factory_girl_rails' | |
| require 'factory_girl/step_definitions' | |
| require 'database_cleaner' | |
| require 'database_cleaner/cucumber' | |
| Capybara.default_selector = :css | |
| Capybara.default_driver = :selenium | |
| Capybara.server_port = "9887" | |
| Capybara.default_host = "http://www.lvh.me" |
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 :db do | |
| desc "Set Sequences to the correct value" | |
| task :set_sequences => [:environment] do | |
| tables = ActiveRecord::Base.connection.tables | |
| tables.reject! { |t| t =~ /schema_migrations/ } | |
| tables.each do |table| | |
| max_id = table.classify.constantize.maximum(:id) || 1 | |
| puts "Setting id sequence for #{table} to #{max_id}" | |
| ActiveRecord::Base.connection.execute("select setval('#{table}_id_seq', #{max_id})") |
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
| def create | |
| resource = warden.authenticate!(:scope => resource_name, :recall => "new") | |
| respond_to do |format| | |
| format.html do | |
| sign_in_and_redirect(resource_name, resource) | |
| set_flash_message :notice, :signed_in | |
| end | |
| format.xml do | |
| sign_in(resource_name, resource) | |
| render :create |
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
| import sublime, sublime_plugin | |
| import os | |
| class DetectFileTypeCommand(sublime_plugin.EventListener): | |
| """ Detects current file type if the file's extension isn't conclusive """ | |
| """ Modified for Ruby on Rails and Sublime Text 2 """ | |
| """ Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """ | |
| def on_load(self, view): | |
| filename = view.file_name() |