vendor/bundle/ruby/2.1.0/gems/gitlab-flowdock-git-hook-0.4.2.2/lib/flowdock/git.rb
def post(data)
      uri = URI.parse("#{API_ENDPOINT}/#{([@token] + tags).join('+')}")
      req = Net::HTTP::Post.new(uri.path)

      payload_hash = data.to_hash
      if @repo_url
        payload_hash[:repository][:url] = @repo_url
      end
      if @commit_url
        payload_hash[:commits].each do |commit|
          commit[:url] = @commit_url % commit[:id]
        end
      end
      if @diff_url
        payload_hash[:compare] = @diff_url % [payload_hash[:before], payload_hash[:after]]
      end

      req.set_form_data(:payload => MultiJson.encode(payload_hash))
      http = Net::HTTP.new(uri.host, uri.port)

      if uri.scheme == 'https'
        http.verify_mode = OpenSSL::SSL::VERIFY_NONE
        http.use_ssl = true
      end

      http.start { |http| http.request(req) }
    end
# Send git push notification to Flowdock
Send git push notification to Flowdock
Send git push notification to Flowdock
def post(data)
      uri = URI.parse("#{API_ENDPOINT}/#{([@token] + tags).join('+')}")
      req = Net::HTTP::Post.new(uri.path)
      payload_hash = data.to_hash
      if @repo_url
        payload_hash[:repository][:url] = @repo_url
      end
      if @commit_url
        payload_hash[:commits].each do |commit|
          commit[:url] = @commit_url % commit[:id]
        end
      end
      if @diff_url
        payload_hash[:compare] = @diff_url % [payload_hash[:before], payload_hash[:after]]
      end
      req.set_form_data(:payload => MultiJson.encode(payload_hash))
      http = Net::HTTP.new(uri.host, uri.port)
      if uri.scheme == 'https'
        http.verify_mode = OpenSSL::SSL::VERIFY_NONE
        http.use_ssl = true
      end
      http.start { |http| http.request(req) }
    end
def post ( data ) uri = URI . parse ( "#{API_ENDPOINT}/#{([@token] + tags).join('+')}" ) req = Net :: HTTP :: Post . new ( uri . path ) payload_hash = data . to_hash if @repo_url payload_hash [ :repository ] [ :url ] = @repo_url end if @commit_url payload_hash [ :commits ] . each do | commit | commit [ :url ] = @commit_url % commit [ :id ] end end if @diff_url payload_hash [ :compare ] = @diff_url % [ payload_hash [ :before ] , payload_hash [ :after ] ] end req . set_form_data ( :payload => MultiJson . encode ( payload_hash ) ) http = Net :: HTTP . new ( uri . host , uri . port ) if uri . scheme == 'https' http . verify_mode = OpenSSL :: SSL :: VERIFY_NONE http . use_ssl = true end http . start { | http | http . request ( req ) } end
Send git push notification to Flowdock
Send git push notification to Flowdock
data