Permalink
Browse files

moved Guestlist::Github to lib/guestlist/github.rb

  • Loading branch information...
jeffkreeftmeijer committed Apr 17, 2010
1 parent 5da8132 commit c38994c279632f71995fc660a606ff3c2fa2fa0a
Showing with 27 additions and 24 deletions.
  1. +1 −24 lib/guestlist.rb
  2. +26 −0 lib/guestlist/github.rb
View
@@ -1,5 +1,4 @@
-require 'rubygems'
-require 'httparty'
+require 'guestlist/github'
module Guestlist
module ClassMethods
@@ -26,26 +25,4 @@ def encrypt(string)
def self.included(base)
base.extend(ClassMethods)
end
-
- class Github
- class StatusError < StandardError; end
-
- def self.fetch(login, token)
- response = HTTParty.post(
- "http://github.com/api/v2/json/user/show/#{login}",
- {
- :query => {
- :login => login,
- :token => token
- }
- }
- )
-
- case response.code
- when 200; response
- when 401; false
- else; raise StatusError, response.code
- end
- end
- end
end
View
@@ -0,0 +1,26 @@
+require 'rubygems'
+require 'httparty'
+
+module Guestlist
+ class Github
+ class StatusError < StandardError; end
+
+ def self.fetch(login, token)
+ response = HTTParty.post(
+ "http://github.com/api/v2/json/user/show/#{login}",
+ {
+ :query => {
+ :login => login,
+ :token => token
+ }
+ }
+ )
+
+ case response.code
+ when 200; response
+ when 401; false
+ else; raise StatusError, response.code
+ end
+ end
+ end
+end

0 comments on commit c38994c

Please sign in to comment.