Changeset 521 for trunk/grails-app/controllers
- Timestamp:
- May 4, 2010, 12:35:41 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/AppCoreController.groovy
r439 r521 1 1 import org.codehaus.groovy.grails.plugins.springsecurity.Secured 2 2 import org.codehaus.groovy.grails.commons.* 3 import org.apache.commons.lang.WordUtils 3 4 4 5 /** … … 35 36 */ 36 37 def start = { 38 def grailsVersion = grailsApplication.metadata['app.grails.version'] 39 def applicationVersion = grailsApplication.metadata['app.version'] 40 def applicationName = grailsApplication.metadata['app.name'] 41 def applicationVcsRevision = grailsApplication.metadata['app.vcsRevision'] 42 43 // Build the application string. 44 def applicationString = WordUtils.capitalize(applicationName) 45 if(applicationVersion) 46 applicationString += "-" + applicationVersion 47 if(applicationVcsRevision) { 48 if(applicationVcsRevision.size() > 7) { // Svn's $Rev: NUM $ 49 applicationVcsRevision = applicationVcsRevision[6..-3] 50 applicationString += " (r" + applicationVcsRevision + ")" 51 } 52 else 53 applicationString += " (" + applicationVcsRevision + ")" 54 } 55 56 // Build the plugins string. 57 def pluginProperties = grailsApplication.metadata.findAll {it.key.contains('plugin')} 58 pluginProperties.each() { 59 it.key = WordUtils.capitalize( (it.key + GString.EMPTY).split("\\.")[-1] ) 60 } 61 pluginProperties = pluginProperties.sort { p1, p2 -> p1.key.compareToIgnoreCase(p2.key) } 62 def plugins = pluginProperties.collect{ it.key + '-' + it.value }.join(", ") 63 64 return [grailsVersion: grailsVersion, 65 applicationString: applicationString, 66 plugins: plugins] 37 67 } 38 68
Note: See TracChangeset
for help on using the changeset viewer.