Class: Rails::GemPlugin

Inherits:
Plugin show all
Defined in:
lib/rails/plugin.rb

Overview

This Plugin subclass represents a Gem plugin. Although RubyGems has already taken care of $LOAD_PATHs, it exposes its load_paths to add them to Dependencies.load_paths.

Instance Attribute Summary

Attributes inherited from Plugin

#directory, #name

Instance Method Summary collapse

Methods inherited from Plugin

#<=>, #about, #load, #load_paths, #loaded?, #valid?

Constructor Details

#initialize(spec, gem) ⇒ GemPlugin

Initialize this plugin from a Gem::Specification.



106
107
108
109
110
# File 'lib/rails/plugin.rb', line 106

def initialize(spec, gem)
  directory = (gem.frozen? && gem.unpacked_paths.first) || File.join(spec.full_gem_path)
  super(directory)
  @name = spec.name
end

Instance Method Details

#init_pathObject



112
113
114
# File 'lib/rails/plugin.rb', line 112

def init_path
  File.join(directory, 'rails', 'init.rb')
end