hexlet 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d33a80460e2a9cf965e5dd657f54b1df6bee58e
4
- data.tar.gz: c6e11a928c0c0281fb7e8e833ed111ea0a6cb3b0
3
+ metadata.gz: bae440f25a294fd496bbf754f83ee2aa84af58c0
4
+ data.tar.gz: 83cdea6e812a8eb690b166f4c04428b27cfd04e9
5
5
  SHA512:
6
- metadata.gz: 44b3036817aa7dc72bfd7317bc1ccf3698d05c9a8f647e839a93148e2802e67712760dd1242965eaf6edef7a4cb8ffcb0c4e796da386a847db45dcd5f91e7ae0
7
- data.tar.gz: ba0e2f32cf61b18f967277d5f9e5fdd93a153c6458e19f199557fab25fed02ee6b3893e9a3908f9691bbc29d20af4b783fb789c02ecd02bbe79aa45f52e41169
6
+ metadata.gz: 730fa1f5a941521fba5d75d0de52ba6b932a10f8dfa5053a494205d212feea0cffe6fb18e2b247a27d4b0d8e8d40949e019ebc77895a88b36b7b6f7579c9e359
7
+ data.tar.gz: d11399bb3d5f8e9ae4142e361551a7d13f8e2a45f65d7a861cf53b5e110da71cef67eeaf4fcf3a28d09434c9daa7d134e727fe79d097733d077fea88d43bf64c
@@ -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
@@ -12,8 +12,8 @@ module Hexlet
12
12
  @logger.debug url
13
13
 
14
14
  RestClient.get url, headers do |response, request, result, &block|
15
- @logger.debug response
16
- 200 == response.code
15
+ @logger.debug response
16
+ 200 == response.code
17
17
  end
18
18
  end
19
19
 
@@ -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,3 @@
1
+ items:
2
+ name: # FIXME write here
3
+ description: # FIXME write here
@@ -0,0 +1,12 @@
1
+ name: # FIXME write here
2
+ language: # FIXME write here
3
+ description: # FIXME write here
4
+ mission: # FIXME write here
5
+ audience: # FIXME write here
6
+ units:
7
+ - theory
8
+ # FIXME enable what you want
9
+ # - quiz
10
+ # - terminal
11
+ # - codex
12
+ # - code
@@ -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"
@@ -0,0 +1,3 @@
1
+ video:
2
+ provider: # youtube for example
3
+ uid:
@@ -1,3 +1,3 @@
1
1
  module Hexlet
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -1,5 +1,7 @@
1
1
  en:
2
2
  teachercli:
3
+ init:
4
+ lesson_folder_created: create '%{folder}'
3
5
  submit:
4
6
  created: lesson has been uploaded
5
7
  wrong_lesson_folder: Wrong lesson folder
@@ -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.1.1
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