Sha256: 8c134bf7bfdb7d3dfab5421996d9f7f61c920034ed91854978cc831303c5680d

Contents?: true

Size: 294 Bytes

Versions: 53

Compression:

Stored size: 294 Bytes

Contents

module Kernel
  def const_lookup(c)
    names = c.split '::'
    names.shift if names.first.empty?
    names.inject(Object) do |m, n|
      defined = RUBY_VERSION =~ /^1.9/ ? m.const_defined?(n, false) : m.const_defined?(n)
      defined ? m.const_get(n) : m.const_missing(n)
    end
  end
end

Version data entries

53 entries across 53 versions & 3 rubygems

Version Path
rhodes-5.5.18 lib/extensions/mspec/mspec/helpers/const_lookup.rb
rhodes-5.5.17 lib/extensions/mspec/mspec/helpers/const_lookup.rb
rhodes-5.5.15 lib/extensions/mspec/mspec/helpers/const_lookup.rb
rhodes-5.5.0.22 lib/extensions/mspec/mspec/helpers/const_lookup.rb
rhodes-5.5.2 lib/extensions/mspec/mspec/helpers/const_lookup.rb
rhodes-5.5.0.7 lib/extensions/mspec/mspec/helpers/const_lookup.rb
rhodes-5.5.0.3 lib/extensions/mspec/mspec/helpers/const_lookup.rb
rhodes-5.5.0 lib/extensions/mspec/mspec/helpers/const_lookup.rb
tauplatform-1.0.3 lib/extensions/mspec/mspec/helpers/const_lookup.rb
tauplatform-1.0.2 lib/extensions/mspec/mspec/helpers/const_lookup.rb
tauplatform-1.0.1 lib/extensions/mspec/mspec/helpers/const_lookup.rb
rhodes-3.5.1.12 lib/extensions/mspec/mspec/helpers/const_lookup.rb
rhodes-3.3.5 lib/extensions/mspec/mspec/helpers/const_lookup.rb
rhodes-3.4.2 lib/extensions/mspec/mspec/helpers/const_lookup.rb
rhodes-3.3.4 lib/extensions/mspec/mspec/helpers/const_lookup.rb
rhodes-3.3.3 lib/extensions/mspec/mspec/helpers/const_lookup.rb
rhodes-3.3.3.beta.4 lib/extensions/mspec/mspec/helpers/const_lookup.rb
rhodes-3.3.3.beta.3 lib/extensions/mspec/mspec/helpers/const_lookup.rb
rhodes-3.3.3.beta.2 lib/extensions/mspec/mspec/helpers/const_lookup.rb
rhodes-3.3.3.beta.1 lib/extensions/mspec/mspec/helpers/const_lookup.rb