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 'diffy'; File.open(Rails.root.join('diff'), 'w') {|f| f.write Diffy::Diff.new event_json, expected_json} |
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
should 'support custom read only mode handler methods' do | |
controller = CustomReadOnlyHandlerTestController.new | |
controller.params = HashWithIndifferentAccess.new | |
controller.request = ActionController::TestRequest.new | |
controller.response = ActionController::TestResponse.new | |
controller.expects(:my_read_only_handler).at_least_once | |
controller.process :foo | |
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
setup do | |
# Setup a route for our fake controller | |
Rails.application.routes.draw do | |
get "/readonlymodetest/foo" => "DOMAIN/read_only_mode_test#foo" | |
get "/readonlymodetest/foo_with_write" => "DOMAIN/read_only_mode_test#foo_with_write" | |
root :to => 'pages#show', :id => 'home' | |
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
# require 'guard/plugin' | |
# | |
# module ::Guard | |
# class BackupifyTest < ::Guard::Plugin | |
# def run_all | |
# end | |
# | |
# def run_on_changes(paths) | |
# paths.each do |path| | |
# raise :task_has_failed unless system "ruby -Itest #{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
# Inherits everything else from defaul Rubocop config | |
Metrics/LineLength: | |
Max: 100 | |
Style/SpaceBeforeBlockBraces: | |
Enabled: false | |
Style/SpaceInsideBlockBraces: | |
Enabled: false |
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
# A generic error that implementations can use to wrap their exceptions with | |
class BaseWrapperException < StandardError | |
def initialize(e = nil) | |
super e | |
return self unless e.present? && e.is_a?(Exception) | |
# Preserve the original exception's data | |
set_backtrace e.backtrace | |
message.prepend "#{e.class}: " | |
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
ps xa | grep postgres: | grep "backupify_development" | grep -v grep | awk '{print $1}' | xargs kill |
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
kill $(cat tmp/pids/server.pid) |
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
ctags -R --languages=ruby --exclude=.git --exclude=log . $(bundle list --paths) |
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
# grep all files in this directory (and subdirectories) that end in .rb and contain 'guests = self.guests' | |
grep -r 'guests = self.guests' . --include \*.rb |
OlderNewer