Sha256: cae84db29c7d6a9eb0554bd99bf2310a99b843b389aac8d61e91930f1ab67957
Contents?: true
Size: 860 Bytes
Versions: 1
Compression:
Stored size: 860 Bytes
Contents
# frozen_string_literal: true module RubyNext module Utils module_function if $LOAD_PATH.respond_to?(:resolve_feature_path) def resolve_feature_path(feature) $LOAD_PATH.resolve_feature_path(feature)&.last end else def resolve_feature_path(path) if File.file?(relative = File.expand_path(path)) path = relative end path = "#{path}.rb" if File.extname(path).empty? unless Pathname.new(path).absolute? loadpath = $LOAD_PATH.find do |lp| File.file?(File.join(lp, path)) end return if loadpath.nil? path = File.join(loadpath, path) end path end end def source_with_lines(source) source.lines.map.with_index do |line, i| "#{i.to_s.rjust(3)}: #{line}" end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ruby-next-0.1.0 | lib/ruby-next/utils.rb |