Sha256: de36e7915241181253febc0079581b3cbca688c6e219cf6f707884e9f7a57fb1

Contents?: true

Size: 637 Bytes

Versions: 1

Compression:

Stored size: 637 Bytes

Contents

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

module MinaNotify
  module_function

  def trigger_event(mina_self, event_name)
    begin
      mina = {
          operator: `whoami`,
          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.7 lib/mina_notify.rb