igrigorik / em-http-request

Asynchronous HTTP Client (EventMachine + Ruby)
1.22k stars 222 forks source link

Simple OAuth gem dependency #303

Closed nbrookie closed 7 years ago

nbrookie commented 8 years ago

When trying to include em-http and em-http/middleware/oauth in my own gem, I am running into the following issue:

require 'em-http'
require 'em-http/middleware/oauth'

Module Foo
  class Bar
  end
end

causes this error to be raised:

/path/to/gem/em-http-request-1.1.5/lib/em-http/middleware/oauth.rb:1:in `require': cannot load such file -- simple_oauth (LoadError)
/path/to/gem/em-http-request-1.1.5/lib/em-http/middleware/oauth.rb:1:in `<top (required)>'

Does simple_oauth need to be added as a dependency to em-http's gemspec?

nbrookie commented 8 years ago

Adding simple_oauth to my gem's dependencies make it work just fine.

Just was not sure if leaving simple_oauth out of em-http's dependencies was intentional.

I could see why it would be..."if you would like to use the OAuth middleware, you need to include the simple_oauth gem..." seems like a reasonable thought process.

igrigorik commented 7 years ago

^ yep, exactly as you said. We didn't want to bundle it by default as it's not a common use case.

Closing, feel free to reopen if there's more to do here.