YaleLDAP
Offers the most common Yale LDAP search queries, returning a convenient ruby hash with names you can understand. Makes it easy to conserve your Yale users' time and energy, saving them from typing again and again that basic information they know mother Yale already has on record.
The LDAP server behaves differently depending on whether you are on Yale's network (on campus/VPN) or not. Some information (like name, upi) are available from anywhere, while other information (like netid, office phone number) are only available on Yale's network.
Installation
Add this line to your application's Gemfile:
gem 'yaleldap'
And then execute:
$ bundle
Or install it yourself as:
$ gem install yaleldap
Usage
UPI
YaleLDAP.lookup(upi: "12714662")
=> {:first_name=>"Casey", :nickname=>"", :last_name=>"Watts", :upi=>"12714662", :netid=>"csw3", :email=>"[email protected]", :college_name=>"", :college_abbreviation=>"", :class_year=>"", :school=>"", :telephone=>"", :address=>"ITS Student Technology Collaborative\nPO BOX 208300\nNew Haven, CT 06520-8300"}
NetID
YaleLDAP.lookup(netid: "csw3")
=> {:first_name=>"Casey", :nickname=>"", :last_name=>"Watts", :upi=>"12714662", :netid=>"csw3", :email=>"[email protected]", :college_name=>"", :college_abbreviation=>"", :class_year=>"", :school=>"", :telephone=>"", :address=>"ITS Student Technology Collaborative\nPO BOX 208300\nNew Haven, CT 06520-8300"}
YaleLDAP.lookup(email: "[email protected]")
=> {:first_name=>"Casey", :nickname=>"", :last_name=>"Watts", :upi=>"12714662", :netid=>"csw3", :email=>"[email protected]", :college_name=>"", :college_abbreviation=>"", :class_year=>"", :school=>"", :telephone=>"", :address=>"ITS Student Technology Collaborative\nPO BOX 208300\nNew Haven, CT 06520-8300"}
Documentation
The source code is documented thoroughly, view it on rdoc.info
For more background on how the net-ldap
gem works with specific Yale examples, check out this Yale net-ldap gist.
Contributing
- Fork it ( http://github.com/YaleSTC/yaleldap/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Development
- You can load the file you're working on by opening irb and running
load "./lib/yaleldap.rb"
(from the directory this repo is in). - You can run our testing suite by running
bundle exec guard
, which uses guard-rspec to run our testing suite. - We use YARD for in-line documentation , to view the documentation locally run
yard
then opendocs/index.html
to view them. - Our testing suite is automatically run on Travis CI.