Guest User

Untitled

a guest
May 25th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. class Require
  2. def self.method_missing( subject, &block )
  3. require subject.to_s
  4. block.call if block_given?
  5. self
  6. rescue LoadError => e
  7. warn "Could not require `#{subject}': #{e.to_s}"
  8. end
  9. end
  10.  
  11. # Adding some wirble colorize
  12. #
  13. Require.rubygems.wirble do
  14. Wirble.init
  15. Wirble.colorize unless ENV[ "WIRBLE_NOCOLOR" ]
  16. end
  17.  
  18. # .. and interactive editor
  19. #
  20. Require.interactive_editor do
  21. module InteractiveEditor::Editors
  22. def ed(*args)
  23. InteractiveEditor.edit(ENV['EDITOR'],*args)
  24. end
  25. end
  26. end
Add Comment
Please, Sign In to add comment