Class: Lazylead::Task::Savepoint

Inherits:
Object
  • Object
show all
Defined in:
lib/lazylead/task/savepoint.rb

Overview

Send current configuration to admin user.

Instance Method Summary collapse

Constructor Details

#initialize(log = Log.new) ⇒ Savepoint

Returns a new instance of Savepoint.



37
38
39
# File 'lib/lazylead/task/savepoint.rb', line 37

def initialize(log = Log.new)
  @log = log
end

Instance Method Details

#run(_, postman, opts) ⇒ Object



41
42
43
44
45
46
47
48
49
# File 'lib/lazylead/task/savepoint.rb', line 41

def run(_, postman, opts)
  opts["max_size"] = "25" unless opts.key? "max_size"
  path = File.join(
    Lazylead::Home.new.dir,
    ARGV[ARGV.find_index("--sqlite") + 1]
  )
  return unless File.file?(path) && less_mb(path, opts["max_size"])
  postman.send opts.merge("attachments" => [path])
end