Working @import on RubySassEngine

25 views
Skip to first unread message

kis...@googlemail.com

unread,
May 19, 2015, 4:55:26 AM5/19/15
to wr...@googlegroups.com
Hi everyone,

I'm currently tinkering with the RubySassEngine and its current limitation on the @import statement, which always wants to read from the current JVM working directory. I might have found a solution to inject a custom loading facility for this: 

The SASS engine is able to receive a parameter "filesystem_importer", which is used to load the code for fragments instead of the direct file system access. This parameter can be implemented as a Java Object, which loads code from any location and returns a new SASS engine object containing this code.

Unfortunately I'm not all too deep into wro4j itself and therefor do not know what such an importer should do by default. I could create the importer class and it's injection to the engine if someone else inserts the necessary code loading functionality to it or could outline the way it should be done, so I'm able to do it myself.

So, could I help you with that?

Greetings,
Oliver

Alex Objelean

unread,
May 19, 2015, 4:58:32 AM5/19/15
to wr...@googlegroups.com
Hi Oliver,

any contribution is great. Just fork the project and share your updates. Any improvement, bug fix or new feature will be merged and released in next version.

Thank you,
Alex

--
You received this message because you are subscribed to the Google Groups "wro4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wro4j+un...@googlegroups.com.
To post to this group, send email to wr...@googlegroups.com.
Visit this group at http://groups.google.com/group/wro4j.
For more options, visit https://groups.google.com/d/optout.

kis...@googlemail.com

unread,
Jun 14, 2015, 5:38:40 AM6/14/15
to wr...@googlegroups.com
Ok, on it. However I have trouble to get the following test on the extensions project to work:

shouldNotProvideProxyUriForExternalResources(ro.isdc.wro.extensions.http.handler.TestModelAsJsonRequestHandler): expected:<

It already fails on the 1.7.8 release for me. A problem of my platform?

kis...@googlemail.com

unread,
Jun 14, 2015, 5:44:45 AM6/14/15
to wr...@googlegroups.com
Sorry, forgot to include the diff from the test output file:

expected:<...


   
{
     
"name": "[test",
     
"resources": [
       
{
         
"type": "JS",
         
"minimize": true,
         
"uri": "test.js",
         
"proxyUri": "/wro/?wroAPI=wroResources&id=test.js"
       
}
     
]
   
},
   
{
     
"name": "external",
     
"resources": [
       
{
         
"type": "JS",
         
"minimize": false,
         
"uri": "https://www.site.com/style.js",
         
"proxyUri": "https://www.site.com/style.js"
       
},
       
{
         
"type": "CSS",
         
"minimize": true,
         
"uri": "http://www.site.com/style.css",
         
"proxyUri": "http://www.site.com/style.cs]s"
       
}
     
]


...> but was:<...


   
{
     
"name": "[external",
     
"resources": [
       
{
         
"type": "JS",
         
"minimize": false,
         
"uri": "https://www.site.com/style.js",
         
"proxyUri": "https://www.site.com/style.js"
       
},
       
{
         
"type": "CSS",
         
"minimize": true,
         
"uri": "http://www.site.com/style.css",
         
"proxyUri": "http://www.site.com/style.css"
       
}
     
]
   
},
   
{
     
"name": "test",
     
"resources": [
       
{
         
"type": "JS",
         
"minimize": true,
         
"uri": "test.js",
         
"proxyUri": "/wro/?wroAPI=wroResources&id=test.j]s"
       
}
     
]


...>


Apparently there is a weird extra "]" in the proxyUri of resource "test".

Alex Objelean

unread,
Jun 16, 2015, 11:00:48 AM6/16/15
to wr...@googlegroups.com, kis...@googlemail.com, kis...@googlemail.com
Could you share your updates, so that I could run those tests locally?

Thanks,
Alex

kis...@googlemail.com

unread,
Jun 18, 2015, 3:29:28 AM6/18/15
to wr...@googlegroups.com, kis...@googlemail.com
They are here in branch "feature_sass_importer" on my fork of the project:

I'm sorry, I'm not yet too experienced with Git/Github. I'm wondering why the folders "wro4j-examples", "wro4j-grails-plugin" and "wro4j-runner" were deleted, which never appeared in my working directory in the first place.

However: This test also fails if I checkout the existing tag "v1.7.8". So I think it either is something with my platform or there is actually something wrong with the test.
Reply all
Reply to author
Forward
0 new messages