Skip to content

Commit

Permalink
Bug fix: #22 and #27
Browse files Browse the repository at this point in the history
  • Loading branch information
greenlaw110 committed Nov 22, 2011
1 parent 86ba1ca commit d71d27f
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion java/core/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<copy todir="tmp/classes">
<fileset dir="src"/>
</copy>
<jar destfile="lib/greenscript-core-1.2.6l.jar" basedir="tmp/classes"/>
<jar destfile="lib/greenscript-core-1.2.6m.jar" basedir="tmp/classes"/>
<delete dir="tmp" />
</target>

Expand Down
Binary file not shown.
Binary file modified java/core/lib/play-greenscript.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion java/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<artifactId>greenscript-core</artifactId>
<packaging>jar</packaging>
<name>GreenScript Core</name>
<version>1.2.6l</version>
<version>1.2.6m</version>
<description>A Java package to manage and process Web Resources (Javascript/CSS)</description>
<url>http://github.com/greenlaw110/greenscript</url>

Expand Down
8 changes: 5 additions & 3 deletions java/core/src/main/java/com/greenscriptool/Minimizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@ public void setUrlContextPath(String ctxPath) {

@Override
public void setCacheDir(File dir) {
if (!dir.isDirectory() && !dir.mkdir())
throw new IllegalArgumentException("not a dir");
// comment below as inmemory configuration does not require dir to be exists
// this is relevant when deploy app on readonly file system like heroku and gae
// if (!dir.isDirectory() && !dir.mkdir())
// throw new IllegalArgumentException("not a dir");
checkInitialize_(false);
cache_ = new FileCache(dir);
}
Expand Down Expand Up @@ -250,7 +252,7 @@ public void setBufferLocator(IBufferLocator bufferLocator) {
bl_ = bufferLocator;
}

private static final Pattern P_IMPORT = Pattern.compile(".*@import\\s*\"(.*?)\".*");
private static final Pattern P_IMPORT = Pattern.compile("^@import\\s*\"(.*?)\".*");

This comment has been minimized.

Copy link
@rajish

rajish Nov 22, 2011

This fix seems to be controversy. You narrow the case only to imports happening at the very beginning of the line. The others are ignored. Wouldn't it be better to define a global 'ignore comments' rule?

This comment has been minimized.

Copy link
@greenlaw110

greenlaw110 Nov 22, 2011

Author Owner

Yes you are right. Will figure it out later on. If you have patch for this it would be very welcome

private Map<String, Set<File>> importsCache_ = new HashMap<String, Set<File>>();
private Set<File> imports_(File file) {
String key = "less_imports_" + file.getPath() + file.lastModified();
Expand Down
4 changes: 0 additions & 4 deletions java/play/app/controllers/greenscript/Configurator.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@
import java.util.List;
import java.util.Properties;

import controllers.Secure;

import play.modules.greenscript.GreenScriptPlugin;
import play.mvc.Controller;
import play.mvc.With;

@With(Secure.class)
public class Configurator extends Controller {

public static void configure() {
Expand Down
2 changes: 1 addition & 1 deletion java/play/conf/dependencies.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
self: play -> greenscript 1.2.6l
self: play -> greenscript 1.2.6m

require:
- play 1.2
Expand Down
5 changes: 5 additions & 0 deletions java/play/documentation/manual/home.textile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ h1. GreenScript module
The GreenScript module help you to manage javascript and CSS dependencies and do minimizing work in the same time.
<script type="text/javascript" src="http://www.ohloh.net/p/485839/widgets/project_users_logo.js"></script>

h2. <a>What's new for v1.2.6m</a>

* Bug fix: <a href="https://github.com/greenlaw110/greenscript/issues/22">#22 Commented out statements get interpreted</a>
* Bug fix: <a href="https://github.com/greenlaw110/greenscript/issues/27">#28 greenscript freezes request execution when parsing ExtJS CSS</a>

h2. <a>What's new for v1.2.6l</a>

* Bug fix: "relative URL convert breaks on linux when service static css file":https://github.com/greenlaw110/greenscript/issues/24
Expand Down
7 changes: 5 additions & 2 deletions java/play/src/play/modules/greenscript/GreenScriptPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@
* fix bug: https://github.com/greenlaw110/greenscript/issues/18
* fix bug: https://github.com/greenlaw110/greenscript/issues/19
* fix bug: https://github.com/greenlaw110/greenscript/issues/21
* fix bug: https://github.com/greenlaw110/greenscript/issues/22
* fix bug: https://github.com/greenlaw110/greenscript/issues/23
* fix bug: https://github.com/greenlaw110/greenscript/issues/24
* fix bug: https://github.com/greenlaw110/greenscript/issues/27
* @version 1.2.5, 2011-08-07
* support in-memory cache
* @version 1.2.1, 2011-01-20
Expand All @@ -66,7 +68,7 @@
*/
public class GreenScriptPlugin extends PlayPlugin {

public static final String VERSION = "1.2.6l";
public static final String VERSION = "1.2.6m";

private static String msg_(String msg, Object... args) {
return String.format("GreenScript-" + VERSION + "> %1$s",
Expand Down Expand Up @@ -138,10 +140,11 @@ private synchronized void updateRoute_() {
if (inMemoryCache) {
String url = cacheUrlPath_();
Router.addRoute(0, "GET",
url + "/{key}",
url + "{key}",
"greenscript.Service.getInMemoryCache",
null,
null);
Logger.debug("route added: %s handled by %s", url + "{key}", "greenscript.Service.getInMemoryCache");
} else {
stopRouteUpdate_ = true;
Router.load(Play.ctxPath);
Expand Down

0 comments on commit d71d27f

Please sign in to comment.