Skip to content

Instantly share code, notes, and snippets.

@timurvafin
timurvafin / Стандарт кодирования Ruby.rdoc
Created October 11, 2010 11:13
Стандарт кодирования Ruby в Flatsoft/Flatsourcing

Структура программы

  • require выражения

  • include выражения

  • определение классов и модулей

  • основная часть программы

  • код для тестирования

Исключения

Story

As a registered user
I want to checkout my rank on my profile page and on the leaderboards page

We have user model with name:string, score:integer fields So we need to render user’s rank on the users list and on the user’s profile page based on the score

Wrong way is create rank field in the users table and update it using this awful way

def self.update_ranks
  self.connection.execute( 'SET @rank := 0' )
<div class="buttons">
<a class="button add" href="#"><span>Add new offer</span></a>
</div>
$ apt-get install git-core
$ git config --global user.name "Your Name"
$ git config --global user.email "[email protected]"
# Git installing
$ apt-get install git-core
# Setup
$ git config --global user.name "Your Name"
$ git config --global user.email "[email protected]"
# Освоить git на базовом уровне.
# Инициализируете пустой репозиторий
git init
Feature: Sign up
In order to use service
As a user
I want to create account
Scenario: New user creates account with valid data
When I go to the sign up page
And I submit valid user and credit card registration information
Then account should be created
And I should be signed in
class User < ActiveRecord::Base
include User::Feature
end
/var/www/apps/*/*/current/log/*log {
daily
missingok
rotate 7
nocompress
sharedscripts
postrotate
(/sbin/service httpd configtest >/dev/null 2>/dev/null) && (/sbin/service httpd graceful >/dev/null 2>/dev/null) || true
endscript
}
<div class='comment-head'>
<b><%= comment.name %></b>
| <%= format_date_time(comment.created_at) %>
</div>
<%= comment.body %>