VirtualFile root = resourceRoot.getRoot();
try {
if (isRailsApplication( root )) {
RackMetaData rackAppMetaData = unit.getAttachment( RackMetaData.ATTACHMENT_KEY );
RailsMetaData railsAppMetaData = unit.getAttachment( RailsMetaData.ATTACHMENT_KEY );
if (rackAppMetaData == null) {
rackAppMetaData = new RackMetaData();
rackAppMetaData.attachTo( unit );
}
if (railsAppMetaData == null) {
railsAppMetaData = new RailsMetaData();
unit.putAttachment( RailsMetaData.ATTACHMENT_KEY, railsAppMetaData );
}
}
} catch (IOException e) {
throw new DeploymentUnitProcessingException("Error processing rails file: ", e);