Guest User

Untitled

a guest
Jul 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. @@ -1,8 +1,16 @@
  2. begin
  3. require File.join(File.dirname(__FILE__), 'lib', 'haml') # From here
  4. rescue LoadError
  5. - require 'haml' # From gem
  6. + begin
  7. + require 'haml' # From gem
  8. + rescue LoadError => e
  9. + # gems:install may be run to install Haml with the skeleton plugin
  10. + # but not the gem itself installed.
  11. + # Don't die if this is the case.
  12. + raise e unless defined?(Rake) && Rake.application.top_level_tasks.include?('gems:install')
  13. + end
  14. end
  15.  
  16. -# Load Haml and Sass
  17. -Haml.init_rails(binding)
  18. +# Load Haml and Sass.
  19. +# Haml may be undefined if we're running gems:install.
  20. +Haml.init_rails(binding) if defined?(Haml)
Add Comment
Please, Sign In to add comment