-
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' )
This file contains hidden or 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
$ apt-get install git-core |
This file contains hidden or 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
$ git config --global user.name "Your Name" | |
$ git config --global user.email "[email protected]" |
This file contains hidden or 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
# 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 |
This file contains hidden or 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
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 |
This file contains hidden or 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
class User < ActiveRecord::Base | |
include User::Feature | |
end |
This file contains hidden or 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
/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 | |
} |
This file contains hidden or 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
<div class='comment-head'> | |
<b><%= comment.name %></b> | |
| <%= format_date_time(comment.created_at) %> | |
</div> | |
<%= comment.body %> |