Re: [ANN] com.walmartlabs/dyn-edn 0.1.0

2018-02-23 Thread Ravindra Jaju
I've had one too on similar lines for quite some time

https://github.com/jaju/properties-clj

Primarily used for the `properties` format, but it supports EDN too via the
`read-edn` function. This library uses the almost-BASH syntax for picking
env variables with default

${USER:some-user} would be replaced with
1. "valid-user" if System/getenv has the USER variable defined
2. "some-user" if not.

Works for both properties files and EDN, although I never bothered to put
EDN examples in the README all this while and updated it just now.

On Tue, Feb 20, 2018 at 8:29 PM, Alan Thompson  wrote:

> Looks very useful.  One suggestion:  the example might be easier to read
> if you included the values of the env vars, and clarified the way you
> specify default values:
>
> {:connection-pool
>   {:user-name #dyn/prop [DB_USER "accountsuser"]  ; default value
> "accountsuser"
>:user-pw #dyn/prop DB_PW   ; no default value
>:url  #dyn/join ["jdbc:postgresql://"
>#dyn/prop [DB_HOST "localhost"]
>":"
>#dyn/prop [DB_PORT "5432"]
>"/accounts"]}
>  :web-server
>   {:port #dyn/long #dyn/prop "WEB_PORT"}}
>
>
> with  environment variables:
>
> # DB_USER 
> DB_PW=change-me
> DB_HOST=db.example.org
> # DB_PORT 
> WEB_PORT=8192
>
>
> yields:
>
> {:connection-pool
>   {:user-name "accountsuser"
>:user-pw "change-me"
>:url  "jdbc:postgresql://db.example.org:5432/accounts"]}
>  :web-server
>   {:port 8192}}
>
>
>
>
>
>
> On Fri, Feb 16, 2018 at 2:20 PM, Howard Lewis Ship 
> wrote:
>
>>
>> com.walmartlabs/dyn-edn 0.1.0
>>
>> Tiny library to allow dynamic data when parsing EDN; useful for
>> configuration files.
>>
>> https://github.com/hlship/dyn-edn
>>
>> For example:
>>
>> {:connection-pool
>>   {:user-name #dyn/prop [DB_USER "accountsuser"]
>>:user-pw #dyn/prop DB_PW
>>:url  #dyn/join ["jdbc:postgresql://"
>>#dyn/prop [DB_HOST "localhost"]
>>":"
>>#dyn/prop [DB_PORT "5432"]
>>"/accounts"]}
>>  :web-server
>>   {:port #dyn/long #dyn/prop "WEB_PORT"}}
>>
>>
>> can use environment variables to reduce down to:
>>
>>
>> {:connection-pool
>>   {:user-name "accountsuser"
>>:user-pw "change-me"
>>:url  "jdbc:postgresql://db.example.org:5432/accounts"]}
>>  :web-server
>>   {:port 8192}}
>>
>>
>> --
>> Howard M. Lewis Ship
>>
>> Senior Mobile Developer at Walmart Labs
>>
>> Creator of Apache Tapestry
>>
>> (971) 678-5210
>> http://howardlewisship.com
>> @hlship
>>
>> --
>> 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.
>>
>
> --
> 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.
>

-- 
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: [ANN] com.walmartlabs/dyn-edn 0.1.0

2018-02-20 Thread Alan Thompson
Looks very useful.  One suggestion:  the example might be easier to read if
you included the values of the env vars, and clarified the way you specify
default values:

{:connection-pool
  {:user-name #dyn/prop [DB_USER "accountsuser"]  ; default value
"accountsuser"
   :user-pw #dyn/prop DB_PW   ; no default value
   :url  #dyn/join ["jdbc:postgresql://"
   #dyn/prop [DB_HOST "localhost"]
   ":"
   #dyn/prop [DB_PORT "5432"]
   "/accounts"]}
 :web-server
  {:port #dyn/long #dyn/prop "WEB_PORT"}}


with  environment variables:

# DB_USER 
DB_PW=change-me
DB_HOST=db.example.org
# DB_PORT 
WEB_PORT=8192


yields:

{:connection-pool
  {:user-name "accountsuser"
   :user-pw "change-me"
   :url  "jdbc:postgresql://db.example.org:5432/accounts"]}
 :web-server
  {:port 8192}}






On Fri, Feb 16, 2018 at 2:20 PM, Howard Lewis Ship  wrote:

>
> com.walmartlabs/dyn-edn 0.1.0
>
> Tiny library to allow dynamic data when parsing EDN; useful for
> configuration files.
>
> https://github.com/hlship/dyn-edn
>
> For example:
>
> {:connection-pool
>   {:user-name #dyn/prop [DB_USER "accountsuser"]
>:user-pw #dyn/prop DB_PW
>:url  #dyn/join ["jdbc:postgresql://"
>#dyn/prop [DB_HOST "localhost"]
>":"
>#dyn/prop [DB_PORT "5432"]
>"/accounts"]}
>  :web-server
>   {:port #dyn/long #dyn/prop "WEB_PORT"}}
>
>
> can use environment variables to reduce down to:
>
>
> {:connection-pool
>   {:user-name "accountsuser"
>:user-pw "change-me"
>:url  "jdbc:postgresql://db.example.org:5432/accounts"]}
>  :web-server
>   {:port 8192}}
>
>
> --
> Howard M. Lewis Ship
>
> Senior Mobile Developer at Walmart Labs
>
> Creator of Apache Tapestry
>
> (971) 678-5210
> http://howardlewisship.com
> @hlship
>
> --
> 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.
>

-- 
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: [ANN] com.walmartlabs/dyn-edn 0.1.0

2018-02-16 Thread Howard Lewis Ship
Oh, yea, very similar.  I wasn't tracking, and the overlap is significant.

dyn-edn is just one part, packaged as small as possible, about 90 lines of
code.  aero looks similar to io.aviso/config (itself very small), but big
enough to be noticable.

dyn-edn is intended to just plug into whatever you were already doing for
configuration, but allow it to be a bit more dynamic.

On Fri, Feb 16, 2018 at 2:43 PM, John Newman  wrote:

> You tracking juxt/aero? Sounds very similar.
>
> On Feb 16, 2018 5:20 PM, "Howard Lewis Ship"  wrote:
>
>>
>> com.walmartlabs/dyn-edn 0.1.0
>>
>> Tiny library to allow dynamic data when parsing EDN; useful for
>> configuration files.
>>
>> https://github.com/hlship/dyn-edn
>>
>> For example:
>>
>> {:connection-pool
>>   {:user-name #dyn/prop [DB_USER "accountsuser"]
>>:user-pw #dyn/prop DB_PW
>>:url  #dyn/join ["jdbc:postgresql://"
>>#dyn/prop [DB_HOST "localhost"]
>>":"
>>#dyn/prop [DB_PORT "5432"]
>>"/accounts"]}
>>  :web-server
>>   {:port #dyn/long #dyn/prop "WEB_PORT"}}
>>
>>
>> can use environment variables to reduce down to:
>>
>>
>> {:connection-pool
>>   {:user-name "accountsuser"
>>:user-pw "change-me"
>>:url  "jdbc:postgresql://db.example.org:5432/accounts"]}
>>  :web-server
>>   {:port 8192}}
>>
>>
>> --
>> Howard M. Lewis Ship
>>
>> Senior Mobile Developer at Walmart Labs
>>
>> Creator of Apache Tapestry
>>
>> (971) 678-5210
>> http://howardlewisship.com
>> @hlship
>>
>> --
>> 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.
>>
>


-- 
Howard M. Lewis Ship

Senior Mobile Developer at Walmart Labs

Creator of Apache Tapestry

(971) 678-5210
http://howardlewisship.com
@hlship

-- 
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.


[ANN] com.walmartlabs/dyn-edn 0.1.0

2018-02-16 Thread Howard Lewis Ship
com.walmartlabs/dyn-edn 0.1.0

Tiny library to allow dynamic data when parsing EDN; useful for
configuration files.

https://github.com/hlship/dyn-edn

For example:

{:connection-pool
  {:user-name #dyn/prop [DB_USER "accountsuser"]
   :user-pw #dyn/prop DB_PW
   :url  #dyn/join ["jdbc:postgresql://"
   #dyn/prop [DB_HOST "localhost"]
   ":"
   #dyn/prop [DB_PORT "5432"]
   "/accounts"]}
 :web-server
  {:port #dyn/long #dyn/prop "WEB_PORT"}}


can use environment variables to reduce down to:


{:connection-pool
  {:user-name "accountsuser"
   :user-pw "change-me"
   :url  "jdbc:postgresql://db.example.org:5432/accounts"]}
 :web-server
  {:port 8192}}


-- 
Howard M. Lewis Ship

Senior Mobile Developer at Walmart Labs

Creator of Apache Tapestry

(971) 678-5210
http://howardlewisship.com
@hlship

-- 
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.