Class: LuTze

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app_name) ⇒ LuTze

Returns a new instance of LuTze.



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

def initialize(app_name)
  @app_name = app_name
  save && compress
end

Instance Attribute Details

#app_nameObject

Returns the value of attribute app_name.



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

def app_name
  @app_name
end

Class Method Details

.gather_and_send(app_name) ⇒ Object



6
7
8
# File 'lib/lu_tze.rb', line 6

def self.gather_and_send(app_name)
  LuTze.new(app_name).upload
end

Instance Method Details

#compressObject



19
20
21
# File 'lib/lu_tze.rb', line 19

def compress
  system compress_command
end

#saveObject



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

def save
  system dump_command
end

#uploadObject



23
24
25
26
27
28
# File 'lib/lu_tze.rb', line 23

def upload
  file = File.new(compressed_file_name, 'r')
  RestClient.post 'http://historian.heroku.com/api/data_backups',
    :site_name => app_name,
    :backup    => file
end