Sha256: 3ce238774e007ec7a127091f17a8db92a3ed51444f08826d61dcaa0e62d99b83

Contents?: true

Size: 666 Bytes

Versions: 1

Compression:

Stored size: 666 Bytes

Contents

require "mina_notify/version"
require 'mina'
require 'json'
require 'faraday'

module MinaNotify
  module_function

  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
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mina_notify-0.1.8 lib/mina_notify.rb