hexlet 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hexlet/teacher_cli.rb +4 -4
- data/lib/hexlet/teacher_client.rb +1 -2
- data/lib/hexlet/version.rb +1 -1
- data/locales/en.teachercli.yml +1 -0
- data/test/hexlet/teacher_cli_test.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf0a5cfe6953585d6ee0a85ac95190d43acd4b1e
|
4
|
+
data.tar.gz: ee497e3ec67dbe821496f4eee542e84a394ec74e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 060389e4e4e837a9ac72a12de9f2b090b46b6d1120ee772f6eaa88ac4407ec2a457141a5bfd9aeecb32fb1aef258d716e40d0a214e4770a3168a1004cff72fe2
|
7
|
+
data.tar.gz: 62fcec24c2232098e0179ae47b10f1a0d21a97f194f0bbd398892a9ab848a5157654145ad246f0f637bb9518dbb346a003a36eea94dfaeefa0a8a8a44e5516fd
|
data/lib/hexlet/teacher_cli.rb
CHANGED
@@ -8,6 +8,7 @@ module Hexlet
|
|
8
8
|
FileUtils.cp_r(template_folder, folder)
|
9
9
|
|
10
10
|
puts (t "lesson_folder_created", folder: folder)
|
11
|
+
true
|
11
12
|
end
|
12
13
|
|
13
14
|
desc "submit PATH_TO_LESSON", "submit lesson"
|
@@ -21,12 +22,11 @@ module Hexlet
|
|
21
22
|
return false
|
22
23
|
end
|
23
24
|
|
24
|
-
slug = parts[0, parts.size -
|
25
|
-
locale = parts[-2]
|
25
|
+
slug = parts[0, parts.size - 1].join("_")
|
26
26
|
|
27
|
-
filepath = generate_lesson_tarball(
|
27
|
+
filepath = generate_lesson_tarball(expanded_path)
|
28
28
|
|
29
|
-
result = client.submit slug,
|
29
|
+
result = client.submit slug, filepath
|
30
30
|
|
31
31
|
if result
|
32
32
|
puts (t :created)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Hexlet
|
2
2
|
class TeacherClient < BaseClient
|
3
|
-
def submit(slug,
|
3
|
+
def submit(slug, file)
|
4
4
|
url = @router.api_teacher_lessons_url
|
5
5
|
@logger.debug url
|
6
6
|
|
@@ -9,7 +9,6 @@ module Hexlet
|
|
9
9
|
attrs = {
|
10
10
|
lesson: {
|
11
11
|
slug: slug,
|
12
|
-
locale: locale,
|
13
12
|
"packs_attributes[]" => [
|
14
13
|
{tarball: fd}
|
15
14
|
]
|
data/lib/hexlet/version.rb
CHANGED
data/locales/en.teachercli.yml
CHANGED
@@ -17,7 +17,7 @@ class Hexlet::TeacherCLITest < MiniTest::Test
|
|
17
17
|
to_return(:status => 201)
|
18
18
|
|
19
19
|
FakeFS do
|
20
|
-
folder = "
|
20
|
+
folder = "my_super_lesson"
|
21
21
|
FileUtils.mkdir(folder)
|
22
22
|
result = Hexlet::TeacherCLI.start ["submit", folder, "--verbose"]
|
23
23
|
assert { result }
|