-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added CHANGELOG * Added LICENSE * Added basic README
- Loading branch information
David Czarnecki
committed
Jan 11, 2012
1 parent
ebf7e99
commit 10177dc
Showing
5 changed files
with
114 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 1.0.0 | ||
|
||
* Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2012 David Czarnecki | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# amico | ||
|
||
Friendships backed by Redis in Ruby. | ||
|
||
## Installation | ||
|
||
`gem install amico` | ||
|
||
or in your `Gemfile` | ||
|
||
```ruby | ||
gem 'amico' | ||
``` | ||
|
||
Make sure your redis server is running! Redis configuration is outside the scope of this README, but | ||
check out the Redis documentation, http://redis.io/documentation. | ||
|
||
## Usage | ||
|
||
Configure amico: | ||
|
||
```ruby | ||
Amico.configure do |configuration| | ||
configuration.redis = Redis.new | ||
configuration.namespace = 'amico' | ||
configuration.following_key = 'following' | ||
configuration.followers_key = 'followers' | ||
end | ||
``` | ||
|
||
```ruby | ||
require 'amico' | ||
=> true | ||
|
||
Amico.configure do |configuration| | ||
configuration.redis = Redis.new | ||
configuration.namespace = 'amico' | ||
configuration.following_key = 'following' | ||
configuration.followers_key = 'followers' | ||
end | ||
|
||
Amico.follow(1, 11) | ||
=> [1, 1] | ||
|
||
Amico.following?(1, 11) | ||
=> true | ||
|
||
Amico.following?(11, 1) | ||
=> false | ||
|
||
Amico.follow(11, 1) | ||
=> [1, 1] | ||
|
||
Amico.following?(11, 1) | ||
=> true | ||
|
||
Amico.following_count(1) | ||
=> 1 | ||
|
||
Amico.followers_count(1) | ||
=> 1 | ||
|
||
Amico.unfollow(11, 1) | ||
=> [1, 1] | ||
|
||
Amico.following_count(11) | ||
=> 0 | ||
|
||
Amico.following_count(1) | ||
=> 1 | ||
|
||
Amico.follower?(1, 11) | ||
=> false | ||
``` | ||
|
||
## Contributing to amico | ||
|
||
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet | ||
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it | ||
* Fork the project | ||
* Start a feature/bugfix branch | ||
* Commit and push until you are happy with your contribution | ||
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally. | ||
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it. | ||
|
||
## Copyright | ||
|
||
Copyright (c) 2012 David Czarnecki. See LICENSE.txt for further details. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
require 'redis' | ||
require 'amico/version' | ||
require 'amico/configuration' | ||
require 'amico/friendships' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters