Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 43 lines (28 sloc) 1.209 kB
55cd50d @technoweenie add a readme
authored
1 # Unique Content Set
2
3 Check for uniquely created content in a Redis set.
4
5 ## INSTALL
6
7 gem install unique_content_set
8
9 ## USAGE
10
11 # uses a Redis Set named something like "unique:5:messages"
02adac9 @technoweenie doh
authored
12 set = UniqueContentSet.new user.id, :messages
55cd50d @technoweenie add a readme
authored
13
14 if set.add(@message.body, @message.created_at)
6a506e0 @technoweenie Edited README.md via GitHub
authored
15 # this message body is unique!
55cd50d @technoweenie add a readme
authored
16 end
17
18 if set.exist?(@message.body)
19 # this message body has been posted before, do something!
20 end
21
22 # Purge old message content.
23 set.delete_before(1.month.ago)
24
25 ## Contribute
26
27 If you'd like to hack on UniqueContentSet, start by forking the repo on GitHub:
28
29 `https://github.com/technoweenie/unique_content_set`
30
31 The best way to get your changes merged back into core is as follows:
32
33 * Clone down your fork
34 * Create a thoughtfully named topic branch to contain your change
35 * Hack away
36 * Add tests and make sure everything still passes by running rake
37 * If you are adding new functionality, document it in the README
38 * Do not change the version number, I will do that on my end
39 * If necessary, rebase your commits into logical chunks, without errors
40 * Push the branch up to GitHub
41 * Send a pull request to the `technoweenie/unique_content_set` project.
42
Something went wrong with that request. Please try again.