Skip to content

Instantly share code, notes, and snippets.

@johnduhart
Created January 25, 2012 02:20
Show Gist options
  • Save johnduhart/1674210 to your computer and use it in GitHub Desktop.
Save johnduhart/1674210 to your computer and use it in GitHub Desktop.
Ruby script to generate a map of core classes for auto completion by IDEs
bootstrap = File.open('fuel/core/bootstrap.php', 'r').read
class_map = <<-php
<?php
/**
* This file is a map of all the fuel core classes, for auto completion on PhpStorm
* @ignore
*/
class Autoloader extends Fuel\\Core\\Autoloader {}
php
bootstrap.scan(/'Fuel\\\\Core\\\\([A-Za-z_]+)'/) do |c|
class_map << "class #{c[0]} extends Fuel\\Core\\#{c[0]} {}\n"
end
File.open('classes.php', 'w') { |f| f.write class_map }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment