hexlet 0.3.2 → 0.3.3

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: 83667856922d7be718c50a433c1030b80ff01e79
4
- data.tar.gz: 07f72445f54353ae7c2008ba58afa021d7f00b62
3
+ metadata.gz: 3274ee106665e58461c5b533f9ae4a56b10d5932
4
+ data.tar.gz: 1dc4d25ce21eda12f198441647c1be0f6c68b023
5
5
  SHA512:
6
- metadata.gz: ed2365506f02afce46085b90d5e2fba665c0a39ecfec0cf5eaa2d46dd8052b30042debd22d2861b7d9d6909ea3b3ce007ac0884c49ebf791424c0268b4f1d648
7
- data.tar.gz: 3946bb29c3b6841ec063b7edc3518645cd74d7e8c85594464ebee4c3e8eeb53c64e8d26e5ea8561d24c855083bf764822a7669f9994557f10d8cba091d4f708e
6
+ metadata.gz: 425b0568413f0f1fabb08c265fcc06d923ce0451925283287128dce65ba1270bfc5342032ab3590d5001294decc90bba6502290c1a2e91a7f94f54e69d0ddbc4
7
+ data.tar.gz: bc6d4c1dd24a556e692880e8c89c67095ee3a493c3abfa1c610667674dc0240627df4147bfabff63791f735eca69d760438f0dc461434ca2cfc4042640de9431
@@ -11,7 +11,7 @@ module Hexlet
11
11
 
12
12
  desc "login HEXLET_API_KEY", "login on hexlet.io"
13
13
  def login(key)
14
- client = BaseClient.new key, logger: logger
14
+ client = build_client(key)
15
15
  if client.login
16
16
  puts (t :ok)
17
17
  write_config("hexlet_api_key" => key)
@@ -18,6 +18,7 @@ module Hexlet
18
18
  # process.start
19
19
  _, e, s = Open3.capture3("make test -C #{path}")
20
20
  if s == 0
21
+ client = build_client
21
22
  result = client.submit lesson_slug, exercise_folder_name
22
23
  if result
23
24
  puts (t :created)
@@ -36,6 +37,7 @@ module Hexlet
36
37
  desc "fetch LESSON_SLUG EXERCISE_SLUG", "download lesson exercise"
37
38
  def fetch(lesson_slug, exercise_slug)
38
39
  # FIXME check login
40
+ client = build_client
39
41
  if content = client.fetch(lesson_slug, exercise_slug)
40
42
  lesson_path = File.join("/", "vagrant", "exercises", "#{lesson_slug}_lesson")
41
43
  exercise_path = File.join(lesson_path, exercise_slug)
@@ -67,8 +69,8 @@ module Hexlet
67
69
 
68
70
  private
69
71
 
70
- def client
71
- @client ||= Hexlet::MemberClient.new config["hexlet_api_key"], logger: logger, host: options["host"]
72
+ def build_client(key = config["hexlet_api_key"])
73
+ Hexlet::MemberClient.new options[:key], logger: logger, host: options["host"]
72
74
  end
73
75
  end
74
76
  end
@@ -26,6 +26,7 @@ module Hexlet
26
26
 
27
27
  filepath = generate_lesson_tarball(expanded_path)
28
28
 
29
+ client = build_client
29
30
  result = client.submit slug, filepath
30
31
 
31
32
  if result
@@ -68,8 +69,8 @@ module Hexlet
68
69
  exercise_tarball_path
69
70
  end
70
71
 
71
- def client
72
- @client ||= Hexlet::TeacherClient.new config["hexlet_api_key"], logger: logger, host: options["host"]
72
+ def build_client(key = config["hexlet_api_key"])
73
+ Hexlet::TeacherClient.new key, logger: logger, host: options["host"]
73
74
  end
74
75
  end
75
76
  end
@@ -1,3 +1,3 @@
1
1
  module Hexlet
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
@@ -1,13 +1,13 @@
1
1
  en:
2
2
  membercli:
3
3
  submit:
4
- created: exercise result has been sent
5
- wrong_lesson_folder: wrong folder, please submit the exercise folder
4
+ created: Exercise submitted
5
+ wrong_lesson_folder: Wrong folder, please submit the exercise folder
6
6
  fetch:
7
- ok: exercise has been downloaded
8
- not_found: lesson or exercise not found
7
+ ok: Exercise downloaded
8
+ not_found: Lesson or exercise not found
9
9
  ask:
10
- replace_exercise: Exercise already exists. Would you like replace one?
10
+ replace_exercise: Exercise already exists. Would you like overwrite it?
11
11
  login:
12
- ok: login has been succesfull
13
- not_found: User has not been found
12
+ ok: Logged in
13
+ not_found: User not found
@@ -4,5 +4,5 @@ en:
4
4
  lesson_folder_created: create '%{folder}'
5
5
  submit:
6
6
  error: "Can't submit lesson"
7
- created: lesson has been uploaded
7
+ created: Lesson submitted
8
8
  wrong_lesson_folder: Wrong lesson folder
data/locales/en.yml CHANGED
@@ -1,2 +1,2 @@
1
1
  en:
2
- update_config: Config has been updated
2
+ update_config: Configuration updated
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hexlet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kirill Mokevnin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-27 00:00:00.000000000 Z
11
+ date: 2014-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler