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
    
  
  
    
  | =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') | 
  
    
      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
    
  
  
    
  | # Our own variable where we deploy this app to | |
| deploy_to = "/srv/example.com" | |
| current_path = "#{deploy_to}/current" | |
| shared_path = "#{deploy_to}/shared" | |
| shared_bundler_gems_path = "#{shared_path}/bundler_gems" | |
| # See http://unicorn.bogomips.org/Sandbox.html | |
| # Helps ensure the correct unicorn_rails is used when upgrading with USR2 | |
| Unicorn::HttpServer::START_CTX[0] = "#{shared_bundler_gems_path}/bin/unicorn_rails" | 
  
    
      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 handlebars_js(name, opts = {}, &block) | |
| inner = capture(&block).gsub(/\s*\n\s*/, " ") | |
| concat raw "window._templates['#{name}'] = #{inner.to_json};\n" | |
| nil | |
| 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
    
  
  
    
  | group :test do | |
| # ... | |
| gem 'vcr' | |
| gem 'fakeweb' | |
| gem 'capybara-mechanize' | |
| 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
    
  
  
    
  | class PostsController < ActionController::Base | |
| def create | |
| Post.create(post_params) | |
| end | |
| def update | |
| Post.find(params[:id]).update_attributes!(post_params) | |
| end | |
| private | 
  
    
      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
    
  
  
    
  | (function(d) { | |
| var dl = d.createElement('a'); | |
| dl.innerText = 'Download MP3'; | |
| dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1]; | |
| dl.download = d.querySelector('em').innerText+".mp3"; | |
| d.querySelector('.primary').appendChild(dl); | |
| dl.style.marginLeft = '10px'; | |
| dl.style.color = 'red'; | |
| dl.style.fontWeight = 700; | |
| })(document); | 
  
    
      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 RemoveRecordFromSolr | |
| @queue = :high | |
| def self.perform(klass, id) | |
| klass.constantize.find(id).remove_from_index! | |
| 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
    
  
  
    
  | class Handlers | |
| constructor: -> | |
| @handlers = {} | |
| register: (handler, registered_class) -> | |
| @handlers[handler] = registered_class | |
| instantiate: (handlers, element) -> | |
| handlers = handlers.replace(/\s/g, '').split(',') | |
| element.handlers = [] | 
  
    
      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
    
  
  
    
  | set :path_to_repo, "/path_to_repo/" | |
| set :running_app_user, "appusername" | |
| namespace :webscale do | |
| desc "Cache a signed out version of the path. Usage: cap webscale:signed_out_cache_page -s path_to_cache=/films/on_netflix" | |
| task :signed_out_cache, roles: :app do | |
| cache_base_path = "#{path_to_repo}/public/signed_out" | |
| cached_destination_path = "#{cache_base_path}#{path_to_cache}.html" | |
| working_path = "#{cached_destination_path}.tmp" | 
  
    
      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 'bundler/setup' | |
| require 'thor/foodcritic' | |
| require 'berkshelf/thor' | |
| require 'thor/scmversion' | 
OlderNewer