lib/hexlet/teacher_cli.rb in hexlet-0.3.2 vs lib/hexlet/teacher_cli.rb in hexlet-0.3.3
- old
+ new
@@ -24,10 +24,11 @@
slug = parts[0, parts.size - 1].join("_")
filepath = generate_lesson_tarball(expanded_path)
+ client = build_client
result = client.submit slug, filepath
if result
puts (t :created)
true
@@ -66,11 +67,11 @@
end
exercise_tarball_path
end
- def client
- @client ||= Hexlet::TeacherClient.new config["hexlet_api_key"], logger: logger, host: options["host"]
+ def build_client(key = config["hexlet_api_key"])
+ Hexlet::TeacherClient.new key, logger: logger, host: options["host"]
end
end
end