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
| ### Совершенный код | |
| * [Идеальный программист](http://www.ozon.ru/context/detail/id/7360633/) (Роберт Мартин) | |
| * [Совершенный код](http://www.ozon.ru/context/detail/id/5508646/) (С. Макконнелл) | |
| * [Программист-прагматик. Путь от подмастерья к мастеру](http://www.ozon.ru/context/detail/id/3353337/) (Э.Хант, Д.Томас) | |
| * [Паттерны проектирования](http://www.ozon.ru/context/detail/id/6108824/) (Э. Фримен, Э. Фимен, К. Сьерра, Б. Бейтс) | |
| * [Приемы объектно-ориентированного проектирования. Паттерны проектирования](http://www.ozon.ru/context/detail/id/2457392/) (Э.Гамма, Р.Хелм, Р.Джонсон, Дж.Влиссидес) | |
| * [Чистый код](http://www.ozon.ru/context/detail/id/6733562/) (Роберт Мартин) | |
| * [Принципы, паттерны и методики гибкой разработки на языке C#](http://www.ozon.ru/context/detail/id/5800704/) (Р.С.Мартин, М.Мартин) | |
| * [Рефакторинг с использованием шаблонов](http://www.ozon.ru/context/detail/id/2909721/) (Джошуа Кериевски) |
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
| #!/usr/bin/env ruby | |
| # encoding utf-8 | |
| require 'bunny' | |
| STDOUT.sync = true | |
| conn = Bunny.new(host: 'rmq', user: 'guest', pass: 'guest') | |
| conn.start |
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
| #!/usr/bin/env ruby | |
| # encoding utf-8 | |
| require 'bunny' | |
| require 'logger' | |
| require 'redis' | |
| logger = Logger.new(STDOUT) | |
| STDOUT.sync = true |
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
| #!/usr/bin/env ruby | |
| # encoding utf-8 | |
| require 'bunny' | |
| require 'json' | |
| STDOUT.sync = true | |
| conn = Bunny.new(host: 'rmq', user: 'guest', pass: 'guest') | |
| conn.start |
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
| source 'https://rubygems.org' | |
| gem 'bunny' | |
| gem 'redis' |
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
| #!/usr/bin/env ruby | |
| require_relative 'boot' | |
| db_config = { | |
| name: 'rom_app_development', | |
| host: 'db', | |
| user: 'root', | |
| password: '', | |
| port: 3306, | |
| encoding: 'utf8mb4' |
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
| let(:factories) do | |
| ROM::Factory.configure do |config| | |
| config.rom = MAIN_CONTAINER | |
| end | |
| end | |
| before do | |
| factories.define(:post) do |f| | |
| f.url { fake(:internet, :url, 'example.com') } | |
| f.se_post false |
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 CreateCompany < ROM::Commands::Create[:sql] | |
| relation :companies | |
| register_as :create | |
| result :one | |
| use :timestamps | |
| timestamp :created_at, :updated_at | |
| 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
| class Companies < ROM::Relation[:sql] | |
| schema(:companies, infer: true) do | |
| associations do | |
| has_many :posts | |
| end | |
| end | |
| 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
| ROM::SQL.migration do | |
| change do | |
| create_table :companies do | |
| primary_key :id | |
| column :name, String, null: false | |
| column :domain, String, null: false | |
| column :state, String, null: false, default: 'running' | |
| column :created_at, DateTime | |
| column :updated_at, DateTime | |
| end |
NewerOlder