Created
December 18, 2008 21:53
-
-
Save methodmissing/37681 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Returns the path to the rails/init.rb file for the given extension, | |
| # or nil if no gem provides it. | |
| def init_path_for_extension(extension) | |
| return if extension.blank? | |
| return unless spec = Gem.searcher.find(extension.to_s) | |
| returning File.join(spec.full_gem_path, 'rails', 'init.rb') do |path| | |
| return unless File.file?(path) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment