Class: Breeze::ChangesController

Inherits:
BreezeController show all
Defined in:
app/controllers/breeze/changes_controller.rb

Instance Method Summary collapse

Methods inherited from BreezeController

#authenticate_if, #current_member_email

Instance Method Details

#commitObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/controllers/breeze/changes_controller.rb', line 9

def commit
  if params[:message].blank?
    message = "must have message"
    redirect_to changes_index_url , alert: message
  else
    out = capture("git add breeze")
    out = capture("git add #{Image.asset_root}" , out)
    out = capture("git config --local user.email #{current_member_email}" ,out)
    out = capture('git commit -m "' + params[:message] + '"' ,out)
    out = capture("git pull --rebase=true" ,out)
    out = capture("git push" ,out)
    ChangeSet.current.zero
    redirect_to changes_index_url , notice: "Changes commited, #{out}"
  end
end

#indexObject



6
7
# File 'app/controllers/breeze/changes_controller.rb', line 6

def index
end

#resetObject



25
26
27
28
29
30
31
32
33
34
35
# File 'app/controllers/breeze/changes_controller.rb', line 25

def reset
  begin
    out = capture("git checkout #{Breeze.data_dir}")
    out = capture("git checkout #{Breeze::Image.asset_root}" , out)
    ChangeSet.current.zero
    message = "Changes reset"
  rescue
    message = "Unknown error occured"
  end
  redirect_to changes_index_url , notice: message
end