repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/live/storage/dropbox_spec.rb | vagrant/spec/live/storage/dropbox_spec.rb | require File.expand_path('../../../spec_helper', __FILE__)
# To run these tests, you need to setup your Dropbox credentials in
# /vagrant/spec/live.yml
# You also need to have a cached authorization file in
# /vagrant/spec/live/.cache/
# If you already have one, you can simply copy it there.
# If not, change a tes... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/live/storage/cloud_files_spec.rb | vagrant/spec/live/storage/cloud_files_spec.rb | require File.expand_path('../../../spec_helper', __FILE__)
# To run these tests, you need to setup your Cloudfiles credentials in
# /vagrant/spec/live.yml
#
# It's recommended you use dedicated Containers for this, like:
# backup.testing.container
# backup.testing.segments.container
#
module Backup
describe Stor... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/live/notifier/mail_spec.rb | vagrant/spec/live/notifier/mail_spec.rb | require File.expand_path('../../../spec_helper', __FILE__)
# To run these tests, you need to setup your Mail credentials in
# /vagrant/spec/live.yml
#
module Backup
describe Notifier::Mail,
:if => BackupSpec::LIVE['notifier']['mail']['specs_enabled'] == true do
# These tests send actual emails. Check your mai... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/live/syncer/s3_spec.rb | vagrant/spec/live/syncer/s3_spec.rb | require File.expand_path('../../../spec_helper', __FILE__)
# To run these tests, you need to setup your AWS S3 credentials in
# /vagrant/spec/live.yml
#
# It's recommended you use a dedicated Bucket for this, like:
# <aws_username>-backup-testing
#
# Note: The S3 Bucket you use should have read-after-write consist... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/live/syncer/cloud_files_spec.rb | vagrant/spec/live/syncer/cloud_files_spec.rb | require File.expand_path('../../../spec_helper', __FILE__)
# To run these tests, you need to setup your Cloudfiles credentials in
# /vagrant/spec/live.yml
#
# It's recommended you use a dedicated Container for this, like:
# backup.testing.container
#
# Note: Expectations will occasionally fail due to eventual cons... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/archive_spec.rb | spec/archive_spec.rb | require "spec_helper"
module Backup
describe Archive do
let(:model) { Model.new(:test_trigger, "test model") }
describe "#initialize" do
it "sets default values" do
archive = Archive.new(model, :test_archive) {}
expect(archive.name).to eq "test_archive"
expect(archive.options[... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/package_spec.rb | spec/package_spec.rb | require "spec_helper"
module Backup
describe Package do
let(:model) { Model.new(:test_trigger, "test label") }
let(:package) { Package.new(model) }
describe "#initialize" do
it "sets defaults" do
expect(package.time).to be_nil
expect(package.trigger).to eq "test_trigger"
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/cleaner_spec.rb | spec/cleaner_spec.rb | require "spec_helper"
module Backup
describe Cleaner do
let(:model) { Model.new(:test_trigger, "test label") }
describe "#prepare" do
let(:error_tail) do
<<-EOS.gsub(/^ +/, " ")
Please check the log for messages and/or your notifications
concerning this backup: 'test labe... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/pipeline_spec.rb | spec/pipeline_spec.rb | require "spec_helper"
describe "Backup::Pipeline" do
let(:pipeline) { Backup::Pipeline.new }
it "should include Utilities::Helpers" do
expect(Backup::Pipeline
.include?(Backup::Utilities::Helpers)).to eq(true)
end
describe "#initialize" do
it "should create a new pipeline" do
expect(pipel... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/cli_spec.rb | spec/cli_spec.rb | require "spec_helper"
require "rubygems/dependency_installer"
describe "Backup::CLI" do
let(:cli) { Backup::CLI }
let(:s) { sequence "" }
before { @argv_save = ARGV }
after { ARGV.replace(@argv_save) }
describe "#perform" do
let(:model_a) { Backup::Model.new(:test_trigger_a, "test label a"... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/model_spec.rb | spec/model_spec.rb | require "spec_helper"
describe "Backup::Model" do
let(:model) { Backup::Model.new(:test_trigger, "test label") }
let(:s) { sequence "" }
before { Backup::Model.send(:reset!) }
after { Backup::Model.send(:reset!) }
describe ".all" do
it "should be an empty array by default" do
expect(Backup::M... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/logger_spec.rb | spec/logger_spec.rb | require "spec_helper"
module Backup
describe Logger do
let(:console_logger) { double("Console Logger") }
let(:logfile_logger) { double("Logfile Logger") }
let(:syslog_logger) { double("Syslog Logger") }
let(:default_loggers) { [console_logger, logfile_logger] }
# Note: spec_helper calls Logger.... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/splitter_spec.rb | spec/splitter_spec.rb | require "spec_helper"
module Backup
describe Splitter do
let(:model) { Model.new(:test_trigger, "test label") }
let(:package) { model.package }
let(:splitter) { Splitter.new(model, 250, 2) }
let(:splitter_long_suffix) { Splitter.new(model, 250, 3) }
let(:s) { sequence "" }
before do
al... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/utilities_spec.rb | spec/utilities_spec.rb | require "spec_helper"
describe Backup::Utilities do
let(:utilities) { Backup::Utilities }
let(:helpers) { Module.new.extend(Backup::Utilities::Helpers) }
# Note: spec_helper resets Utilities before each example
describe ".configure" do
before do
allow(File).to receive(:executable?).and_return(true)... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/packager_spec.rb | spec/packager_spec.rb | require "spec_helper"
describe "Backup::Packager" do
let(:packager) { Backup::Packager }
it "should include Utilities::Helpers" do
expect(packager.instance_eval("class << self; self; end")
.include?(Backup::Utilities::Helpers)).to eq(true)
end
describe "#package!" do
let(:model) { double }
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/errors_spec.rb | spec/errors_spec.rb | require "spec_helper"
module Backup
describe "Backup Errors" do
shared_examples "a nested exception" do
let(:class_name) { described_class.name.sub(/^Backup::/, "") }
context "with stubbed constants" do
before do
ErrorA = Class.new(described_class)
ErrorB = Class.new(desc... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/config_spec.rb | spec/config_spec.rb | require "spec_helper"
module Backup
describe Config do
let(:config) { Config }
let(:major_gem_version) { Gem::Version.new(Backup::VERSION).segments.first }
# Note: spec_helper resets Config before each example
describe "#load" do
it "loads config.rb and models" do
allow(File).to recei... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/spec_helper.rb | spec/spec_helper.rb | require "rubygems" if RUBY_VERSION < "1.9"
require "bundler/setup"
require "backup"
require "timecop"
Dir[File.expand_path("../support/**/*.rb", __FILE__)].each { |f| require f }
module Backup
module ExampleHelpers
# ripped from MiniTest :)
# RSpec doesn't have a method for this? Am I missing something?
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/storage/s3_spec.rb | spec/storage/s3_spec.rb | require "spec_helper"
module Backup
describe Storage::S3 do
let(:model) { Model.new(:test_trigger, "test label") }
let(:required_config) do
proc do |s3|
s3.access_key_id = "my_access_key_id"
s3.secret_access_key = "my_secret_access_key"
s3.bucket = "my_bucket"
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/storage/dropbox_spec.rb | spec/storage/dropbox_spec.rb | require "spec_helper"
module Backup
describe Storage::Dropbox do
let(:model) { Model.new(:test_trigger, "test label") }
let(:storage) { Storage::Dropbox.new(model) }
let(:s) { sequence "" }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Storage::Base"
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/storage/ftp_spec.rb | spec/storage/ftp_spec.rb | require "spec_helper"
module Backup
describe Storage::FTP do
let(:model) { Model.new(:test_trigger, "test label") }
let(:storage) { Storage::FTP.new(model) }
let(:s) { sequence "" }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Storage::Base"
it_beh... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/storage/scp_spec.rb | spec/storage/scp_spec.rb | require "spec_helper"
module Backup
describe Storage::SCP do
let(:model) { Model.new(:test_trigger, "test label") }
let(:storage) { Storage::SCP.new(model) }
let(:s) { sequence "" }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Storage::Base"
it_beh... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/storage/sftp_spec.rb | spec/storage/sftp_spec.rb | require "spec_helper"
module Backup
describe Storage::SFTP do
let(:model) { Model.new(:test_trigger, "test label") }
let(:storage) { Storage::SFTP.new(model) }
let(:s) { sequence "" }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Storage::Base"
it_b... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/storage/cloud_files_spec.rb | spec/storage/cloud_files_spec.rb | require "spec_helper"
module Backup
describe Storage::CloudFiles do
let(:model) { Model.new(:test_trigger, "test label") }
let(:required_config) do
proc do |cf|
cf.username = "my_username"
cf.api_key = "my_api_key"
cf.container = "my_container"
end
end
let(:s... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/storage/rsync_spec.rb | spec/storage/rsync_spec.rb | require "spec_helper"
module Backup
describe Storage::RSync do
let(:model) { Model.new(:test_trigger, "test label") }
let(:storage) { Storage::RSync.new(model) }
let(:s) { sequence "" }
before do
allow_any_instance_of(Storage::RSync).to \
receive(:utility).with(:rsync).and_return("rsyn... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/storage/local_spec.rb | spec/storage/local_spec.rb | require "spec_helper"
module Backup
describe Storage::Local do
let(:model) { Model.new(:test_trigger, "test label") }
let(:storage) { Storage::Local.new(model) }
let(:s) { sequence "" }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Storage::Base"
it_b... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/storage/qiniu_spec.rb | spec/storage/qiniu_spec.rb | require "spec_helper"
module Backup
describe Storage::Qiniu do
let(:model) { Model.new(:test_trigger, "test label") }
let(:required_config) do
proc do |s3|
s3.access_key = "my_access_key"
s3.secret_key = "my_secret_key"
s3.bucket = "my_bucket"
end
end
let(:stor... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/support/sandbox_file_utils.rb | spec/support/sandbox_file_utils.rb | #
# Provides the ability to perform +FileUtils+ actions, while restricting
# any destructive actions outside of the specified +sandbox_path+.
#
# == Usage
#
# To enable protection:
#
# require 'sandbox_file_utils'
#
# SandboxFileUtils.activate!
# SandboxFileUtils.sandbox_path = 'my_sandbox'
# # or
# # Sandbox... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/support/very_specific_error.rb | spec/support/very_specific_error.rb | class VerySpecificError < StandardError; end
| ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/support/shared_examples/storage.rb | spec/support/shared_examples/storage.rb | shared_examples "a subclass of Storage::Base" do
let(:storage_name) { described_class.name.sub("Backup::", "") }
describe "#initialize" do
it "sets a reference to the model" do
expect(storage.model).to be model
end
it "sets a reference to the package" do
expect(storage.package).to be model... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/support/shared_examples/config_defaults.rb | spec/support/shared_examples/config_defaults.rb | shared_examples "a class that includes Config::Helpers" do
describe "setting defaults" do
let(:accessor_names) do
(described_class.instance_methods - Class.methods)
.select { |method| method.to_s.end_with?("=") }
.map { |name| name.to_s.chomp("=") }
end
before do
overrides = r... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/support/shared_examples/notifier.rb | spec/support/shared_examples/notifier.rb | shared_examples "a subclass of Notifier::Base" do
let(:notifier) { described_class.new(model) }
let(:notifier_name) { described_class.name.sub("Backup::", "") }
describe "#perform" do
context "when the model succeeded without warnings" do
before { allow(model).to receive(:exit_status).and_return(0) }
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/support/shared_examples/database.rb | spec/support/shared_examples/database.rb | shared_examples "a subclass of Database::Base" do
describe "#initialize" do
it "sets a reference to the model" do
expect(db.model).to be(model)
end
it "cleans database_id for filename use" do
block = respond_to?(:required_config) ? required_config : proc {}
db = described_class.new(mod... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/support/shared_examples/syncer/cloud.rb | spec/support/shared_examples/syncer/cloud.rb | shared_examples "a subclass of Syncer::Cloud::Base" do
let(:syncer_name) { described_class.name.sub("Backup::", "") }
let(:s) { sequence "" }
describe "#initialize" do
it "strips leading path separator" do
pre_config = required_config
klass = described_class.new do |syncer|
pre_config.cal... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/notifier/mail_spec.rb | spec/notifier/mail_spec.rb | require "spec_helper"
module Backup
describe Notifier::Mail do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::Mail.new(model) }
before do
allow_any_instance_of(Notifier::Mail).to receive(:utility)
.with(:sendmail).and_return("/path/to/sendmail")
all... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/notifier/flowdock_spec.rb | spec/notifier/flowdock_spec.rb | require "spec_helper"
module Backup
describe Notifier::FlowDock do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::FlowDock.new(model) }
let(:s) { sequence "" }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Notifier::Base... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/notifier/prowl_spec.rb | spec/notifier/prowl_spec.rb | require "spec_helper"
module Backup
describe Notifier::Prowl do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::Prowl.new(model) }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Notifier::Base"
describe "#initialize" do
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/notifier/command_notifier_spec.rb | spec/notifier/command_notifier_spec.rb | require "spec_helper"
module Backup
describe Notifier::Command do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) do
Notifier::Command.new(model) do |cmd|
cmd.command = "notify-send"
cmd.args = [->(model, _) { model.label.upcase }, "%V | %t"]
end
end
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/notifier/slack_spec.rb | spec/notifier/slack_spec.rb | require "spec_helper"
module Backup
describe Notifier::Slack do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::Slack.new(model) }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Notifier::Base"
describe "#initialize" do
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/notifier/nagios_spec.rb | spec/notifier/nagios_spec.rb | require "spec_helper"
module Backup
describe Notifier::Nagios do
let(:model) { Model.new(:test_trigger, "test model") }
let(:notifier) { Notifier::Nagios.new(model) }
before do
allow(Utilities).to receive(:utility).with(:send_nsca).and_return("send_nsca")
allow(Config).to receive(:hostname).... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/notifier/pushover_spec.rb | spec/notifier/pushover_spec.rb | require "spec_helper"
module Backup
describe Notifier::Pushover do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::Pushover.new(model) }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Notifier::Base"
describe "#initialize... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/notifier/http_post_spec.rb | spec/notifier/http_post_spec.rb | require "spec_helper"
module Backup
describe Notifier::HttpPost do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) do
Notifier::HttpPost.new(model) do |post|
post.uri = "https://www.example.com/path"
end
end
let(:default_form_data) do
"message=%5BBackup... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/notifier/pagerduty_spec.rb | spec/notifier/pagerduty_spec.rb | require "spec_helper"
module Backup
describe Notifier::PagerDuty do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::PagerDuty.new(model) }
describe "#initialize" do
it "has sensible defaults" do
expect(notifier.service_key).to be_nil
expect(notifie... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/notifier/datadog_spec.rb | spec/notifier/datadog_spec.rb | require "spec_helper"
module Backup
describe Notifier::DataDog do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::DataDog.new(model) }
let(:s) { sequence "" }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Notifier::Base"
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/notifier/campfire_spec.rb | spec/notifier/campfire_spec.rb | require "spec_helper"
module Backup
describe Notifier::Campfire do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::Campfire.new(model) }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Notifier::Base"
describe "#initialize... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/notifier/zabbix_spec.rb | spec/notifier/zabbix_spec.rb | require "spec_helper"
module Backup
describe Notifier::Zabbix do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::Zabbix.new(model) }
before do
allow(Utilities).to receive(:utility).with(:zabbix_sender).and_return("zabbix_sender")
allow(Config).to receive(:ho... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/notifier/hipchat_spec.rb | spec/notifier/hipchat_spec.rb | require "spec_helper"
module Backup
describe Notifier::Hipchat do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::Hipchat.new(model) }
let(:s) { sequence "" }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Notifier::Base"
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/notifier/twitter_spec.rb | spec/notifier/twitter_spec.rb | require "spec_helper"
module Backup
describe Notifier::Twitter do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::Twitter.new(model) }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Notifier::Base"
describe "#initialize" ... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/notifier/ses_spec.rb | spec/notifier/ses_spec.rb | require "spec_helper"
module Backup
describe Notifier::Ses do
let(:model) { Model.new(:test_trigger, "test label") }
let(:notifier) { Notifier::Ses.new(model) }
it_behaves_like "a class that includes Config::Helpers"
it_behaves_like "a subclass of Notifier::Base"
describe "#initialize" do
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/logger/fog_adapter_spec.rb | spec/logger/fog_adapter_spec.rb | require "spec_helper"
module Backup
describe Logger::FogAdapter do
it "replaces STDOUT fog warning channel" do
expect(Fog::Logger[:warning]).to be Logger::FogAdapter
end
describe "#tty?" do
it "returns false" do
expect(Logger::FogAdapter.tty?).to be(false)
end
end
desc... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/logger/console_spec.rb | spec/logger/console_spec.rb | require "spec_helper"
module Backup
describe Logger::Console do
let(:timestamp) { Time.now.utc.strftime("%Y/%m/%d %H:%M:%S") }
before do
expect_any_instance_of(Logger::Logfile).to receive(:log).never
expect_any_instance_of(Logger::Syslog).to receive(:log).never
Logger.configure do
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/logger/logfile_spec.rb | spec/logger/logfile_spec.rb | require "spec_helper"
module Backup
describe Logger::Logfile do
before do
@tmpdir = Dir.mktmpdir("backup_spec")
SandboxFileUtils.activate!(@tmpdir)
@log_path_absolute = File.join(@tmpdir, "log_path")
@logfile_absolute = File.join(@log_path_absolute, "backup.log")
@root_path = File.... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/logger/syslog_spec.rb | spec/logger/syslog_spec.rb | require "spec_helper"
module Backup
describe Logger::Syslog do
before do
expect_any_instance_of(Logger::Console).to receive(:log).never
expect_any_instance_of(Logger::Logfile).to receive(:log).never
Logger.configure do
console.quiet = true
logfile.enabled = false
syslog.... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/cloud_io/s3_spec.rb | spec/cloud_io/s3_spec.rb | require "spec_helper"
require "backup/cloud_io/s3"
module Backup
describe CloudIO::S3 do
let(:connection) { double }
describe "#upload" do
context "with multipart support" do
let(:cloud_io) { CloudIO::S3.new(bucket: "my_bucket", chunk_size: 5) }
let(:parts) { double }
context ... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/cloud_io/cloud_files_spec.rb | spec/cloud_io/cloud_files_spec.rb | require "spec_helper"
require "backup/cloud_io/cloud_files"
module Backup # rubocop:disable Metrics/ModuleLength
describe CloudIO::CloudFiles do
let(:connection) { double }
describe "#upload" do
before do
expect_any_instance_of(described_class).to receive(:create_containers)
end
c... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | true |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/compressor/bzip2_spec.rb | spec/compressor/bzip2_spec.rb | require "spec_helper"
describe Backup::Compressor::Bzip2 do
before do
allow_any_instance_of(Backup::Compressor::Bzip2).to receive(:utility).and_return("bzip2")
end
it "should be a subclass of Compressor::Base" do
expect(Backup::Compressor::Bzip2
.superclass).to eq(Backup::Compressor::Base)
end
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/compressor/gzip_spec.rb | spec/compressor/gzip_spec.rb | require "spec_helper"
describe Backup::Compressor::Gzip do
before do
allow(Backup::Compressor::Gzip).to receive(:utility).and_return("gzip")
Backup::Compressor::Gzip.instance_variable_set(:@has_rsyncable, true)
allow_any_instance_of(Backup::Compressor::Gzip).to receive(:utility).and_return("gzip")
end
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/compressor/base_spec.rb | spec/compressor/base_spec.rb | require "spec_helper"
describe Backup::Compressor::Base do
let(:compressor) { Backup::Compressor::Base.new }
it "should include Utilities::Helpers" do
expect(Backup::Compressor::Base
.include?(Backup::Utilities::Helpers)).to eq(true)
end
it "should include Config::Helpers" do
expect(Backup::Com... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/compressor/custom_spec.rb | spec/compressor/custom_spec.rb | require "spec_helper"
describe Backup::Compressor::Custom do
let(:compressor) { Backup::Compressor::Custom.new }
before(:context) do
# Utilities::Helpers#utility will raise an error
# if the command is invalid or not set
Backup::Compressor::Custom.send(
:define_method, :utility,
->(arg) { ... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/config/dsl_spec.rb | spec/config/dsl_spec.rb | require "spec_helper"
module Backup
describe Config::DSL do
describe ".add_dsl_constants" do
it "adds constants when the module is loaded" do
described_class.constants.each do |const|
described_class.send(:remove_const, const)
end
expect(described_class.constants).to be_em... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/config/helpers_spec.rb | spec/config/helpers_spec.rb | require "spec_helper"
module Backup
describe "Config::Helpers" do
before do
class Foo
include Backup::Config::Helpers
attr_accessor :accessor, :accessor_two
attr_reader :reader
attr_deprecate :removed,
version: "1.1"
attr_deprecate :removed_with_message,
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/database/mysql_spec.rb | spec/database/mysql_spec.rb | require "spec_helper"
module Backup
describe Database::MySQL do
let(:model) { Model.new(:test_trigger, "test label") }
let(:db) { Database::MySQL.new(model) }
let(:s) { sequence "" }
before do
allow_any_instance_of(Database::MySQL).to receive(:utility)
.with(:mysqldump).and_return("mys... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/database/riak_spec.rb | spec/database/riak_spec.rb | require "spec_helper"
module Backup
describe Database::Riak do
let(:model) { Model.new(:test_trigger, "test label") }
let(:db) { Database::Riak.new(model) }
let(:s) { sequence "" }
before do
allow_any_instance_of(Database::Riak).to receive(:utility)
.with("riak-admin").and_return("riak... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/database/openldap_spec.rb | spec/database/openldap_spec.rb | require "spec_helper"
module Backup
describe Database::OpenLDAP do
let(:model) { Model.new(:test_trigger, "test label") }
let(:db) { Database::OpenLDAP.new(model) }
let(:s) { sequence "" }
before do
allow_any_instance_of(Database::OpenLDAP).to receive(:utility)
.with(:slapcat).and_retu... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/database/redis_spec.rb | spec/database/redis_spec.rb | require "spec_helper"
module Backup
describe Database::Redis do
let(:model) { Model.new(:test_trigger, "test label") }
let(:required_config) do
proc do |redis|
redis.rdb_path = "rdb_path_required_for_copy_mode"
end
end
let(:db) { Database::Redis.new(model, &required_config) }
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/database/mongodb_spec.rb | spec/database/mongodb_spec.rb | require "spec_helper"
module Backup
describe Database::MongoDB do
let(:model) { Model.new(:test_trigger, "test label") }
let(:db) { Database::MongoDB.new(model) }
before do
allow_any_instance_of(Database::MongoDB).to receive(:utility)
.with(:mongodump).and_return("mongodump")
allow_a... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/database/sqlite_spec.rb | spec/database/sqlite_spec.rb | require "spec_helper"
module Backup
describe Database::SQLite do
let(:model) { Model.new(:test_trigger, "test label") }
let(:db) do
Database::SQLite.new(model) do |db|
db.path = "/tmp/db1.sqlite3"
db.sqlitedump_utility = "/path/to/sqlitedump"
end
end
before do
allow... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/database/postgresql_spec.rb | spec/database/postgresql_spec.rb | require "spec_helper"
module Backup
describe Database::PostgreSQL do
let(:model) { Model.new(:test_trigger, "test label") }
let(:db) { Database::PostgreSQL.new(model) }
let(:s) { sequence "" }
before do
allow(Utilities).to receive(:utility).with(:pg_dump).and_return("pg_dump")
allow(Util... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/syncer/rsync/pull_spec.rb | spec/syncer/rsync/pull_spec.rb | require "spec_helper"
module Backup
describe Syncer::RSync::Pull do
before do
allow_any_instance_of(Syncer::RSync::Pull).to \
receive(:utility).with(:rsync).and_return("rsync")
allow_any_instance_of(Syncer::RSync::Pull).to \
receive(:utility).with(:ssh).and_return("ssh")
end
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/syncer/rsync/push_spec.rb | spec/syncer/rsync/push_spec.rb | require "spec_helper"
module Backup
describe Syncer::RSync::Push do
before do
allow_any_instance_of(Syncer::RSync::Push).to \
receive(:utility).with(:rsync).and_return("rsync")
allow_any_instance_of(Syncer::RSync::Push).to \
receive(:utility).with(:ssh).and_return("ssh")
end
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/syncer/rsync/local_spec.rb | spec/syncer/rsync/local_spec.rb | require "spec_helper"
module Backup
describe Syncer::RSync::Local do
before do
allow_any_instance_of(Syncer::RSync::Local).to \
receive(:utility).with(:rsync).and_return("rsync")
end
describe "#initialize" do
after { Syncer::RSync::Local.clear_defaults! }
it "should use the va... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/syncer/cloud/s3_spec.rb | spec/syncer/cloud/s3_spec.rb | require "spec_helper"
module Backup
describe Syncer::Cloud::S3 do
let(:required_config) do
proc do |s3|
s3.access_key_id = "my_access_key_id"
s3.secret_access_key = "my_secret_access_key"
s3.bucket = "my_bucket"
end
end
let(:required_iam_config) do
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/syncer/cloud/local_file_spec.rb | spec/syncer/cloud/local_file_spec.rb | require "spec_helper"
module Backup
describe Syncer::Cloud::LocalFile do
describe ".find" do
before do
@tmpdir = Dir.mktmpdir("backup_spec")
SandboxFileUtils.activate!(@tmpdir)
FileUtils.mkdir_p File.join(@tmpdir, "sync_dir/sub_dir")
allow(Utilities).to receive(:utility).and... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/syncer/cloud/cloud_files_spec.rb | spec/syncer/cloud/cloud_files_spec.rb | require "spec_helper"
module Backup
describe Syncer::Cloud::CloudFiles do
let(:required_config) do
proc do |cf|
cf.username = "my_username"
cf.api_key = "my_api_key"
cf.container = "my_container"
end
end
let(:syncer) { Syncer::Cloud::CloudFiles.new(&required_conf... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/encryptor/gpg_spec.rb | spec/encryptor/gpg_spec.rb | require "spec_helper"
describe Backup::Encryptor::GPG do
let(:encryptor) do
Backup::Encryptor::GPG.new do |e|
e.mode = :symmetric
e.passphrase = "test secret"
end
end
it "should be a subclass of Encryptor::Base" do
expect(Backup::Encryptor::GPG
.superclass).to eq(Backup::Encryptor:... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | true |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/encryptor/open_ssl_spec.rb | spec/encryptor/open_ssl_spec.rb | require "spec_helper"
describe Backup::Encryptor::OpenSSL do
let(:encryptor) do
Backup::Encryptor::OpenSSL.new do |e|
e.password = "mypassword"
e.password_file = "/my/password/file"
e.base64 = true
end
end
it "should be a subclass of Encryptor::Base" do
expect(Backup::E... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/spec/encryptor/base_spec.rb | spec/encryptor/base_spec.rb | require "spec_helper"
describe Backup::Encryptor::Base do
let(:base) { Backup::Encryptor::Base.new }
it "should include Utilities::Helpers" do
expect(Backup::Encryptor::Base
.include?(Backup::Utilities::Helpers)).to eq(true)
end
it "should include Config::Helpers" do
expect(Backup::Encryptor::B... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup.rb | lib/backup.rb | # Load Ruby Core Libraries
require "time"
require "fileutils"
require "tempfile"
require "syslog"
require "yaml"
require "etc"
require "forwardable"
require "thread"
require "open4"
require "thor"
require "shellwords"
require "excon"
# Include response.inspect in error messages.
Excon.defaults[:debug_response] = true... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup/packager.rb | lib/backup/packager.rb | module Backup
module Packager
class Error < Backup::Error; end
class << self
include Utilities::Helpers
##
# Build the final package for the backup model.
def package!(model)
@package = model.package
@encryptor = model.encryptor
@splitter = model.splitter
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup/pipeline.rb | lib/backup/pipeline.rb | module Backup
class Pipeline
class Error < Backup::Error; end
include Utilities::Helpers
attr_reader :stderr, :errors
def initialize
@commands = []
@success_codes = []
@errors = []
@stderr = ""
end
##
# Adds a command to be executed in the pipeline.
# Each c... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup/version.rb | lib/backup/version.rb | module Backup
VERSION = "5.0.0.beta.3"
end
| ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup/logger.rb | lib/backup/logger.rb | require "backup/logger/console"
require "backup/logger/logfile"
require "backup/logger/syslog"
require "backup/logger/fog_adapter"
module Backup
class Logger
class Config
class Logger < Struct.new(:class, :options)
def enabled?
options.enabled?
end
end
class DSL < Str... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup/errors.rb | lib/backup/errors.rb | module Backup
# Provides cascading errors with formatted messages.
# See the specs for details.
module NestedExceptions
def self.included(klass)
klass.extend(Module.new do
def wrap(wrapped_exception, msg = nil)
new(msg, wrapped_exception)
end
end)
end
def initial... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup/package.rb | lib/backup/package.rb | module Backup
class Package
##
# The time when the backup initiated (in format: 2011.02.20.03.29.59)
attr_accessor :time
##
# The trigger which initiated the backup process
attr_reader :trigger
##
# Extension for the final archive file(s)
attr_accessor :extension
##
# Se... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup/utilities.rb | lib/backup/utilities.rb | module Backup
module Utilities
class Error < Backup::Error; end
UTILITIES_NAMES = %w[
tar cat split sudo chown hostname
gzip bzip2
mongo mongodump mysqldump innobackupex
pg_dump pg_dumpall redis-cli riak-admin
gpg openssl
rsync ssh
sendmail exim
send_nsca
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup/splitter.rb | lib/backup/splitter.rb | module Backup
class Splitter
include Utilities::Helpers
attr_reader :package, :chunk_size, :suffix_length
def initialize(model, chunk_size, suffix_length)
@package = model.package
@chunk_size = chunk_size
@suffix_length = suffix_length
end
##
# This is called as part of th... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup/cleaner.rb | lib/backup/cleaner.rb | module Backup
module Cleaner
class Error < Backup::Error; end
class << self
##
# Logs warnings if any temporary files still exist
# from the last time this model/trigger was run,
# then removes the files.
def prepare(model)
messages = []
packaging_folder = File.... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup/template.rb | lib/backup/template.rb | require "erb"
module Backup
class Template
# Holds a binding object. Nil if not provided.
attr_accessor :binding
##
# Creates a new instance of the Backup::Template class
# and optionally takes an argument that can be either a binding object, a Hash or nil
def initialize(object = nil)
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup/cli.rb | lib/backup/cli.rb | ##
# Build the Backup Command Line Interface using Thor
module Backup
class CLI < Thor
class Error < Backup::Error; end
class FatalError < Backup::FatalError; end
##
# [Perform]
#
# The only required option is the --trigger [-t].
# If --config-file, --data-path, --tmp-path or --log-path
... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup/config.rb | lib/backup/config.rb | require "backup/config/dsl"
require "backup/config/helpers"
module Backup
module Config
class Error < Backup::Error; end
DEFAULTS = {
config_file: "config.rb",
data_path: ".data",
tmp_path: ".tmp"
}
class << self
include Utilities::Helpers
attr_reader :user, :root_pat... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup/model.rb | lib/backup/model.rb | module Backup
class Model
class Error < Backup::Error; end
class FatalError < Backup::FatalError; end
class << self
##
# The Backup::Model.all class method keeps track of all the models
# that have been instantiated. It returns the @all class variable,
# which contains an array of... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup/binder.rb | lib/backup/binder.rb | module Backup
class Binder
##
# Creates a new Backup::Notifier::Binder instance. Loops through the provided
# Hash to set instance variables
def initialize(key_and_values)
key_and_values.each do |key, value|
instance_variable_set("@#{key}", value)
end
end
##
# Returns ... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup/archive.rb | lib/backup/archive.rb | module Backup
class Archive
class Error < Backup::Error; end
include Utilities::Helpers
attr_reader :name, :options
##
# Adds a new Archive to a Backup Model.
#
# Backup::Model.new(:my_backup, 'My Backup') do
# archive :my_archive do |archive|
# archive.add 'pat... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup/storage/local.rb | lib/backup/storage/local.rb | module Backup
module Storage
class Local < Base
include Storage::Cycler
class Error < Backup::Error; end
def initialize(model, storage_id = nil)
super
@path ||= "~/backups"
end
private
def transfer!
FileUtils.mkdir_p(remote_path)
transfer_me... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup/storage/rsync.rb | lib/backup/storage/rsync.rb | module Backup
module Storage
class RSync < Base
include Utilities::Helpers
##
# Mode of operation
#
# [:ssh (default)]
# Connects to the remote via SSH.
# Does not use an rsync daemon on the remote.
#
# [:ssh_daemon]
# Connects to the remote via S... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup/storage/dropbox.rb | lib/backup/storage/dropbox.rb | require "dropbox_sdk"
module Backup
module Storage
class Dropbox < Base
include Storage::Cycler
class Error < Backup::Error; end
##
# Dropbox API credentials
attr_accessor :api_key, :api_secret
##
# Path to store cached authorized session.
#
# Relative path... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup/storage/sftp.rb | lib/backup/storage/sftp.rb | require "net/sftp"
module Backup
module Storage
class SFTP < Base
include Storage::Cycler
##
# Server credentials
attr_accessor :username, :password, :ssh_options
##
# Server IP Address and SFTP port
attr_accessor :ip, :port
def initialize(model, storage_id = ni... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup/storage/base.rb | lib/backup/storage/base.rb | module Backup
module Storage
class Base
include Config::Helpers
##
# Base path on the remote where backup package files will be stored.
attr_accessor :path
##
# Number of backups to keep or time until which to keep.
#
# If an Integer is given it sets the limit to ... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup/storage/ftp.rb | lib/backup/storage/ftp.rb | require "net/ftp"
module Backup
module Storage
class FTP < Base
include Storage::Cycler
##
# Server credentials
attr_accessor :username, :password
##
# Server IP Address and FTP port
attr_accessor :ip, :port
##
# Use passive mode?
attr_accessor :pass... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
backup/backup | https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/lib/backup/storage/s3.rb | lib/backup/storage/s3.rb | require "backup/cloud_io/s3"
module Backup
module Storage
class S3 < Base
include Storage::Cycler
class Error < Backup::Error; end
##
# Amazon Simple Storage Service (S3) Credentials
attr_accessor :access_key_id, :secret_access_key, :use_iam_profile
##
# Amazon S3 buck... | ruby | MIT | 86c9b07c2a2974376888b1506001f77792d6359a | 2026-01-04T15:45:04.712671Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.