lib/learn_open/opener.rb in learn-open-1.0.1 vs lib/learn_open/opener.rb in learn-open-1.0.2
- old
+ new
@@ -22,10 +22,11 @@
if lesson_is_readme?
open_readme
else
fork_repo
clone_repo
+ bundle_install
open_with_editor
cd_to_lesson
end
end
@@ -174,19 +175,17 @@
end
def cd_to_lesson
puts "Opening lesson..."
Dir.chdir("#{lessons_dir}/#{repo_dir}")
- bundle_install
puts "Done."
exec("#{ENV['SHELL']} -l")
end
def bundle_install
- # TODO: Don't bundle for other types of labs either
- if !ios_lesson?
+ if !ios_lesson? && File.exists?("#{lessons_dir}/#{repo_dir}/Gemfile")
puts "Bundling..."
- system("bundle install &>/dev/null")
+ system("cd #{lessons_dir}/#{repo_dir} && bundle install &>/dev/null")
end
end
def lesson_is_readme?
!lesson_is_lab