David Carr avatar David Carr committed c88a86a Merge

Merge pull request #6 from alvarosanchez/master

There's now a new configuration option to allow bundling resources in page resource modules.

Comments (0)

Files changed (5)

+*.iws
+*Db.properties
+*Db.script
+.settings
+stacktrace.log
+/*.zip
+/plugin.xml
+/*.log
+/*DB.*
+/cobertura.ser
+.DS_Store
+/target/
+/out/
+/web-app/plugins
+/web-app/WEB-INF/classes
+*.iml
+.idea/

PageResourcesGrailsPlugin.groovy

 import org.springframework.core.io.FileSystemResource
 
 class PageResourcesGrailsPlugin {
-    def version = "0.1.2"
+    def version = "0.2.0"
     def grailsVersion = "1.3 > *"
     def dependsOn = [resources: "1.2-RC1"]
     def pluginExcludes = [
 
     def scm = [ url: "https://github.com/davidmc24/grails-page-resources/" ]
 
+    def developers = [
+        [name: "Álvaro Sánchez-Mariscal", email: "alvaro.sanchez@salenda.es"]
+    ]
+
     def watchedResources = [
         "file:./web-app/pages/**/*.*" // Watch for page resource changes
     ]

grails-app/conf/ZZZPageResources.groovy

 
 def log = LoggerFactory.getLogger('org.grails.plugin.resource.page.PageResources')
 def application = ApplicationHolder.application
+def config = application.config
 ResourceProcessor grailsResourceProcessor = application.mainContext.getBean('grailsResourceProcessor')
 
 modules = {
                         if (dependModule) {
                             dependsOn(dependModuleName)
                         }
-                        defaultBundle(false)
+                        if (!config.grails.plugins.pageResources.bundlePageResources) {
+                            defaultBundle(false)
+                        }
+
                         files.each { file ->
                             def url = file.path.substring(prefixLen).replaceAll('\\\\', '/')
                             resource(url: url)

src/docs/guide/releaseNotes.gdoc

 Below is the history of Page Resource plugin releases.
 
+h4. 0.2.0 (Release XXX)
+* Added a configuration option to bundle all page resources together.
+
 h4. 0.1.2 (Release 7-31-2012)
 * Fixed IllegalArgumentException on unsupported files in pages directory ( "Issue #2":https://github.com/davidmc24/grails-page-resources/issues/2 )
 * Fixed loading of new page resource files ( "Issue #4":https://github.com/davidmc24/grails-page-resources/issues/4 )

src/docs/guide/usage.gdoc

 
 Another option is to [override resources|http://grails-plugins.github.com/grails-resources/guide/5.%20Overriding%20resources.html]
 in the automatically defined page module.
+
+h4. Bundling all page resources
+
+By default, page resources will be served to the browser each on one file. If you want to bundle all of them together,
+just add the following to your @Config.groovy@:
+
+{code}
+grails.plugins.pageResources.bundlePageResources = true
+{code}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.