Sha256: 3413b2b19407451d1579d54250ee74665e6b698d323d9e496fb1db6383105e39

Contents?: true

Size: 1.05 KB

Versions: 7

Compression:

Stored size: 1.05 KB

Contents

#!/usr/bin/env ruby

require "raven"
require "optparse"

options = {}

parser = OptionParser.new do |opt|
  opt.banner = "Usage: raven COMMAND [OPTIONS]"
  opt.separator  ""
  opt.separator  "Commands"
  opt.separator  "     test: send a test event"
  opt.separator  ""
  opt.separator  "Options"

  # opt.on("-e","--environment ENVIRONMENT","which environment you want server run") do |environment|
  #   options[:environment] = environment
  # end

  # opt.on("-d","--daemon","runing on daemon mode?") do
  #   options[:daemon] = true
  # end

  opt.on("-h","--help","help") do
    puts parser
  end
end

parser.parse!

case ARGV[0]
  when "test"
    dsn = ARGV[1] if ARGV.length > 1
    if !dsn
      puts "Usage: raven test <dsn>"
    else
      Raven.configure do |config|
        config.dsn = dsn
        config.current_environment = 'production'
      end

      puts "Sending test event"

      begin
        1 / 0
      rescue ZeroDivisionError => exception
        Raven.capture_exception(exception)
      end

      puts "Done!"

    end
  else
    puts parser
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sentry-raven-0.4.6 bin/raven
sentry-raven-0.4.5 bin/raven
sentry-raven-0.4.4 bin/raven
sentry-raven-0.4.3 bin/raven
sentry-raven-0.4.2 bin/raven
sentry-raven-0.4.1 bin/raven
sentry-raven-0.4.0 bin/raven