Class: MotionBlender::Interpreters::RequireInterpreter
- Includes:
- Requirable
- Defined in:
- lib/motion_blender/interpreters/require_interpreter.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods included from Requirable
Methods inherited from Base
#initialize, interprets, key, requirable?
Constructor Details
This class inherits a constructor from MotionBlender::Interpreters::Base
Instance Method Details
#candidates(arg) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/motion_blender/interpreters/require_interpreter.rb', line 18 def candidates arg path = Pathname.new(arg) dirs = path.relative? && load_path || [''] exts = path.extname.empty? ? ['', '.rb'] : [''] Enumerator.new do |y| dirs.product(exts).each do |dir, ext| y << Pathname.new(dir).join("#{path}#{ext}") end end end |
#interpret(arg) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/motion_blender/interpreters/require_interpreter.rb', line 10 def interpret arg req = find_require(arg) if req requires << req req end end |