davetron5000 / gli

Make awesome command-line applications the easy way
http://davetron5000.github.io/gli
Apache License 2.0
1.26k stars 102 forks source link

incompatible with https://github.com/getsentry/raven-ruby #250

Closed jlgeering closed 7 years ago

jlgeering commented 8 years ago
#!/usr/bin/env ruby
require 'gli'
require 'raven'

include GLI::App

desc 'hello'
command :hello do |c|
    c.action do |global_options,options,args|
        puts "hello"
    end
end

exit run(ARGV)

fails with "NoMethodError: private method `desc' called for main:Object"

jlgeering commented 8 years ago

see also https://github.com/getsentry/raven-ruby/issues/531

jlgeering commented 8 years ago

I don't understand enough ruby magic to know if gli or raven is the culprit

davetron5000 commented 7 years ago

Looks like the fix proposed in getsentry/raven-ruby#531 worked.

jlgeering commented 7 years ago

yes indeed, and this was the fix:

require "gli"
require "raven"

class MyApp
  extend GLI::App

  # all the GLI stuff you'd normally put at top-level

end

exit MyApp.run(ARGV)