ckirkendall / enfocus

DOM manipulation and templating library for ClojureScript inspired by Enlive.
http://ckirkendall.github.com/enfocus-site/
370 stars 41 forks source link

Few updates #78

Closed magomimmo closed 11 years ago

magomimmo commented 11 years ago

Thin markdown corrections. Added few links.

magomimmo commented 11 years ago

Remember to publish the 2.1.0-SNAPSHOT. Thanks.

magomimmo commented 11 years ago

@ckirkendall I applied again the separation of concerns principle to the project.clj. I moved all the :dev things from the project.clj file to the newly created profiles.clj. Now the project.clj is much more readable for third party users of the enfocus lib as is. The enfocus devs still have the repo with all the things they need to know to work on it, because they are kept separated in the profiles.clj file.

magomimmo commented 11 years ago

@ckirkendall I also moved server.clj from the test/clj/enfocus dir to the dev-resources/enfocus. This is the right way to use resources for development mode only. It was an error of mine.....

ckirkendall commented 11 years ago

I am not a fan of mixing code with resources. It might be better to move to something like this structure.

/test/cljs/enfocus -> standard tests /test/cljs/enfocus/browser_reporting/ -> reporting tests /test/support_tools/... -> all reporting and ring related code

CK

magomimmo commented 11 years ago

yes. I agree. but the problem is that the classpath only has:

target/test/clj test src/clj dev-resources resources target/classes:

(aside all the used lib). So if we want to keep it with the code, we should put in the following directory strucure:

test/enfocus/server.clj (if we want ti prefix the server namespace with enfocus (in clojure it is highly recommended to use at least a two component namespace). To me this is ok. Or we can just use something like:

test/tools/server.clj (removing the enfocus prefix.

mimmo

BTW: is there a reason why (convert nil), from the syntax.clj, returns the empty string ""? An empty string is considered true by clojure in a boolean context. So it appears like as the convert function converts a false value (nil is considered false by clojure in a boolean context) in a true value. Is that what you mean?

On Oct 27, 2013, at 2:16 AM, Creighton Kirkendall notifications@github.com wrote:

I am not a fan of mixing code with resources. It might be better to move to something like this structure.

/test/cljs/enfocus -> standard tests /test/cljs/enfocus/browser_reporting/ -> reporting tests /test/support_tools/... -> all reporting and ring related code

CK

— Reply to this email directly or view it on GitHub.

magomimmo commented 11 years ago

Hi Creighton, I did a lot of works:

  1. Added unit test enfocus.enlive.syntax-test for enfocus.enlive.syntax.clj namespace (at the moment I added the edge cases for the convert function only).
  2. Consequently re-added cljx plugin to support the sharing between CLJ and CLJS og the unit-tests
  3. Consequently update the project.clj (very thiny updated) and the profiles.clj files (a lot of updates)
  4. Fixed the convert and the sel-to-str functions to support the idiomatic way in clojure to deal with the logical true and false values.
  5. Moved the ring server under the test/tools directory
  6. Moved your reporting stuff under the test/tools directory too.

Everything work as expected, aside your stuff.

You can take a look at its failure by issuing the following commands:

lein do clean, cljx once, compile

...it takes time, because there are a lot of builds (7) to be compiled down. Then...

lein test

You will see that all the not reporting units returns what is expected. Your stuff return more errors. If you want to have a less dense view of the errors returning from your stuff, just issue

lein cljsbuild test whitespace

HIH My best

ckirkendall commented 11 years ago

I pushed up 2.1.0-SNAPSHOT. I also made a few changes to how the tests are organized. Thanks again for all your hard work on this.

magomimmo commented 11 years ago

It seems that everything is working. Great!

On Oct 27, 2013, at 8:33 PM, Creighton Kirkendall notifications@github.com wrote:

I pushed up 2.1.0-SNAPSHOT. I also made a few changes to how the tests are organized. Thanks again for all your hard work on this.

— Reply to this email directly or view it on GitHub.