Sha256: af2ec1b7f39e204eb929d3bc06bec8078fce7cd00c6b01e97ed783f7d732950b

Contents?: true

Size: 1.01 KB

Versions: 4

Compression:

Stored size: 1.01 KB

Contents

#!/usr/bin/env ruby

require 'logger'
require 'fileutils'

RAILS_ENV = "production"
RAILS_ROOT = FileUtils.pwd
RAILS_DEFAULT_LOGGER = Logger.new(STDOUT)

$: << File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'projectlocker_errata'
require 'rails/init'

fail "Please supply an API Key as the first argument" if ARGV.empty?

host = ARGV[1]
host ||= "api.projectlocker_errata.io"

secure = (ARGV[2] == "secure")

exception = begin
              raise "Testing projectlocker_errata notifier with secure = #{secure}. If you can see this, it works."
            rescue => foo
              foo
            end

ProjectlockerErrata.configure do |config|
  config.secure  = secure
  config.host    = host
  config.api_key = ARGV.first
end
puts "Configuration:"
ProjectlockerErrata.configuration.to_hash.each do |key, value|
  puts sprintf("%25s: %s", key.to_s, value.inspect.slice(0, 55))
end
puts "Sending #{secure ? "" : "in"}secure notification to project with key #{ARGV.first}"
ProjectlockerErrata.notify(exception)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
projectlocker_errata-0.1.1 script/integration_test.rb
projectlocker_errata-0.1.0 script/integration_test.rb
projectlocker_errata-0.0.2 script/integration_test.rb
projectlocker_errata-0.0.1 script/integration_test.rb