Re: About the enhanced version of `Properties`, i.e. `GProperties`

2018-11-02 Thread Daniel.Sun
No. GProperties to Properties is similar with GString to String, GProperties
is much more powerful than Properties, so I recommend groovy users use
GProperties where Properties is used. If GProperties only process the file
with new file extension, we can not replace Properties in existing groovy
code easily because we have to change the file extension.

Cheers,
Daniel.Sun




-
Daniel Sun 
Apache Groovy committer 
Blog: http://blog.sunlan.me 
Twitter: @daniel_sun 

--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html


Re: About the enhanced version of `Properties`, i.e. `GProperties`

2018-11-02 Thread Daniil Ovchinnikov
Did you consider using different file extension?

—

Daniil Ovchinnikov
JetBrains

> On 2 Nov 2018, at 18:39, Daniel.Sun  wrote:
> 
> I've added some doc to show the usage:
> 
> https://github.com/apache/groovy/blob/3775edeabde19eb5229e840ec2ffc1dcf90634db/src/main/groovy/groovy/util/GProperties.groovy
> 
> 
> Cheers,
> Daniel.Sun
> 
> 
> 
> 
> -
> Daniel Sun 
> Apache Groovy committer 
> Blog: http://blog.sunlan.me 
> Twitter: @daniel_sun 
> 
> --
> Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html



Re: About the enhanced version of `Properties`, i.e. `GProperties`

2018-11-02 Thread Daniel.Sun
I've added some doc to show the usage:

https://github.com/apache/groovy/blob/3775edeabde19eb5229e840ec2ffc1dcf90634db/src/main/groovy/groovy/util/GProperties.groovy


Cheers,
Daniel.Sun




-
Daniel Sun 
Apache Groovy committer 
Blog: http://blog.sunlan.me 
Twitter: @daniel_sun 

--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html


Re: About refining regex literal syntax

2018-11-02 Thread MG




Am 22.10.2018 um 22:34 schrieb Guillaume Laforge:
Damn, MG will tell me again I'm reacting negatively to Daniel's ideas 
but... :-)


No, no - it's not a knee jerk reaction. In this case I see both points, 
and am torn on what I would prefer...


(Generally speaking, while having a "regex string literal syntax" in 
Groovy is great and I use it quite a bit, I always thought that using 
the slash delmiter for this was alas not a good choice, so if breaking 
changes are on the table, I would consider fading out slashy strings in 
favor of a different syntax. I am also high on Jochen's suggestion to 
streamline/unify the different string syntax varieties in Groovy...)


Cheers,
mg






Re: About simplifying the switch for runtime groovydoc

2018-11-02 Thread MG
Agree with Guillaume here: In my (bad) experience, 15 Facebook friends 
is all it takes to swing nearly any poll in your favour and get a 
landslide victory.


Am 24.10.2018 um 16:12 schrieb Guillaume Laforge:

Not necessarily. Discussions are better, leading towards a consensus.
Polls can have very different outcomes depending on how you define the 
questions and answers, how you advertise the poll, how you interpret 
the results of the poll, etc.
Before any poll, I'd like to hear about those early users of this 
non-released-yet feature, to hear what their thoughts are.

There's no need to hurry or rush towards adding this shortcut notation.


On Wed, Oct 24, 2018 at 3:57 PM Daniel.Sun > wrote:


Raising a poll may be better way to make decisions ;)

Cheers,
Daniel.Sun




-
Daniel Sun
Apache Groovy committer
Blog: http://blog.sunlan.me
Twitter: @daniel_sun

--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html



--
Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Developer Advocate @ Google Cloud Platform

Blog: http://glaforge.appspot.com/
Twitter: @glaforge 




Re: About the enhanced version of `Properties`, i.e. `GProperties`

2018-11-02 Thread Daniel.Sun
Here are some tests to show its usage: 

https://github.com/apache/groovy/blob/96e94cf80ca4fc8449231e2f92508bca516bce87/src/test/groovy/util/GPropertiesTest.groovy

and here are the relevant properties files:
1,
https://github.com/apache/groovy/blob/96e94cf80ca4fc8449231e2f92508bca516bce87/src/test-resources/groovy/util/gproperties.properties
2,
https://github.com/apache/groovy/blob/96e94cf80ca4fc8449231e2f92508bca516bce87/src/test-resources/groovy/util/gproperties_import.properties
3,
https://github.com/apache/groovy/blob/96e94cf80ca4fc8449231e2f92508bca516bce87/src/test-resources/groovy/util/gproperties_import2.properties
4,
https://github.com/apache/groovy/blob/96e94cf80ca4fc8449231e2f92508bca516bce87/src/test-resources/groovy/util/gproperties_import3.properties


Cheers,
Daniel.Sun




-
Daniel Sun 
Apache Groovy committer 
Blog: http://blog.sunlan.me 
Twitter: @daniel_sun 

--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html


Re: About the enhanced version of `Properties`, i.e. `GProperties`

2018-11-02 Thread Milles, Eric (TR Tech, Content & Ops)
Can there be an example of its use shown before it is automatically merged into 
master/3.0?  Even the pull request and javadoc of the class do not describe its 
usage.  How can someone evaluate it this way and what are the alternatives if 
this does not exist?



From: Daniel Sun 
Sent: Thursday, November 1, 2018 10:05 PM
To: d...@groovy.incubator.apache.org
Subject: About the enhanced version of `Properties`, i.e. `GProperties`

Hi all,

   I propose to implement an enhanced version of `Properties`, i.e.
