learn-open 1.2.6 → 1.2.7

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: f71edf24bcdfc6d39ee8206c8ce1a2a5f666794f
4
- data.tar.gz: 6c5defd9ef8d38ecd71c96f58c456baaa6e0a44d
3
+ metadata.gz: e7608535672f1b7d5c1dbf7061f3022422ceb71c
4
+ data.tar.gz: 495d1145174ecd2c91ac6c4df420a983f9e57c94
5
5
  SHA512:
6
- metadata.gz: ee19d9ab4a82fdb889cffc99445d235aa0148daf84d02a3a7d3db3a13caec99104a5b6bce623486913e9d7819951f9caca128563481dd7e1df9855154248143f
7
- data.tar.gz: 2ee07524eb58e33c98424a409aa132734be207debbf483f034fd3bf58e6c2e65dfd5a043556cb2fd47b7df3839c01cd5d4d176e80db553331aa6d354c89a37ee
6
+ metadata.gz: 89f6d852f4680634354b24efce024a82d59aff8535c6cdc6f973235f41cd1ee685cc25e6c51400d12f8a59e29abdb226402c464e56ad9fbd2f836467db6aeee4
7
+ data.tar.gz: 9acba5c8b3ecfada0f2a1150efdee3166df9eb487456415bfa16336cd1cf98730b4d292a362e989855fefdd68ffe29bcacc277e884de4d5aeeaaa681c22ed451
@@ -387,6 +387,10 @@ module LearnOpen
387
387
  ENV['IDE_CONTAINER'] == "true"
388
388
  end
389
389
 
390
+ def ide_git_wip_enabled?
391
+ ENV['IDE_GIT_WIP'] == "true"
392
+ end
393
+
390
394
  def git_tasks
391
395
  fork_repo
392
396
  clone_repo
@@ -402,9 +406,22 @@ module LearnOpen
402
406
  npm_install
403
407
  end
404
408
 
409
+ def restore_files
410
+ pid = Process.spawn("restore-lab", [:out, :err] => File::NULL)
411
+ Process.waitpid(pid)
412
+ end
413
+
414
+ def watch_for_changes
415
+ Process.spawn("while inotifywait -e close_write,create,moved_to -r #{lessons_dir}/#{repo_dir}; do backup-lab; done", [:out, :err] => File::NULL)
416
+ end
417
+
405
418
  def completion_tasks
406
419
  cleanup_tmp_file
407
420
  puts "Done."
421
+ if ide_environment? && ide_git_wip_enabled?
422
+ restore_files
423
+ watch_for_changes
424
+ end
408
425
  exec("#{ENV['SHELL']} -l")
409
426
  end
410
427
  end
@@ -1,3 +1,3 @@
1
1
  module LearnOpen
2
- VERSION = '1.2.6'
2
+ VERSION = '1.2.7'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: learn-open
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6
4
+ version: 1.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flatiron School
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-26 00:00:00.000000000 Z
11
+ date: 2017-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -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.10
126
+ rubygems_version: 2.6.11
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: Open Learn lessons locally