This repository has been archived by the owner on Oct 26, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added to the readme & added some ruby bits
- Loading branch information
1 parent
ab990be
commit 96b8951
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Common Style | ||
|
||
This is a working repository for our style guides. The styleguide for each language/environment will be stored in its own markdown file. | ||
|
||
[CSS](https://github.com/commonmedia/styleguide/blob/master/css.md) | ||
[HTML](https://github.com/commonmedia/styleguide/blob/master/html.md) | ||
[JavaScript](https://github.com/commonmedia/styleguide/blob/master/javascript.md) | ||
[PHP](https://github.com/commonmedia/styleguide/blob/master/php.md) | ||
[Ruby](https://github.com/commonmedia/styleguide/blob/master/ruby.md) | ||
|
||
# Common Inspiration | ||
* [https://github.com/styleguide/ruby](https://github.com/styleguide/ruby) | ||
* [https://github.com/bbatsov/rails-style-guide](https://github.com/bbatsov/rails-style-guide) | ||
* [https://github.com/lumoslabs/rails-style-guide](https://github.com/lumoslabs/rails-style-guide) | ||
|
||
# Common Contribution | ||
|
||
Nothing written in this guide is set in stone. Feel free to send pull requests with improvements, or request/suggest changes by submitting [Issues](https://github.com/commonmedia/styleguide/issues). Thanks in advance for your help! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Developing Rails applications | ||
|
||
## Coding Style | ||
* Use soft-tabs with a two space indent. | ||
* Never leave trailing whitespace. | ||
* Use spaces around operators, after commas, colons and semicolons, around { and before }. | ||
``` | ||
sum = 1 + 2 | ||
a, b = 1, 2 | ||
1 > 2 ? true : false; puts 'Hi' | ||
[1, 2, 3].each { |e| puts e } | ||
``` | ||
|
||
* No spaces after (, [ or before ], ). | ||
``` | ||
some(arg).other | ||
[1, 2, 3].length | ||
``` | ||
|
||
* Use empty lines between defs and to break up a method into logical paragraphs. | ||
|
||
``` | ||
def some_method | ||
data = initialize(options) | ||
data.manipulate! | ||
data.result | ||
end | ||
def some_method | ||
result | ||
end | ||
``` |