learn-open 1.2.7 → 1.2.8

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: e7608535672f1b7d5c1dbf7061f3022422ceb71c
4
- data.tar.gz: 495d1145174ecd2c91ac6c4df420a983f9e57c94
3
+ metadata.gz: 4092c0647cecf0a074b424fd7b20df53f4480cdc
4
+ data.tar.gz: efd83f047505201ee3aca578c7c2d3e808c489b7
5
5
  SHA512:
6
- metadata.gz: 89f6d852f4680634354b24efce024a82d59aff8535c6cdc6f973235f41cd1ee685cc25e6c51400d12f8a59e29abdb226402c464e56ad9fbd2f836467db6aeee4
7
- data.tar.gz: 9acba5c8b3ecfada0f2a1150efdee3166df9eb487456415bfa16336cd1cf98730b4d292a362e989855fefdd68ffe29bcacc277e884de4d5aeeaaa681c22ed451
6
+ metadata.gz: 3f1a1d3eb0d877e2aad06a79e34e42357079cf22fde984f52165c662129b237630265bd5c6942dbb507e69929777322d8cc7c0050123fd8b8c7b18c6df4c2fdb
7
+ data.tar.gz: de3c4dc87b7a240dc6f7d3f1b15db04859a7bc75b3905d7b461e49928cf15d36c1ac99ecb0c93ee0c4a3bdc89a17e3529bd43109a73961b61a360cc496ed77c3
@@ -24,6 +24,15 @@ module LearnOpen
24
24
 
25
25
  set_lesson
26
26
 
27
+ if ide_version_3?
28
+ if self.repo_dir != ENV['LAB_NAME']
29
+ File.open(".custom_commands.log", "w+") do |f|
30
+ f.puts %Q{{"command": "open_lab", "lab_name": #{self.lesson}}}
31
+ end
32
+ exit
33
+ end
34
+ end
35
+
27
36
  warn_if_necessary
28
37
 
29
38
  if lesson_is_readme?
@@ -31,6 +40,7 @@ module LearnOpen
31
40
  else
32
41
  git_tasks
33
42
  file_tasks
43
+ setup_backup_if_needed
34
44
  dependency_tasks
35
45
  completion_tasks
36
46
  end
@@ -42,6 +52,13 @@ module LearnOpen
42
52
 
43
53
  private
44
54
 
55
+ def setup_backup_if_needed
56
+ if ide_environment? && ide_git_wip_enabled?
57
+ restore_files
58
+ watch_for_changes
59
+ end
60
+ end
61
+
45
62
  def ping_fork_completion(retries=3)
46
63
  begin
47
64
  Timeout::timeout(15) do
@@ -325,7 +342,7 @@ module LearnOpen
325
342
  def bundle_install
326
343
  if !ios_lesson? && File.exists?("#{lessons_dir}/#{repo_dir}/Gemfile")
327
344
  puts "Bundling..."
328
- system("bundle install > /dev/null 2>&1")
345
+ system("bundle install")
329
346
  end
330
347
  end
331
348
 
@@ -346,7 +363,11 @@ module LearnOpen
346
363
  end
347
364
 
348
365
  def open_readme
349
- if can_open_readme?
366
+ if ide_environment?
367
+ File.open(".custom_commands.log", "w+") do |f|
368
+ f.puts %Q{{"command": "browser_open", "url": "https://learn.co/lessons/#{lesson_id}"}}
369
+ end
370
+ elsif can_open_readme?
350
371
  puts "Opening readme..."
351
372
  launch_browser
352
373
  else
@@ -391,6 +412,10 @@ module LearnOpen
391
412
  ENV['IDE_GIT_WIP'] == "true"
392
413
  end
393
414
 
415
+ def ide_version_3?
416
+ ENV['IDE_VERSION'] == "3"
417
+ end
418
+
394
419
  def git_tasks
395
420
  fork_repo
396
421
  clone_repo
@@ -418,10 +443,6 @@ module LearnOpen
418
443
  def completion_tasks
419
444
  cleanup_tmp_file
420
445
  puts "Done."
421
- if ide_environment? && ide_git_wip_enabled?
422
- restore_files
423
- watch_for_changes
424
- end
425
446
  exec("#{ENV['SHELL']} -l")
426
447
  end
427
448
  end
@@ -1,3 +1,3 @@
1
1
  module LearnOpen
2
- VERSION = '1.2.7'
2
+ VERSION = '1.2.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: learn-open
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.7
4
+ version: 1.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flatiron School
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  version: '0'
124
124
  requirements: []
125
125
  rubyforge_project:
126
- rubygems_version: 2.6.11
126
+ rubygems_version: 2.6.10
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: Open Learn lessons locally