Class: Admincredible::Resources::Backup
Instance Attribute Summary
#client
Instance Method Summary
collapse
#config, #connection, #initialize
Instance Method Details
#create ⇒ Object
24
25
26
27
28
29
30
31
|
# File 'lib/admincredible/resources/Backup.rb', line 24
def create
response = start
if response['status'] == 302
return step
else
return response
end
end
|
#start ⇒ Object
4
5
6
|
# File 'lib/admincredible/resources/Backup.rb', line 4
def start
client.jget('backups', 'start')
end
|
#step(repeat_until_done = true) ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/admincredible/resources/Backup.rb', line 8
def step(repeat_until_done=true)
response = client.jget('backups', 'step')
if response['status'] == 'working' && repeat_until_done
seconds_left = config.step_after_seconds
seconds_left.times do |i|
sleep 1
end
return step
end
response
end
|