	public List<IValidationItem> validate(String source, final URI path, final IValidationManager manager)
	{
		List<IValidationItem> items = new ArrayList<IValidationItem>();
		CompatVersion version = CompatVersion.RUBY1_8;
		IPath projectPath = null;
		IPath workingDir = null;
		if (path != null && "file".equals(path.getScheme())) 
		{
			File file = new File(path);
			workingDir = Path.fromOSString(file.getParent());
		}
		if (workingDir != null)
		{
			IContainer container = ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(workingDir);
			if (container != null)
			{
				IProject project = container.getProject();
				if (project != null)
				{
					projectPath = project.getLocation();
				}
			}
		}
		IPath ruby = RubyLaunchingPlugin.rubyExecutablePath(projectPath);
		String rubyVersion = ProcessUtil.outputForCommand(
				ruby == null ? "ruby" : ruby.toOSString(), workingDir, ShellExecutable.getEnvironment(), "-v"); 
		if (rubyVersion != null && rubyVersion.startsWith("ruby 1.9")) 
		{
			version = CompatVersion.RUBY1_9;
		}
		ParserConfiguration config = new ParserConfiguration(1, version);
		RubyParser parser;
		if (version == CompatVersion.RUBY1_9)
		{
			ParserSupport19 support = new ParserSupport19();
			support.setConfiguration(config);
			parser = new Ruby19Parser(support);
		}
		else
		{
			ParserSupport support = new ParserSupport();
			support.setConfiguration(config);
			parser = new Ruby18Parser(support);
		}
		IRubyWarnings warnings = new IRubyWarnings()
		{
			public void warn(ID id, SourcePosition position, String message, Object... data)
			{
				int length = position.getEndOffset() - position.getStartOffset() + 1;
				manager.addWarning(message, position.getStartLine(), 0, length, path);
			}
			public void warn(ID id, String fileName, int lineNumber, String message, Object... data)
			{
				manager.addWarning(message, lineNumber, 0, 1, path);
			}
			public boolean isVerbose()
			{
				return true;
			}
			public void warn(ID id, String message, Object... data)
			{
				manager.addWarning(message, 1, 0, 1, path);
			}
			public void warning(ID id, String message, Object... data)
			{
				warn(id, message, data);
			}
			public void warning(ID id, SourcePosition position, String message, Object... data)
			{
				warn(id, position, message, data);
			}
			public void warning(ID id, String fileName, int lineNumber, String message, Object... data)
			{
				warn(id, fileName, lineNumber, message, data);
			}
		};
		parser.setWarnings(warnings);
		LexerSource lexerSource = LexerSource.getSource(path.getPath(), new StringReader(source), config);
		try
		{
			parser.parse(config, lexerSource);
		}
		catch (SyntaxException e)
		{
			int start = e.getPosition().getStartOffset();
			int end = e.getPosition().getEndOffset();
			int lineNumber = e.getPosition().getStartLine();
			int charLineOffset = 0;
			try
			{
				int lineOffset = new Document(source).getLineOffset(lineNumber - 1);
				charLineOffset = start - lineOffset;
			}
			catch (BadLocationException ble)
			{
			}
			manager.addError(e.getMessage(), lineNumber, charLineOffset, end - start + 1, path);
		}
		return items;
	}

	public List<IValidationItem> validate(String source, final URI path, final IValidationManager manager)
	{
		List<IValidationItem> items = new ArrayList<IValidationItem>();
		CompatVersion version = CompatVersion.RUBY1_8;
		IPath projectPath = null;
		IPath workingDir = null;
		if (path != null && "file".equals(path.getScheme())) 
		{
			File file = new File(path);
			workingDir = Path.fromOSString(file.getParent());
		}
		if (workingDir != null)
		{
			IContainer container = ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(workingDir);
			if (container != null)
			{
				IProject project = container.getProject();
				if (project != null)
				{
					projectPath = project.getLocation();
				}
			}
		}
		IPath ruby = RubyLaunchingPlugin.rubyExecutablePath(projectPath);
		String rubyVersion = ProcessUtil.outputForCommand(
				ruby == null ? "ruby" : ruby.toOSString(), workingDir, ShellExecutable.getEnvironment(), "-v"); 
		if (rubyVersion != null && rubyVersion.startsWith("ruby 1.9")) 
		{
			version = CompatVersion.RUBY1_9;
		}
		ParserConfiguration config = new ParserConfiguration(1, version);
		RubyParser parser;
		if (version == CompatVersion.RUBY1_9)
		{
			ParserSupport19 support = new ParserSupport19();
			support.setConfiguration(config);
			parser = new Ruby19Parser(support);
		}
		else
		{
			ParserSupport support = new ParserSupport();
			support.setConfiguration(config);
			parser = new Ruby18Parser(support);
		}
		IRubyWarnings warnings = new IRubyWarnings()
		{
			public void warn(ID id, SourcePosition position, String message, Object... data)
			{
				int length = position.getEndOffset() - position.getStartOffset() + 1;
				manager.addWarning(message, position.getStartLine(), 0, length, path);
			}
			public void warn(ID id, String fileName, int lineNumber, String message, Object... data)
			{
				manager.addWarning(message, lineNumber, 0, 1, path);
			}
			public boolean isVerbose()
			{
				return true;
			}
			public void warn(ID id, String message, Object... data)
			{
				manager.addWarning(message, 1, 0, 1, path);
			}
			public void warning(ID id, String message, Object... data)
			{
				warn(id, message, data);
			}
			public void warning(ID id, SourcePosition position, String message, Object... data)
			{
				warn(id, position, message, data);
			}
			public void warning(ID id, String fileName, int lineNumber, String message, Object... data)
			{
				warn(id, fileName, lineNumber, message, data);
			}
		};
		parser.setWarnings(warnings);
		LexerSource lexerSource = LexerSource.getSource(path.getPath(), new StringReader(source), config);
		try
		{
			parser.parse(config, lexerSource);
		}
		catch (SyntaxException e)
		{
			int start = e.getPosition().getStartOffset();
			int end = e.getPosition().getEndOffset();
			int lineNumber = e.getPosition().getStartLine();
			int charLineOffset = 0;
			try
			{
				int lineOffset = new Document(source).getLineOffset(lineNumber - 1);
				charLineOffset = start - lineOffset;
			}
			catch (BadLocationException ble)
			{
			}
			items.add(manager.addError(e.getMessage(), lineNumber, charLineOffset, end - start + 1, path));
		}
		return items;
	}
