Flowdock
method

refresh

Importance_0
v2.3.8 - Show latest stable - 0 notes - Class: Rails::GemDependency
  • 1.0.0
  • 1.1.6
  • 1.2.6
  • 2.0.3
  • 2.1.0
  • 2.2.1
  • 2.3.8 (0)
  • 3.0.0
  • 3.0.9
  • 3.1.0
  • 3.2.1
  • 3.2.8
  • 3.2.13
  • 4.0.2
  • 4.1.8
  • 4.2.1
  • 4.2.7
  • 4.2.9
  • 5.0.0.1
  • 5.1.7
  • 5.2.3
  • 6.0.0
  • 6.1.3.1
  • 6.1.7.7
  • 7.0.0
  • 7.1.3.2
  • What's this?
refresh() public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File railties/lib/rails/gem_dependency.rb, line 222
    def refresh
      Rails::VendorGemSourceIndex.silence_spec_warnings = true
      real_gems = Gem.source_index.installed_source_index
      exact_dep = Gem::Dependency.new(name, "= #{specification.version}")
      matches = real_gems.search(exact_dep)
      installed_spec = matches.first
      if frozen?
        if installed_spec
          # we have a real copy
          # get a fresh spec - matches should only have one element
          # note that there is no reliable method to check that the loaded
          # spec is the same as the copy from real_gems - Gem.activate changes
          # some of the fields
          real_spec = Gem::Specification.load(matches.first.loaded_from)
          write_specification(real_spec)
          puts "Reloaded specification for #{name} from installed gems."
        else
          # the gem isn't installed locally - write out our current specs
          write_specification(specification)
          puts "Gem #{name} not loaded locally - writing out current spec."
        end
      else
        if framework_gem?
          puts "Gem directory for #{name} not found - check if it's loading before rails."
        else
          puts "Something bad is going on - gem directory not found for #{name}."
        end
      end
    end
Register or log in to add new notes.