lib/learn_open/opener.rb in learn-open-1.2.14 vs lib/learn_open/opener.rb in learn-open-1.2.15

- old
+ new

@@ -211,11 +211,11 @@ def fork_repo(retries=3) if !repo_exists? File.write(file_path, 'Forking repository...') puts "Forking lesson..." - if !dot_learn || dot_learn[:github] != false + if !github_disabled? begin Timeout::timeout(15) do client.fork_repo(repo_name: repo_dir) end rescue Timeout::Error @@ -260,11 +260,11 @@ exit end end end - if dot_learn && dot_learn[:github] == false + if github_disabled? ping_fork_completion end end def open_with_editor @@ -402,14 +402,20 @@ def on_mac? !!RUBY_PLATFORM.match(/darwin/) end + def github_disabled? + !dot_learn.nil? && dot_learn[:github] == false + end + def ide_environment? ENV['IDE_CONTAINER'] == "true" end def ide_git_wip_enabled? + return false if github_disabled? + ENV['IDE_GIT_WIP'] == "true" end def ide_version_3? ENV['IDE_VERSION'] == "3"