Command Line
pry -r ./config/app_init_file.rb- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb- load your rails into a pry session
Debugger
| # Also @see https://www.viget.com/articles/protip-passing-parameters-to-your-rake-tasks for | |
| # examples using dependents and default values for arguments (see the updates at the end) | |
| # Avdi Grimm's rake tutorial is really helpful. His section on FileLists: | |
| # @see http://www.virtuouscode.com/2014/04/22/rake-part-2-file-lists/ | |
| # Rails: | |
| # * to get access to Rails models, etc, your task must depend on the :environment task | |
| # ex: task :my_task => :environment do .... |
| body { | |
| /* make page scrollable to test disableScroll works */ | |
| height: 2000px; | |
| } | |
| .micromodal { | |
| display: none; | |
| } | |
| .micromodal.is-open { |
| require "open-uri" | |
| require "net/http" | |
| Error = Class.new(StandardError) | |
| DOWNLOAD_ERRORS = [ | |
| SocketError, | |
| OpenURI::HTTPError, | |
| RuntimeError, | |
| URI::InvalidURIError, |
| brew tap homebrew/versions | |
| brew install v8-315 | |
| gem install libv8 -v '3.16.14.13' -- --with-system-v8 | |
| gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315 | |
| bundle install |
Command Line
pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb - load your rails into a pry sessionDebugger
| # Author: Pieter Noordhuis | |
| # Description: Simple demo to showcase Redis PubSub with EventMachine | |
| # | |
| # Update 7 Oct 2010: | |
| # - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
| # the WebSocket protocol implementation in the cramp gem does not work | |
| # well with Chrome's (newer) WebSocket implementation. | |
| # | |
| # Requirements: | |
| # - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
| class HelloWorldController < AbstractController::Base | |
| include AbstractController::Rendering | |
| include AbstractController::Layouts | |
| include AbstractController::Helpers | |
| include AbstractController::Translation | |
| include AbstractController::AssetPaths | |
| include ActionController::UrlWriter | |
| # Uncomment if you want to use helpers defined in ApplicationHelper in your views | |
| # helper ApplicationHelper |
| it"is invalid without a first name"do | |
| expect(Contact.new(firstname: nil)).to_not have(1).errors_on(:firstname) | |
| end |
| def add_item_to_cart | |
| item = cart.add_item(permitted_params.item) | |
| redeem_coupon | |
| if item.save | |
| binding.pry | |
| log_fake_option cart, item | |
| cart.update_attributes(state: 'terms') unless cart.terms? | |
| else | |
| flash[:notice] = item.errors.full_messages.join(" ") |
| def available_options_for(item) | |
| validate_available_options(item.product).tap do |options| | |
| options << item.option unless options.include?(item.option) | |
| end | |
| end |