Merge branch 'master' of github.com:diaspora/diaspora

This commit is contained in:
danielvincent 2010-10-11 11:38:26 -07:00
commit b3d9884e0d
3 changed files with 20 additions and 7 deletions

View file

@ -11,21 +11,22 @@ Initial installation instructions are [here](http://github.com/diaspora/diaspora
We are continuing to build features and improve the code base.
When we think it is ready for general use, we will post more final
instructions.
instructions. Issue tracking is at [bugs.joindiaspora.com](bugs.joindiaspora.com).
## Commit Guidelines
You are welcome to contribute, add to and extend Diaspora however you see fit. We
will do our best to incorporate everything that meets our guidelines.
Please make your changes on a topic branch in your repo and submit your pull request
from there, so that commits you don't want to submit aren't included.
You can find an introduction to the source code [here](http://github.com/diaspora/diaspora/wiki/An-Introduction-to-the-Diaspora-Source). For an idea of where to start, look at our [issue tracker](bugs.joindiaspora.com).
Make a topic branch. By making your changes in a topic branch, you ensure that new commits to your master are not included in the pull request, and it's easier for us to merge your commits.
Please do not rebase our tree into yours.
See [here](http://www.mail-archive.com/dri-devel@lists.sourceforge.net/msg39091.html)
for when to rebase.
All commits must be tested, and all your tests should be green
Patches must be tested, and all your tests should be green
before a pull request is sent. Please write your tests in Rspec.
GEMS: We would like to keep external dependencies unduplicated. We're using

View file

@ -34,8 +34,21 @@ class Person
/^(https?):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*(\.[a-z]{2,5})?(:[0-9]{1,5})?(\/.*)?$/ix
def self.search(query)
query = Regexp.escape( query.to_s.strip )
Person.all('profile.first_name' => /^#{query}/i) | Person.all('profile.last_name' => /^#{query}/i)
qTokens = query.to_s.strip.split(" ")
fullQueryText = Regexp.escape( query.to_s.strip )
p = []
qTokens.each {
|token|
q = Regexp.escape( token.to_s.strip )
p = Person.all('profile.first_name' => /^#{q}/i) \
| Person.all('profile.last_name' => /^#{q}/i) \
| p
}
return p
end
def real_name

View file

@ -160,7 +160,6 @@ describe Person do
end
it 'should yield results on full names' do
pending "Not yet implemented."
people = Person.search("Casey Grippi")
people.should == [@friend_four]
end