class Lolcommits::Uploldz
Attributes
endpoint[RW]
Public Class Methods
name()
click to toggle source
# File lib/lolcommits/plugins/uploldz.rb, line 56 def self.name 'uploldz' end
new(runner)
click to toggle source
Calls superclass method
Lolcommits::Plugin::new
# File lib/lolcommits/plugins/uploldz.rb, line 8 def initialize(runner) super options.concat( %w( endpoint optional_key optional_http_auth_username optional_http_auth_password ) ) end
runner_order()
click to toggle source
# File lib/lolcommits/plugins/uploldz.rb, line 60 def self.runner_order :postcapture end
Public Instance Methods
configured?()
click to toggle source
# File lib/lolcommits/plugins/uploldz.rb, line 44 def configured? !configuration['enabled'].nil? && configuration['endpoint'] end
run_postcapture()
click to toggle source
# File lib/lolcommits/plugins/uploldz.rb, line 20 def run_postcapture return unless valid_configuration? if runner.git_info.repo.empty? puts 'Repo is empty, skipping upload' else debug "Posting capture to #{configuration['endpoint']}" RestClient.post(configuration['endpoint'], { :file => File.new(runner.main_image), :message => runner.message, :repo => runner.git_info.repo, :author_name => runner.git_info.author_name, :author_email => runner.git_info.author_email, :sha => runner.sha, :key => configuration['optional_key'] }, :Authorization => authorization_header ) end rescue => e log_error(e, "ERROR: RestClient POST FAILED #{e.class} - #{e.message}") end