`GProperties`, which can interpolate values of properties and import other
properties in classpath.

   Here is the PR:   
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_groovy_pull_818=DwICAg=4ZIZThykDLcoWk-GVjSLmy8-1Cr1I4FWIvbLFebwKgY=tPJuIuL_GkTEazjQW7vvl7mNWVGXn3yJD5LGBHYYHww=ki23iPPqTr8gwhOjVyx3c_mhum0ln5RILmOf8IAoceo=aO1PJ51Q3a9FLGMw4EsPV7kgsvtcsDVh3TVlCqIvSsk=
[https://avatars1.githubusercontent.com/u/9151616?s=400=4]

GROOVY-8866: Implement `GProperties` to handle properties file smartly by 
danielsun1106 · Pull Request #818 · 
apache/groovy
urldefense.proofpoint.com




   Any thoughts?
   ( Andres's opinion on `GProperties` can be found at here[1]  )

Cheers,
Daniel.Sun

[1]
https://urldefense.proofpoint.com/v2/url?u=http-3A__groovy.329449.n5.nabble.com_Groovy-2D2-2D5-2D4-2Dplanning-2Dtp5754788p5754790.html=DwICAg=4ZIZThykDLcoWk-GVjSLmy8-1Cr1I4FWIvbLFebwKgY=tPJuIuL_GkTEazjQW7vvl7mNWVGXn3yJD5LGBHYYHww=ki23iPPqTr8gwhOjVyx3c_mhum0ln5RILmOf8IAoceo=F0F4fL1RtQtYxeRRhivfsLrmpDqPnT3t682xo06dhcs=




--
Sent from: 
https://urldefense.proofpoint.com/v2/url?u=http-3A__groovy.329449.n5.nabble.com_Groovy-2DDev-2Df372993.html=DwICAg=4ZIZThykDLcoWk-GVjSLmy8-1Cr1I4FWIvbLFebwKgY=tPJuIuL_GkTEazjQW7vvl7mNWVGXn3yJD5LGBHYYHww=ki23iPPqTr8gwhOjVyx3c_mhum0ln5RILmOf8IAoceo=wwaypip5_jx42HAqEL6az2VPwDYnJpij_VZML4FhE2U=


Re: Groovy 2.5.4 planning

2018-11-02 Thread Daniel Sun
Gotcha. 
The `GProperties` will be included in 3.0.0.

Cheers,
Daniel.Sun




--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html


Re: Groovy 2.5.4 planning

2018-11-02 Thread Guillaume Laforge
Agreed, we normally don't add new features in bug fix releases, but only in
main releases.

On Fri, Nov 2, 2018 at 10:07 AM Cédric Champeau 
wrote:

> -1 to including GProperties in a bugfix release. There's apparently
> discussion about the implication of doing this, and a bugfix release is not
> meant to add new features.
>
> Le ven. 2 nov. 2018 à 00:46, Daniel.Sun  a écrit :
>
>> Hi Paul,
>>
>>   I wish GProperties could be included in 2.5.4. Here is the relevant
>> PR:  https://github.com/apache/groovy/pull/818
>>
>> Cheers,
>> Daniel.Sun
>>
>>
>>
>> -
>> Daniel Sun
>> Apache Groovy committer
>> Blog: http://blog.sunlan.me
>> Twitter: @daniel_sun
>>
>> --
>> Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
>>
>

-- 
Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Developer Advocate @ Google Cloud Platform

Blog: http://glaforge.appspot.com/
Twitter: @glaforge 


Re: Groovy 2.5.4 planning

2018-11-02 Thread Guillaume Laforge
I was also thinking of a Boolean in a constructor.

Le ven. 2 nov. 2018 à 07:23, Paul King  a écrit :

> While I think security is very important to consider, I am unsure whether
> the switch is the way to go. Such switches are global in nature and that
> means you can't as easily as you might like use different GProperty
> instances in different contexts with different security contexts.
>
> Given use of GProperties is totally opt-in, I am wondering if a switch is
> needed but I am open to others thoughts on this topic. If a switch is
> needed, my suggestion would be different constructors with some boolean
> flags to indicate what features are enabled for a particular instance.
>
> Cheers, Paul.
>
>
> On Fri, Nov 2, 2018 at 1:15 PM Daniel Sun  wrote:
>
>> Hi Andres,
>>
>>   > if GProperties is added to core I’d suggest to set that flag to
>> false as default.
>>   Agreed :)
>>
>>   > Additionally, couldn’t this behavior be added to ConfigSlurper?
>>   As you can see, `GProperties` is a subclass of `Properties`, I
>> recommend groovy users to use the enhanced `Properties` by
>> default(`GProperties` to `Properties` is similar with `GString` to
>> `String`), which can handle properties smartly and handle input
>> stream/reader properly
>>
>> Cheers,
>> Daniel.Sun
>>
>>
>>
>> --
>> Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
>>
>


Re: Groovy 2.5.4 planning

2018-11-02 Thread Paul King
While I think security is very important to consider, I am unsure whether
the switch is the way to go. Such switches are global in nature and that
means you can't as easily as you might like use different GProperty
instances in different contexts with different security contexts.

Given use of GProperties is totally opt-in, I am wondering if a switch is
needed but I am open to others thoughts on this topic. If a switch is
needed, my suggestion would be different constructors with some boolean
flags to indicate what features are enabled for a particular instance.

Cheers, Paul.


On Fri, Nov 2, 2018 at 1:15 PM Daniel Sun  wrote:

> Hi Andres,
>
>   > if GProperties is added to core I’d suggest to set that flag to
> false as default.
>   Agreed :)
>
>   > Additionally, couldn’t this behavior be added to ConfigSlurper?
>   As you can see, `GProperties` is a subclass of `Properties`, I
> recommend groovy users to use the enhanced `Properties` by
> default(`GProperties` to `Properties` is similar with `GString` to
> `String`), which can handle properties smartly and handle input
> stream/reader properly
>
> Cheers,
> Daniel.Sun
>
>
>
> --
> Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
>