Navigation Menu

Skip to content
This repository has been archived by the owner on Oct 26, 2018. It is now read-only.

Commit

Permalink
added to the readme & added some ruby bits
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesChevalier committed May 9, 2012
1 parent ab990be commit 96b8951
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README
@@ -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!
32 changes: 32 additions & 0 deletions ruby.md
@@ -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
```

0 comments on commit 96b8951

Please sign in to comment.