Skip to content

Instantly share code, notes, and snippets.

begin
puts "Starting begin. Auth methods: #{ssh_options[:auth_methods]}"
connection_options = ssh_options.merge(
:password => password_value,
:auth_methods => ssh_options[:auth_methods] || methods.shift
)
yield host, user, connection_options
rescue Net::SSH::AuthenticationFailed
puts "Methods: #{methods}. ssh_options: #{ssh_options[:auth_methods]}. Raise if: #{methods.empty? || ssh_options[:auth_methods] ? true : false}"
def test_show_success
event = events(:good_event1) # Loading the event from a fixture file
Event.expects(:find).with('4').returns(event).once
get :show, id: 4
assert_response :success
body = JSON.parse(response.body)
assert_equal 'Title', body.title
assert_equal 'Markup', body.markup
it "gets show successfully" do
event = events(:good_event1) # Loading the event from a fixture file
Event.expects(:find).with('4').returns(event).once
get :show, id: 4
body = JSON.parse(response.body)
body['title'].should == 'Title'
body['markup'].should == 'Markup'
vendor/bundle/ruby/1.9.1/gems/factory_girl-4.2.0/lib/factory_girl/find_definitions.rb:13:in `expand_path'
vendor/bundle/ruby/1.9.1/gems/factory_girl-4.2.0/lib/factory_girl/find_definitions.rb:13:in `block in find_definitions'
vendor/bundle/ruby/1.9.1/gems/factory_girl-4.2.0/lib/factory_girl/find_definitions.rb:13:in `map'
vendor/bundle/ruby/1.9.1/gems/factory_girl-4.2.0/lib/factory_girl/find_definitions.rb:13:in `find_definitions'
config/initializers/factories.rb:8:in `block in <top (required)>'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:410:in `_run__2399400919431794851__call__3256057785106480768__callbacks'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:405:in `__run_callback'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:81:in `run_callbacks'
vendor/bundle/ruby/1.9.1/gems/actionpack-3.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = ENV['VAGRANT_BOX'] || 'centos'
# The url from where the 'config.vm.box' box will be fetched if it
set :platform, :vagrant
set :port, 2222
server "localhost", :app, :redis, :db, :worker, :clockwork, :whenever,
internal_ip: "10.0.2.15",
hostname: "peyote-vagrant",
primary: true,
gb_ram: 0.5,
dns: "collector-vagrant.localhost"
require_relative "sandbox"
[2014/05/13 11:30:03][info] Performing Backup for 'Backup of postgresql peyote_production (postgresql)'!
[2014/05/13 11:30:03][info] [ backup 4.0.1 : ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux] ]
[2014/05/13 11:30:03][info] Database::PostgreSQLFileSystem Started...
pg_start_backup
-----------------
5187/50D34070
(1 row)
/var/lib/pgsql/9.3/data/
/var/lib/pgsql/9.3/data/base/
#!/usr/bin/env ruby
dump_blacklist = %w[
authentications
activity_interactions
activity_participants
campaign_participants
campaign_participants_archive
challenge_participants
challenge_participants_archive
var svg_label_font_size = "10px";
var margin = {top: 20, right: 220, bottom: 20, left: 35},
width = 960 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
var bisectMonth = d3.bisector(function(d) { return d.month; }).left,
formatCurrencyValue = d3.format(",.2f"),
formatCurrency = function(d) { return "$" + formatCurrencyValue(d); },
formatPercentValue = d3.format(",.0f"),