hexlet 0.2.1 → 0.2.2

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: 85f43ba9d8dec4680f643f4c39e4134f88ef046d
4
- data.tar.gz: 510aef2f08c71149985ce5737a39eeda5f2794e8
3
+ metadata.gz: 506092198382b3785e4dbcd42163950e26aa933b
4
+ data.tar.gz: f3ae2b6f152e4af35cef99092a11b9a413490c35
5
5
  SHA512:
6
- metadata.gz: 5897ec999e3d8a603aad89c87a3837dfb7b3cc0fafea088fd7db8b6cd10cd2e280e9083cc6b8494493d3e47f5b569c79383bd0cba9b473f1b8c7ba697ec178b8
7
- data.tar.gz: 9d41310903a7ae6aaf336122defb0cc7d931da6eb05208f97a90d4bc7e3bc72e5b5a1919856346556b1c9b03f08a0b2f8ff7fa34f0a30f5787f1a5a258590320
6
+ metadata.gz: 742d1e8a45ad9672437a6fb55ca26cb4ac1b703e62018e16edf55a2395b568fa0be10dd0b4c7b08e53794294b9c26df765bc73296e6e9582675681a0e8502b8a
7
+ data.tar.gz: 8affdcb249d3f0c716b712bd26ec81acaeaf56f3765669e6e19c86b84af238ab58426ee64b164e90aab4bc180113d484406634d818860b4d5e1759afb9fe01ed
@@ -1,6 +1,7 @@
1
1
  module Hexlet
2
2
  class BaseCLI < Thor
3
3
  include Thor::Actions
4
+ # include Thor::Shell::Basic
4
5
 
5
6
  CONFIG_DIR = File.join(Dir.home, ".hexlet")
6
7
  CREDENTIALS_FILE = File.join(Dir.home, ".hexlet", "credentials")
@@ -39,6 +39,12 @@ module Hexlet
39
39
  if content = client.fetch(lesson_slug, exercise_slug)
40
40
  lesson_path = File.join("/", "vagrant", "exercises", "#{lesson_slug}_lesson")
41
41
  exercise_path = File.join(lesson_path, exercise_slug)
42
+ if Dir.exists?(exercise_path)
43
+ unless yes?(t "ask.replace_exercise")
44
+ return true
45
+ end
46
+ end
47
+
42
48
  FileUtils.mkdir_p(exercise_path)
43
49
 
44
50
  tarball_path = File.join(exercise_path, "exercise.tar.gz")
@@ -1,3 +1,3 @@
1
1
  module Hexlet
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -6,6 +6,8 @@ en:
6
6
  fetch:
7
7
  ok: exercise has been downloaded
8
8
  not_found: lesson or exercise not found
9
+ ask:
10
+ replace_exercise: Exercise already exists. Would you like replace one?
9
11
  login:
10
12
  ok: login has been succesfull
11
13
  not_found: User has not been found
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.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kirill Mokevnin