Class: Octodmin::Controllers::Deploys::Create

Inherits:
Object
  • Object
show all
Includes:
Action
Defined in:
app/controllers/deploys/create.rb

Instance Method Summary collapse

Instance Method Details

#call(params) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/deploys/create.rb', line 6

def call(params)
  self.format = :json

  site = Octodmin::Site.new
  site.process

  options = site.config["octodmin"]["deploys"].first
  Octopress::Deploy.push(options)

  @message = "Deployed successfully"
rescue SystemExit => e
  halt 400, JSON.dump(errors: [e.message])
end