Class: Hookie::Plugin::FishEyePlugin

Inherits:
BasePlugin show all
Defined in:
lib/hookie/plugins/fisheye_plugin.rb

Instance Attribute Summary

Attributes inherited from BasePlugin

#config

Instance Method Summary collapse

Methods inherited from BasePlugin

#config_key, #initialize, #log

Constructor Details

This class inherits a constructor from Hookie::BasePlugin

Instance Method Details

#post_receiveObject



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/hookie/plugins/fisheye_plugin.rb', line 28

def post_receive
  log "Sending scan request to FishEye ... "
  response = notify()
  if response == []
    log "Request sent to FishEye"
  elsif response[:message]
    log "Error: #{response[:message]}"
  else
    log "Unknown response #{response}"
  end
end

#should_run?Boolean

Returns:

  • (Boolean)


14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/hookie/plugins/fisheye_plugin.rb', line 14

def should_run?
  warnings = []
  if @framework.changes.empty?
    log "No changes"
    return false
  end
  warnings << "hookie.fisheye.apikey not set!" unless @config[:apikey]
  warnings << "hookie.fisheye.url not set!" unless @config[:url]

  log warnings.join(", ") unless warnings.empty?

  warnings.empty?
end

#to_sObject



10
11
12
# File 'lib/hookie/plugins/fisheye_plugin.rb', line 10

def to_s
  "FishEye Notifier"
end