Sha256: 97a3277bdaed92e5e2dc812c6abdbfa6a44abae42f352cdbd80f32185b5a88d1

Contents?: true

Size: 480 Bytes

Versions: 36

Compression:

Stored size: 480 Bytes

Contents

module Oj
  
  def self.mimic_loaded(mimic_paths=[])
    $LOAD_PATH.each do |d|
      next unless File.exist?(d)
      offset = d.size() + 1
      Dir.glob(File.join(d, '**', '*.rb')).each do |file|
        next unless file[offset..-1].start_with?('json')
        $LOADED_FEATURES << file unless $LOADED_FEATURES.include?(file)
      end
    end
    mimic_paths.each { |p| $LOADED_FEATURES << p }
    $LOADED_FEATURES << 'json' unless $LOADED_FEATURES.include?('json')
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
oj-2.9.4 lib/oj/mimic.rb
oj-2.9.3 lib/oj/mimic.rb
oj-2.9.2 lib/oj/mimic.rb
oj-2.9.1 lib/oj/mimic.rb
oj-2.9.0 lib/oj/mimic.rb
oj-2.8.1 lib/oj/mimic.rb
oj-2.8.0 lib/oj/mimic.rb
oj-2.7.3 lib/oj/mimic.rb
oj-2.7.2 lib/oj/mimic.rb
oj-2.7.1 lib/oj/mimic.rb
oj-2.7.0 lib/oj/mimic.rb
oj-2.6.1 lib/oj/mimic.rb
oj-2.6.0 lib/oj/mimic.rb
oj-2.5.5 lib/oj/mimic.rb
oj-2.5.4 lib/oj/mimic.rb
oj-2.5.3 lib/oj/mimic.rb
oj-2.5.2 lib/oj/mimic.rb
oj-2.5.1 lib/oj/mimic.rb
oj-2.4.3 lib/oj/mimic.rb
oj-2.4.2 lib/oj/mimic.rb