This repository was archived by the owner on Jun 8, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change
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 ' )
You can’t perform that action at this time.
0 commit comments