Module: SleepingKingStudios::Tools::CoreTools
- Extended by:
- CoreTools
- Included in:
- CoreTools
- Defined in:
- lib/sleeping_king_studios/tools/core_tools.rb
Overview
Tools for working with an application or working environment.
Instance Method Summary collapse
- #deprecate(*args, format: nil, message: nil) ⇒ Object
-
#require_each(*file_patterns) ⇒ Object
Expands each file pattern and requires each file.
Instance Method Details
#deprecate(name, message: nil) ⇒ Object #deprecate(*args, format: , message: nil) ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/sleeping_king_studios/tools/core_tools.rb', line 25 def deprecate *args, format: nil, message: nil format ||= "[WARNING] %s has been deprecated." str = format % args str << ' ' << if str << "\n called from #{caller[1]}" Kernel.warn str end |
#require_each(*file_patterns) ⇒ Object
Expands each file pattern and requires each file.
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/sleeping_king_studios/tools/core_tools.rb', line 39 def require_each *file_patterns file_patterns.each do |file_pattern| if file_pattern.include?('*') Dir[file_pattern].each do |file_name| Kernel.require file_name end # each else Kernel.require file_pattern end # unless end # each end |