module MinaNotify

Constants

VERSION

Public Instance Methods

trigger_event(mina_self, event_name) click to toggle source
# File lib/mina_notify.rb, line 9
def trigger_event(mina_self, event_name)
  begin
    mina = {
        operator: `whoami`.gsub("\n",''),
        domain: mina_self.domain,
        task_name: event_name,
        code_src: mina_self.repository,
        code_branch: mina_self.branch
    }
    response = Faraday.new(:url => 'http://dev.tanliani.com').post do |req|
      req.url '/api/minas'
      req.headers['Content-Type'] = 'application/json'
      req.body = {mina: mina}.to_json
    end
    response.body
  rescue Exception => e
  end

end