lib/hexlet/teacher_cli.rb in hexlet-0.2.2 vs lib/hexlet/teacher_cli.rb in hexlet-0.3.0
- old
+ new
@@ -6,10 +6,11 @@
FileUtils.mkdir(folder)
template_folder = File.join(File.dirname(__FILE__), "templates", "lesson", ".")
FileUtils.cp_r(template_folder, folder)
puts (t "lesson_folder_created", folder: folder)
+ true
end
desc "submit PATH_TO_LESSON", "submit lesson"
def submit(path)
expanded_path = File.expand_path(path)
@@ -19,15 +20,14 @@
if parts.last != "lesson"
puts (t "wrong_lesson_folder")
return false
end
- slug = parts[0, parts.size - 2].join("_")
- locale = parts[-2]
+ slug = parts[0, parts.size - 1].join("_")
- filepath = generate_lesson_tarball(path)
+ filepath = generate_lesson_tarball(expanded_path)
- result = client.submit slug, locale, filepath
+ result = client.submit slug, filepath
if result
puts (t :created)
true
else