我想知道哪些提供商已被加載供OmniAuth gem使用。我已經試過這樣:查找加載的提供商OmniAuth
OmniAuth::Strategies.constants # a method provided by the standard lib Module class
# => [:Developer, :OAuth, :Twitter]
這:
OmniAuth.strategies.inspect # a method provided by the OmniAuth class, but which has no documentation or comments around it.
# => [OmniAuth::Strategies::OAuth]
我期望(或希望)答案是[:Developer, :Twitter]
在我的測試代碼,我只加載Twitter的明確,以及開發者提供的是默認加載的。
(這一切都是那麼不同的庫可以加載正確的事情,它的工作,取決於什麼OmniAuth運行。)如果有一種方法
,你知道的話,請讓我知道。否則,我會實事求是,將OAuth從第一個例子中排除在列表之外。
Ruby是1.9.3和OmniAuth是V1.1.1
感謝您抽出寶貴的時間與此,這是非常有益的和讚賞。 – iain