Re: What does :resource-paths in leiningen do?

2014-07-05 Thread Chris Kuttruff
So if you have an arbitrary number of files in said resources directory, is 
there a good way to find all files underneath a certain resource path?
if I have resources/foo.txt and resources/bar.txt, what function would 
I use to exact both names of the txt files I have?

Thanks in advance,
-Chris

On Thursday, September 13, 2012 3:02:09 AM UTC-7, Murtaza Husain wrote:


 A good use case - You want to place html files, that can be processed in 
 your server side code. Inorder for your code to have access to it, you will 
 have to place them in the src dir. However if you use the :resource-path, 
 you can define a dir relative to the root of your project where you are 
 placing your html files. 

 I recently used them to place my html files in resource/public/templates 
 folder, when using enlive for processing html files. 

 On Monday, September 10, 2012 9:35:56 PM UTC+5:30, Phil Hagelberg wrote:

 larry google groups lawrenc...@gmail.com writes: 

  I see this: 
  
  :resource-paths [src/main/resource] ; non-code files included in 
  classpath/jar 
  
  I am confused in 2 ways: 
  
  1.) is this a break from java conventions? I thought Java projects 
  tended to put a resources folder at the top level of a project, 
  rather than inside of src? 

 The top-level resources/ is what you get by default; the sample 
 project.clj file just shows you what it would look like if you were to 
 change it. Personally I'm not a fan of the paid-by-the-directory deep 
 nesting approach, but it's shown there because it's the only other 
 common convention. =) 

 -Phil 



-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Database migrations

2014-02-27 Thread Chris Kuttruff
Reginald, clearly late to the game on this thread :)  but figured I'd share 
a project that I created recently ( clj-sql-up ).  It is a leiningen plugin 
that is dead simple to use, and it doesn't try to over-abstract, but it 
also allows for dynamic sql generation since it runs from the context of a 
clojure file.  I think it's simplest option out there for doing database 
migrations with clojure without sacrificing expressiveness

Please let me know if you run into any issues, but should be quite easy to 
get rolling with:
https://github.com/ckuttruff/clj-sql-up


On Friday, June 14, 2013 9:24:39 AM UTC-7, Reginald Choudari wrote:

 Hello all,

 I am trying to implement database migrations with Clojure. So far I have 
 been looking at Drift (https://github.com/macourtney/drift) as a 
 candidate for implementing this. My question is, does anyone have a 
 database migration workflow that they use and would like to share? One 
 problem I have been thinking is how to tackle database credentials/db name 
 configuration. I know in Rails its common to use a YAML to provide this 
 info, wondering if there was something more idiosyncratic to clojure?

 Thanks in advance


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Latest web framework for clojure

2014-02-26 Thread Chris Kuttruff
+1 to this... I've set up a basic site with these basic tools (jetty 
instead of http-kit for development simplicity with lein ring).  Couldn't 
be any simpler to get going, and it's really nice to have everything 
explicitly namespaced... you can just organize things how want.

Also, I would recommend checking out clj-sql-up if you'd like a nice, small 
library for doing database migrations.  There are certainly some other 
options out there in this dept, but I think clj-sql-up is the simplest 
possible implementation and still allows you the flexibility of dynamically 
generating sql strings with clojure (if you're using some other library to 
dynamically generate sql; would be easy to include and use with the 
migration files)
https://github.com/ckuttruff/clj-sql-up

Please let me know if you have any issues, but I think it should be pretty 
easy to use, and hopefully useful for your project.  


On Wednesday, February 26, 2014 12:29:44 PM UTC-8, Moritz Ulrich wrote:

 In addition to all the other message here please note, that it's very 
 helpful to build a site with just http-kit, hiccup and compojure, 
 which are all three independent components. This gives you the freedom 
 to structure your application however you like without getting in your 
 way like many frameworks. 

 It's also a good learning exercise as you learn how most Clojure 
 web-application stacks work. 

 On Wed, Feb 26, 2014 at 2:13 AM, Aravindh S 
 arav...@theintrospect.injavascript: 
 wrote: 
  Hi All, 
 I have been reading clojure for sometime now. I am at a point where I 
  want to learn a web framework. I see many options available for clojure 
  where few are built upon others. So if I am to learn one, which 
 framework 
  does the community recommend? 
  
  Thanks 
  Aravindh.S 
  
  -- 
  You received this message because you are subscribed to the Google 
  Groups Clojure group. 
  To post to this group, send email to clo...@googlegroups.comjavascript: 
  Note that posts from new members are moderated - please be patient with 
 your 
  first post. 
  To unsubscribe from this group, send email to 
  clojure+u...@googlegroups.com javascript: 
  For more options, visit this group at 
  http://groups.google.com/group/clojure?hl=en 
  --- 
  You received this message because you are subscribed to the Google 
 Groups 
  Clojure group. 
  To unsubscribe from this group and stop receiving emails from it, send 
 an 
  email to clojure+u...@googlegroups.com javascript:. 
  For more options, visit https://groups.google.com/groups/opt_out. 


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: What non-deprecated Clojure Web libraries to use?

2013-10-29 Thread Chris Kuttruff
Well things were kept separate intentionally.  If someone wants to use 
Korma or some other DSL within their migrations, they can augment their 
migration file to use that to generate the SQL, but having the migrations 
set up such that instructions to jdbc are simple clojure strings is very 
intentional.  This way I don't limit anyone's decision about what other 
libraries they use, but complicated migrations can easily be dynamically 
generated (since they are being picked up within the context of a clojure 
file).

Not sure I fully understand your point, but this seems like a reasonable 
case for modularity.


On Tuesday, October 29, 2013 8:49:55 AM UTC-7, Brian Craft wrote:



 On Monday, October 28, 2013 4:36:56 PM UTC-7, Chris Kuttruff wrote:

 Separate from DSLs like Korma, etc.  I have written a simple library for 
 doing database migrations with clojure (clj-sql-up ( 
 https://github.com/ckuttruff/clj-sql-up )).  There are also other 
 libraries still maintained along these lines (drift, migratus, ragtime, 
 etc.)


 It's unfortunate that these are separate, because you need the schema 
 information not just for migrations, but also for query abstraction (sql 
 dsl, etc.). The argument for small, composable libraries only works if they 
 can actually be meaningfully composed: if, in this case, a declared schema 
 can be used for migrations, and query abstraction, and administrative UI, 
 and anything else that requires it. So far there's not much like this in 
 clojure that I've found.


-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: What non-deprecated Clojure Web libraries to use?

2013-10-28 Thread Chris Kuttruff
Separate from DSLs like Korma, etc.  I have written a simple library for 
doing database migrations with clojure (clj-sql-up ( 
https://github.com/ckuttruff/clj-sql-up )).  There are also other libraries 
still maintained along these lines (drift, migratus, ragtime, etc.)

Hopefully one of these will be useful for your project.


On Sunday, October 27, 2013 10:43:21 AM UTC-7, Scott M wrote:

 Ring seems well maintained, but Noir and Compojure are marked deprecated.

 Can anyone lay out a Clojure Web library stack (up to templating) that 
 is current and maintained?

 Any and all sagacious wisdom greatly appreciated - thanks! 

 - Scott


-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Introducing a new SQL migration library for clojure / jdbc

2013-09-07 Thread Chris Kuttruff
Alexandr, 
Thanks so much for the feedback;  really glad others are finding this 
useful as well.

I've just published a 0.2.0 version with support for multiple environments 
(Just use an ENV=test type flag when invoking the plugin command, and have 
a corresponding :database-test config in your project.clj).  Also added 
support for rollinback mult. migrations (eg: lein clj-sql-up rollback 3)

I've pushed the new version to clojars and updated the README, etc on 
github (https://github.com/ckuttruff/clj-sql-up)

Thanks again; please let me know if you have any issues or would like to 
see other functionality included,
-Chris


On Saturday, September 7, 2013 12:27:21 AM UTC-7, Alexandr Kurilin wrote:

 This is great, thanks for making it.

 There was nothing quite like that I could find back when I started on our 
 web app, so I ended using 
 standalone_migrationshttps://github.com/thuss/standalone-migrations, 
 which is essentially ActiveRecord's Migration module extracted for 
 standalone use. Right now it has the advantage over clj-sql-up of 
 supporting multiple environments, but it does unfortunately force you to 
 have ruby support a Gemfile etc, which isn't as awesome as doing everything 
 through clojure.

 I'll be following clj-sql-up's progress :)

 On Saturday, July 20, 2013 6:35:29 PM UTC-7, Plinio Balduino wrote:

 Thank you, Chris

 I think it will be very useful for my next project.

 Regards

 PlĂ­nio

 On Sat, Jul 20, 2013 at 7:19 PM, Chris Kuttruff kutt...@gmail.comwrote:

 When starting a project to create a clojure blog with 
 ring/compojure/hiccup, I quickly found myself looking for an SQL migration 
 library to use.

 There are some interesting projects out there, but I found myself 
 wanting the following features:

- A standard up/down migration method setup (so I could execute 
multiple migrate/rollback statements within a clojure file) 
- The ability to execute arbitrary SQL (including creation of 
triggers/stored procedures)
- A generic structure to support as many databases as possible
- A simple create method (to generate migration files) 

 I have used other migration setups (eg: rails), and was looking for 
 something similar in terms of features and simplicity of usage.

 The following leiningen plugin is my attempt to accomplish the 
 aforementioned objectives as simply as possible:

 https://github.com/ckuttruff/clj-sql-up

 I am new to clojure / leiningen, so any suggestions / feedback would be 
 much appreciated.  It's still very much a work in progress; I plan to add 
 many more tests, clean up some of the repetition/inelegance, and make 
 various aspects more generic.

 Thanks for your time and consideration; I hope this library can be of 
 use to others.

 -Chris

 -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.com
 Note that posts from new members are moderated - please be patient with 
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google 
 Groups Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to clojure+u...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  




-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Introducing a new SQL migration library for clojure / jdbc

2013-07-20 Thread Chris Kuttruff
When starting a project to create a clojure blog with 
ring/compojure/hiccup, I quickly found myself looking for an SQL migration 
library to use.

There are some interesting projects out there, but I found myself wanting 
the following features:

   - A standard up/down migration method setup (so I could execute multiple 
   migrate/rollback statements within a clojure file)
   - The ability to execute arbitrary SQL (including creation of 
   triggers/stored procedures)
   - A generic structure to support as many databases as possible
   - A simple create method (to generate migration files)

I have used other migration setups (eg: rails), and was looking for 
something similar in terms of features and simplicity of usage.

The following leiningen plugin is my attempt to accomplish the 
aforementioned objectives as simply as possible:

https://github.com/ckuttruff/clj-sql-up

I am new to clojure / leiningen, so any suggestions / feedback would be 
much appreciated.  It's still very much a work in progress; I plan to add 
many more tests, clean up some of the repetition/inelegance, and make 
various aspects more generic.

Thanks for your time and consideration; I hope this library can be of use 
to others.

-Chris

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Possible to add dependency within leiningen plugin dynamically?

2013-07-11 Thread Chris Kuttruff
Eg: 

I have a leiningen plugin I'm building that calls some jdbc stuff, but the 
specific driver would be specified in the project that brings in my plugin 
as a dependency.
Would this be possible?  If so, how would I go about it?  Was looking into 
leinjacker, but having trouble accomplishing what I want.

Thanks in advance!

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Possible to add dependency within leiningen plugin dynamically?

2013-07-11 Thread Chris Kuttruff
Shantanu, thanks for the reply; yes, that definitely seems like a similar 
situation.  I will take a close look at that code tomorrow.

Here is the example that you requested:
Entry point for the plugin:
https://github.com/ckuttruff/clj-sql-up/blob/master/src/leiningen/clj_sql_up.clj

Function that is called:
https://github.com/ckuttruff/clj-sql-up/blob/master/src/clj_sql_up/migrate.clj

Example project.clj that uses the plugin:
(defproject foo 0.1.0
  :plugins [[clj-sql-up 0.1.0]]
  :clj-sql-up {:database jdbc:postgresql://localhost:5432/slackz?slackz})

Leiningen call:
lein clj-sql-up migrate

** Note: I know there are some existing tools to manage db migrations, but 
I'm developing this in large part to learn more about leiningen / writing 
plugins.

Thanks again,
-Chris


On Thursday, July 11, 2013 12:19:03 AM UTC-7, Shantanu Kumar wrote:



 On Thursday, 11 July 2013 12:24:34 UTC+5:30, Chris Kuttruff wrote:

 Eg: 

 I have a leiningen plugin I'm building that calls some jdbc stuff, but 
 the specific driver would be specified in the project that brings in my 
 plugin as a dependency.


 Can you describe your use case with an example maybe? I am not sure if 
 it's similar to what you want, but some time back I wrote a plugin called 
 lein-servlet that can fetch a user-specified dependency (in project.clj) 
 from Clojars. Checking out the sample project.clj is pretty easy -- run the 
 following at command line:

 $ lein new lein-servlet foo
 $ cd foo
 $ lein servlet run  # Ctrl+C to stop
 $ # see the project.clj that uses Jetty by default

 The plugin is here:

 https://github.com/kumarshantanu/lein-servlet

 Shantanu


-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Possible to add dependency within leiningen plugin dynamically?

2013-07-11 Thread Chris Kuttruff
Brilliant!  worked perfectly for me... found the magic you were referring 
to in load-deps ( 
https://github.com/kumarshantanu/lein-servlet/blob/master/plugin/src/leiningen/servlet.clj#L35
 
)
and the pomegranate/add-dependencies call ( 
https://github.com/cemerick/pomegranate/blob/master/src/main/clojure/cemerick/pomegranate.clj#L57
 
)

Thanks so much for sharing... btw, how does that require work for the 
pomegranate when it isn't listed in your project.clj dependencies.  seems 
like some chicken and egg type problem

-Chris


On Thursday, July 11, 2013 12:19:03 AM UTC-7, Shantanu Kumar wrote:



 On Thursday, 11 July 2013 12:24:34 UTC+5:30, Chris Kuttruff wrote:

 Eg: 

 I have a leiningen plugin I'm building that calls some jdbc stuff, but 
 the specific driver would be specified in the project that brings in my 
 plugin as a dependency.


 Can you describe your use case with an example maybe? I am not sure if 
 it's similar to what you want, but some time back I wrote a plugin called 
 lein-servlet that can fetch a user-specified dependency (in project.clj) 
 from Clojars. Checking out the sample project.clj is pretty easy -- run the 
 following at command line:

 $ lein new lein-servlet foo
 $ cd foo
 $ lein servlet run  # Ctrl+C to stop
 $ # see the project.clj that uses Jetty by default

 The plugin is here:

 https://github.com/kumarshantanu/lein-servlet

 Shantanu


-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.