hexlet 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/hexlet/base_cli.rb +2 -2
- data/lib/hexlet/base_client.rb +2 -2
- data/lib/hexlet/teacher_cli.rb +10 -0
- data/lib/hexlet/templates/lesson/.gitignore +1 -0
- data/lib/hexlet/templates/lesson/backend/main.yml +3 -0
- data/lib/hexlet/templates/lesson/lesson.yml +12 -0
- data/lib/hexlet/templates/lesson/quiz/main.yml +25 -0
- data/lib/hexlet/templates/lesson/theory/main.md +0 -0
- data/lib/hexlet/templates/lesson/theory/main.yml +3 -0
- data/lib/hexlet/templates/lesson/theory/transcription.md +0 -0
- data/lib/hexlet/version.rb +1 -1
- data/locales/en.teachercli.yml +2 -0
- data/test/hexlet/teacher_cli_test.rb +7 -0
- metadata +8 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bae440f25a294fd496bbf754f83ee2aa84af58c0
|
4
|
+
data.tar.gz: 83cdea6e812a8eb690b166f4c04428b27cfd04e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 730fa1f5a941521fba5d75d0de52ba6b932a10f8dfa5053a494205d212feea0cffe6fb18e2b247a27d4b0d8e8d40949e019ebc77895a88b36b7b6f7579c9e359
|
7
|
+
data.tar.gz: d11399bb3d5f8e9ae4142e361551a7d13f8e2a45f65d7a861cf53b5e110da71cef67eeaf4fcf3a28d09434c9daa7d134e727fe79d097733d077fea88d43bf64c
|
data/lib/hexlet/base_cli.rb
CHANGED
@@ -26,10 +26,10 @@ module Hexlet
|
|
26
26
|
logger
|
27
27
|
end
|
28
28
|
|
29
|
-
def t key
|
29
|
+
def t key, options = {}
|
30
30
|
command_name = @_invocations.values.last.last
|
31
31
|
ns = self.class.to_s.downcase.split("::").last
|
32
|
-
I18n.t key, scope: [ns, command_name]
|
32
|
+
I18n.t key, options.merge(scope: [ns, command_name])
|
33
33
|
end
|
34
34
|
|
35
35
|
def config
|
data/lib/hexlet/base_client.rb
CHANGED
data/lib/hexlet/teacher_cli.rb
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
module Hexlet
|
2
2
|
class TeacherCLI < BaseCLI
|
3
|
+
desc "init LESSON_NAME", "init lesson skeleton"
|
4
|
+
def init(lesson_name)
|
5
|
+
folder = "#{lesson_name}_lesson"
|
6
|
+
FileUtils.mkdir(folder)
|
7
|
+
template_folder = File.join(File.dirname(__FILE__), "templates", "lesson", ".")
|
8
|
+
FileUtils.cp_r(template_folder, folder)
|
9
|
+
|
10
|
+
puts (t "lesson_folder_created", folder: folder)
|
11
|
+
end
|
12
|
+
|
3
13
|
desc "submit PATH_TO_LESSON", "submit lesson"
|
4
14
|
def submit(path)
|
5
15
|
lesson_folder = File.split(path)[1]
|
@@ -0,0 +1 @@
|
|
1
|
+
dist
|
@@ -0,0 +1,25 @@
|
|
1
|
+
items:
|
2
|
+
# answer_slug:
|
3
|
+
# question: Правильный ответ всегда идет первым в yml. При выводе порядок может меняться. Фирштейн?
|
4
|
+
# correct_answers:
|
5
|
+
# - яволь
|
6
|
+
# answers:
|
7
|
+
# - нейн
|
8
|
+
# - видерхолунг
|
9
|
+
|
10
|
+
# filling_slug:
|
11
|
+
# question: Скорее всего, тут будет просто указание темы. Конструкция %{lala} превратится в input.
|
12
|
+
# text: "Если прислониться ухом к шаурме то можно услышать %{molchanie} ягнят."
|
13
|
+
# correct_answers:
|
14
|
+
# molchanie: молчание
|
15
|
+
|
16
|
+
# answers_slug:
|
17
|
+
# question: Множественные ответы. Выберите четные
|
18
|
+
# correct_answers:
|
19
|
+
# - "0110"
|
20
|
+
# - "0100"
|
21
|
+
# - "0010"
|
22
|
+
# answers:
|
23
|
+
# - "0101"
|
24
|
+
# - "0001"
|
25
|
+
# - "1001"
|
File without changes
|
File without changes
|
data/lib/hexlet/version.rb
CHANGED
data/locales/en.teachercli.yml
CHANGED
@@ -5,6 +5,13 @@ class Hexlet::TeacherCLITest < MiniTest::Test
|
|
5
5
|
@router = Hexlet::Router.new
|
6
6
|
end
|
7
7
|
|
8
|
+
def test_submit
|
9
|
+
FakeFS do
|
10
|
+
result = Hexlet::TeacherCLI.start ["init", "--verbose"]
|
11
|
+
assert { result }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
8
15
|
def test_submit
|
9
16
|
stub = stub_request(:post, @router.api_teacher_lessons_url).
|
10
17
|
to_return(:status => 201)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hexlet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kirill Mokevnin
|
@@ -120,6 +120,13 @@ files:
|
|
120
120
|
- lib/hexlet/router.rb
|
121
121
|
- lib/hexlet/teacher_cli.rb
|
122
122
|
- lib/hexlet/teacher_client.rb
|
123
|
+
- lib/hexlet/templates/lesson/.gitignore
|
124
|
+
- lib/hexlet/templates/lesson/backend/main.yml
|
125
|
+
- lib/hexlet/templates/lesson/lesson.yml
|
126
|
+
- lib/hexlet/templates/lesson/quiz/main.yml
|
127
|
+
- lib/hexlet/templates/lesson/theory/main.md
|
128
|
+
- lib/hexlet/templates/lesson/theory/main.yml
|
129
|
+
- lib/hexlet/templates/lesson/theory/transcription.md
|
123
130
|
- lib/hexlet/version.rb
|
124
131
|
- locales/en.membercli.yml
|
125
132
|
- locales/en.teachercli.yml
|