Module: ExceptionHub::Client::Authorization
- Included in:
- ExceptionHub::Client
- Defined in:
- lib/exception_hub/client/authorization.rb
Constant Summary collapse
- INITIALIZER_TEMPLATE =
File.read(__FILE__).split("__END__\n").last
Instance Method Summary collapse
- #generate_initializer(user, api_token, auth_id, repo_name, repo_owner) ⇒ Object
- #get_api_token(user, password, note = 'ExceptionHub', url = 'http://github.com/jessedearing/exception_hub') ⇒ Object
Instance Method Details
#generate_initializer(user, api_token, auth_id, repo_name, repo_owner) ⇒ Object
13 14 15 16 |
# File 'lib/exception_hub/client/authorization.rb', line 13 def generate_initializer(user, api_token, auth_id, repo_name, repo_owner) t = ERB.new(INITIALIZER_TEMPLATE) t.result binding end |
#get_api_token(user, password, note = 'ExceptionHub', url = 'http://github.com/jessedearing/exception_hub') ⇒ Object
8 9 10 11 |
# File 'lib/exception_hub/client/authorization.rb', line 8 def get_api_token(user, password, note = 'ExceptionHub', url = 'http://github.com/jessedearing/exception_hub') o = Octokit::Client.new(:login => user, :password => password) o.(:scopes => [:repo], :note => note, :note_url => url) end |