@Override
  public void buildStarting(IProject project, int kind, IProgressMonitor monitor) {
    super.buildStarting(project, kind, monitor);

    String rubyVersion = RubyLaunchingPlugin.getRubyVersionForProject(project);
    if (rubyVersion != null && rubyVersion.startsWith("ruby 1.9")) // $NON-NLS-1$
    {
      version = CompatVersion.RUBY1_9;
    } else if (rubyVersion != null && rubyVersion.startsWith("ruby 1.8")) // $NON-NLS-1$
    {
      version = CompatVersion.RUBY1_8;
    } else {
      version = CompatVersion.BOTH;
    }
  }
 @Override
 public void buildEnding(IProgressMonitor monitor) {
   version = CompatVersion.BOTH;
   super.buildEnding(monitor);
 }