Skip to content

Instantly share code, notes, and snippets.

@gucki
gucki / .irbrc
Created September 11, 2013 12:54
irb history per rails project
# ~/.irbrc
require 'irb/completion'
require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 1000
if defined?(::Rails)
IRB.conf[:HISTORY_FILE] = File.join(ENV['PWD'], '.irb-history')
else
# frozen_string_literal: true
require 'bolt/error'
# Quick and dirty implementation of a file sync (instead of simple file upload) using rsync under the hood for puppet bolt.
# Use it the same was as file_upload, ex. sync_file("profiles/lb01/", "/etc/keepalived/", ["lb01-1", "lb01-2"]).
# Most of the code is just copied from the original upload_file method and adjusted as needed.
# This function does nothing if the list of targets is empty.
#
# > **Note:** Not available in apply block