bin/console
#!/usr/bin/env ruby
require "bundler/setup"
# require dependencies from gemspec
require "active_record"
require "aws-sdk-s3"
require "pp"
require "yaml"
dbspec_location = "config/dbspec.yml"
if File.exist?(dbspec_location)
dbspec = YAML.load_file(dbspec_location)
ActiveRecord::Base.establish_connection(dbspec)
ActiveRecord::Base.connection
else
raise "database configuration file #{dbspec_location} not found"
end
require "activerecord_hoarder"
storage_config_path = "config/activerecord_hoarder.yml"
raise "storage configuration file #{storage_config_path}` not found" if !File.exists?(storage_config_path)
storage_options = YAML.load_file(storage_config_path)
::ActiverecordHoarder::Storage.configure(storage: :aws_s3, storage_options: storage_options)
require "irb"
IRB.start(__FILE__)