Merge branch 'define_method' of git://github.com/blom/discourse
This commit is contained in:
commit
515d4452b3
|
@ -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 |
|
@ -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 — 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. Don’t post anything that a reasonable person would consider offensive, abusive, or hate speech.</li>
|
||||
<li>Keep it clean. Don’t post anything obscene or sexually explicit.</li>
|
||||
<li>Respect each other. Don’t harass others, impersonate anyone, or expose their private information.</li>
|
||||
<li>Respect each other. Don’t harass or grief anyone,
|
||||
impersonate people, or expose their private information.</li>
|
||||
<li>Respect our forum. Don’t post spam or otherwise vandalize the forum.</li>
|
||||
</ul>
|
||||
</p>
|
||||
<div class="more">
|
||||
<p>
|
||||
These are not concrete terms with precise definitions — 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 — 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.
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue