Class: LuTze

Inherits:
Object
  • Object
show all
Defined in:
lib/lu_tze.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLuTze

Returns a new instance of LuTze.



8
9
10
# File 'lib/lu_tze.rb', line 8

def initialize
  save && compress
end

Class Method Details

.gather_and_sendObject



4
5
6
# File 'lib/lu_tze.rb', line 4

def self.gather_and_send
  LuTze.new.upload
end

Instance Method Details

#compressObject



16
17
18
# File 'lib/lu_tze.rb', line 16

def compress
  system compress_command
end

#saveObject



12
13
14
# File 'lib/lu_tze.rb', line 12

def save
  system dump_command
end

#uploadObject



20
21
22
23
24
25
# File 'lib/lu_tze.rb', line 20

def upload
  file = File.new(compressed_file_name, 'r')
  RestClient.post 'http://historian.heroku.com/api/data_backups',
    :site_key  => ENV['historian_key'],
    :backup    => file
end