Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.

Commit dcf81c2

Browse files
committed
Addingn ruby rules script
1 parent 3e8e850 commit dcf81c2

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/scripts/ruby_rules.coffee

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Description:
2+
# Make sure that hubot shares the ruby rules.
3+
#
4+
# Commands:
5+
# hubot the ruby rules - Make sure hubot still knows the rules.
6+
#
7+
# Notes:
8+
# These rules were provided by Sandy Metz in the Ruby Rouges podcast:
9+
# http://rubyrogues.com/087-rr-book-clubpractical-object-oriented-design-in-ruby-with-sandi-metz/
10+
11+
rubyRules = [
12+
"1. Your class can be no longer than 100 lines of code.",
13+
"2. Your methods can be no longer than 5 lines of code.",
14+
"3. You can pass no more than 4 parameters and you can’t just make it one big hash.",
15+
"4. In your rails controller, you can only instantiate 1 object to do whatever it is that needs to be done.",
16+
"5. Your rails view can only know about 1 instance variable",
17+
"6. You can break this rules if you can explain to your pair or in your pull request why it makes sense."
18+
]
19+
20+
module.exports = (robot) ->
21+
robot.respond /(what are )?the ruby (rules|laws)/i, (msg) ->
22+
text = msg.message.text
23+
msg.send rubyRules.join('\n')

0 commit comments

Comments
 (0)