Ruby lib for working with the Lighthouse API's XML interface. The first thing you need to set is the account name. This is the same as the web address for your account.
Lighthouse.account = 'activereload'
Then, you should set the authentication. You can either use your login credentials with HTTP Basic Authentication or with an API Tokens. You can find more info on tokens at lighthouseapp.com/help/using-beacons.
# with basic authentication Lighthouse.authenticate('rick@techno-weenie.net', 'spacemonkey') # or, use a token Lighthouse.token = 'abcdefg'
If no token or authentication info is given, you'll only be granted public access.
This library is a small wrapper around the REST interface. You should read the docs at lighthouseapp.com/api.
Sets up basic authentication credentials for all the resources.
# File lib/lighthouse.rb, line 58 def authenticate(email, password) self.email = email self.password = password resources.each do |klass| update_auth(klass) end end
# File lib/lighthouse.rb, line 75 def resources @resources ||= [] end
Sets the API token for all the resources.
# File lib/lighthouse.rb, line 68 def token=(value) @token = value resources.each do |klass| update_token_header(klass) end end
# File lib/lighthouse.rb, line 87 def update_auth(resource) return unless email && password resource.user = email resource.password = password end
Generated with the Darkfish Rdoc Generator 2.