Merge branch 'define_method' of git://github.com/blom/discourse

This commit is contained in:
Robin Ward 2013-02-10 11:35:21 -05:00
commit 515d4452b3
6 changed files with 26 additions and 11 deletions

View File

@ -62,12 +62,27 @@ To use it, follow all the above steps. Once rails is running, open a new termina
```
vagrant ssh
bundle exec rake db:test:prepare
bundle exec guard -p
```
Wait a minute while it runs all our unit tests. Once it has completed, live reloading should start working. Simply save a file locally, wait a couple of seconds and you'll see it change in your browser. No reloading of pages should be necessary for the most part, although if something doesn't update you should refresh to confirm.
### Sending Email
Mailcatcher is used to avoid the whole issue of actually sending emails: https://github.com/sj26/mailcatcher
To start mailcatcher, run the following command in the vagrant image:
```
mailcatcher --http-ip 0.0.0.0
```
Then in a browser, go to http://localhost:4080
Sent emails will be received by mailcatcher and shown in its web ui.
### Shutting down the VM
When you're done working on Discourse, you can shut down Vagrant like so:

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -50,7 +50,7 @@
<article id="participate">
<h2>Your Participation Counts</h2>
<p>
The conversations we have here set the tone for everyone. Help us influence the future of this community by choosing to engage in discussions that make this forum an interesting place to be.
The conversations we have here set the tone for everyone. Help us influence the future of this community by choosing to engage in discussions that make this forum an interesting place to be &mdash; and avoiding those that do not.
</p>
<div class="more">
<p>
@ -65,7 +65,7 @@
<article id="flag-it">
<h2>If You See a Problem, Flag It</h2>
<p>
Moderators have special responsibility and authority; they are technically responsible for this forum. But so are you. With your help, moderators should be facilitators more than janitors or police.
Moderators have special responsibility and authority; they are technically responsible for this forum. But so are you. With your help, moderators should be community facilitators more than janitors or police.
</p>
<div class="more">
<p>
@ -84,13 +84,15 @@
<ul>
<li>Be civil. Dont post anything that a reasonable person would consider offensive, abusive, or hate speech.</li>
<li>Keep it clean. Dont post anything obscene or sexually explicit.</li>
<li>Respect each other. Dont harass others, impersonate anyone, or expose their private information.</li>
<li>Respect each other. Dont harass or grief anyone,
impersonate people, or expose their private information.</li>
<li>Respect our forum. Dont post spam or otherwise vandalize the forum.</li>
</ul>
</p>
<div class="more">
<p>
These are not concrete terms with precise definitions &mdash; avoid even the <em>appearance</em> of any of these things. If you're unsure, ask yourself how you would feel if your post was featured on the front page of the New York Times.
These are not concrete terms with precise definitions &mdash; avoid
even the <i>appearance</i> of any of these things. If you're unsure, ask yourself how you would feel if your post was featured on the front page of the New York Times.
</p>
<p>
This is a public forum, and search engines index these discussions. Keep the language, links, and images safe for family and friends.

View File

@ -591,7 +591,7 @@ en:
private_message_info:
title: "Private Conversation"
description: "Participants in this private conversation"
invite: "invite a participant"
invite: "Invite Others..."
email: 'Email'
username: 'Username'

View File

@ -25,12 +25,10 @@ class DiscourseRedis
pttl rename renamenx rpop rpoplpush rpush rpushx sadd scard sdiff set setbit setex setnx setrange sinter
sismember smembers sort spop srandmember srem strlen sunion ttl type watch zadd zcard zcount zincrby
zrange zrangebyscore zrank zrem zremrangebyrank zremrangebyscore zrevrange zrevrangebyscore zrevrank zrangebyscore).each do |m|
class_eval %{
def #{m}(*args)
args[0] = "\#\{DiscourseRedis.namespace\}:\#\{args[0]\}"
@redis.#{m}(*args)
end
}
define_method m do |*args|
args[0] = "#{DiscourseRedis.namespace}:#{args[0]}"
@redis.send(__method__, *args)
end
end
def self.namespace