-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add: ruby Hexlet example code | test
- Loading branch information
Showing
8 changed files
with
121 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,8 @@ | ||
source "https://rubygems.org" | ||
|
||
gem 'open3' | ||
|
||
group :test do | ||
gem 'minitest', | ||
gem 'minitest-reporters', '>= 1.1.7' | ||
end |
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,15 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
minitest (5.15.0) | ||
open3 (0.1.1) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
minitest | ||
open3 | ||
|
||
BUNDLED WITH | ||
1.17.3 |
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,5 @@ | ||
console: | ||
@ruby-console | ||
|
||
test: | ||
ruby test.rb |
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,5 @@ | ||
# frozen_string_literal: true | ||
|
||
# BEGIN (write your solution here) | ||
puts 'Hello, World!' | ||
# END |
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,17 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'minitest' | ||
require 'minitest/power_assert' | ||
require 'minitest/autorun' | ||
#require 'open3' | ||
require_relative './solution' | ||
|
||
class SolutionTest < Minitest::Test | ||
def test_solution | ||
o, _e, = Open3.capture3('ruby solution.rb') | ||
|
||
result = o.chomp | ||
|
||
assert { result == 'Hello, World!' } | ||
end | ||
end |
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,57 @@ | ||
# Ruby | ||
|
||
> 2022-05-12 10:07 | ||
> (отставание по графику 27 мин) | ||
## Теория | ||
|
||
- [Введение в программирование. Ruby](https://learn.dualboot.ru/courses/5/lessons/74/theories) | ||
|
||
глянул* TDD | ||
|
||
## Узнал | ||
- [Введение в Ruby](https://ru.hexlet.io/courses/ruby) | ||
|
||
4 способа запуска кода руби локально | ||
|
||
1. `ruby test.rb` | ||
2. `ruby -e 'puts "Ruby is alive!"'` 🍊 | ||
3. `irb` | ||
4. `pry` | ||
|
||
## | ||
|
||
Правила | ||
|
||
1. Классы не могут содержать больше чем 100 строк кода. | ||
2. Методы не могут быть длиннее чем 5 строк кода. | ||
3. Нельзя передавать больше 4 параметров в метод. Значения хэша также считаются параметрами. | ||
4. Контроллеры могут инстанциировать только один объект. Следовательно, представление может знать только об одной инстанс переменной и должно только слать сообщения этому объекту (`@object.collaborator.value` не допустим). | ||
|
||
|
||
## Числа | ||
|
||
https://ru.hexlet.io/courses/ruby/lessons/ruby_numbers/theory_unit | ||
|
||
- [x] https://ru.hexlet.io/code_reviews/575656#tips | ||
|
||
--- | ||
|
||
### 🐛 Поиск ошибок в коде | ||
|
||
> source: `https://ru.hexlet.io/code_reviews/575656#tips` | ||
Шаги, которые выполняют программисты для поиска ошибок в коде | ||
|
||
- [ ] Найдите сообщение об ошибке в выводе. Попробуйте перевести его и понять. | ||
- [ ] Изучите [стектрейс](https://en.wikipedia.org/wiki/Stack_trace), [🇷🇺 Трассировка стека](https://ru.wikipedia.org/wiki/Трассировка_стека), найдите указание на файл и строку, где произошла ошибка. Откройте файл, проанализируйте код вокруг. | ||
- [ ] Посмотрите, как вызывается ваш код в тестах, какие данные в него передаются. | ||
- [ ] Убедитесь, что вы не пропустили ничего в описании задания. В конце бывают подсказки. | ||
- [ ] Прочитайте обсуждения конкретного урока, возможно, там есть разбор некоторых ошибок. | ||
|
||
--- | ||
|
||
## Задачи | ||
|
||
[x] Выполнил 2 задачи https://ru.hexlet.io/courses/ruby/lessons/ruby_numbers/theory_unit | ||
|
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,4 @@ | ||
#!/usr/bin/env bash | ||
# 2022-05-12 10:35 | ||
|
||
ruby -e 'puts "Ruby is alive!"' |
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,10 @@ | ||
# Sources | ||
|
||
## Books | ||
|
||
## Courses | ||
|
||
- [ ] [Введение в программирование. Ruby](https://learn.dualboot.ru/courses/5/lessons/74/theories) | ||
- [x] [TDD](https://ru.wikipedia.org/wiki/Разработка_через_тестирование) | ||
|
||
- [ ] [Введение в Ruby](https://ru.hexlet.io/courses/ruby) |