Browse files

Merge branch '2.1.x'

  • Loading branch information...
2 parents fa0cd73 + eb1d800 commit e09096d68512a745f57f0d518e94bbd1ab1b5f36 @jeffbrown jeffbrown committed Aug 9, 2012
View
9 grails-bootstrap/src/main/groovy/grails/build/logging/GrailsConsole.java
@@ -137,7 +137,9 @@ protected GrailsConsole() throws IOException {
}
history = prepareHistory();
- reader.setHistory(history);
+ if (history != null) {
+ reader.setHistory(history);
+ }
}
else if (isActivateTerminal()) {
terminal = createTerminal();
@@ -199,9 +201,8 @@ public boolean isANSISupported() {
* will live in the home directory of the user.
*/
protected History prepareHistory() throws IOException {
- String historyFile = System.getProperty("user.home") + File.separator + HISTORYFILE;
- history = new History(new File(historyFile));
- return history;
+ File file = new File(System.getProperty("user.home"), HISTORYFILE);
+ return file.canWrite() ? new History(file) : null;
}
/**
View
8 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/BinaryGrailsPlugin.java
@@ -257,6 +257,14 @@ private void attemptLoadProperties(Resource descriptorResource, Properties prope
* @return The view class which is a subclass of GroovyPage
*/
public Class resolveView(String viewName) {
+
+ // this is a workaround for GRAILS-9234; in that scenario the viewName will be
+ // "/WEB-INF/grails-app/views/plugins/plugin9234-0.1/junk/_book.gsp" with the
+ // extra "/plugins/plugin9234-0.1". I'm not sure if that's needed elsewhere, so
+ // removing it here for the lookup
+ String extraPath = "/plugins/" + getName() + '-' + getVersion() + '/';
+ viewName = viewName.replace(extraPath, "/");
+
return precompiledViewMap.get(viewName);
}
}
View
9 scripts/GenerateController.groovy
@@ -29,6 +29,11 @@ target ('default': "Generates the CRUD controller for a specified domain class")
depends(checkVersion, parseArguments, packageApp)
promptForName(type: "Domain Class")
generateViews = false
- generateForName = argsMap["params"][0]
- generateForOne()
+ def name = argsMap['params'][0]
+ if(!name || name == '*') {
+ uberGenerate()
+ } else {
+ generateForName = name
+ generateForOne()
+ }
}
View
9 scripts/GenerateViews.groovy
@@ -29,6 +29,11 @@ target ('default': "Generates the CRUD views for a specified domain class") {
depends(checkVersion, parseArguments, packageApp)
promptForName(type: "Domain Class")
generateController = false
- generateForName = argsMap["params"][0]
- generateForOne()
+ def name = argsMap['params'][0]
+ if(!name || name == '*') {
+ uberGenerate()
+ } else {
+ generateForName = name
+ generateForOne()
+ }
}

0 comments on commit e09096d

Please sign in to comment.