AbstractDistributionMap >> defaultTitleFormattingBlock looks wrong

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

AbstractDistributionMap >> defaultTitleFormattingBlock looks wrong

Mariano Martinez Peck
AbstractDistributionMap >> defaultTitleFormattingBlock
    ^ [ :each |
    | t |
    t := each.
    (t beginsWith: 'Citezen-')
        ifTrue: [ t := t copyReplaceAll: 'Citezen-' with: 'C' ].
    (t beginsWith: 'Seaside-')
        ifTrue: [ t := t copyReplaceAll: 'Seaside-' with: 'S' ].
    t := t copyReplaceAll: 'Tests-' with: 'T-'.
    "t := (Kontract reduce: t upTo: 10)."
    t ]


On the one hand, it hardcodes stuff like Citizen or Seaside. But what is worse is that that Kontract does not exist...

Cheers,

--
Mariano
http://marianopeck.wordpress.com


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: AbstractDistributionMap >> defaultTitleFormattingBlock looks wrong

Usman Bhatti
Thats correct. We need to clean this code, its a implementation method that somehow proliferated into the abstract class.
I'll take care of it.

I think we already discussed about integrated Kontract in Moose on this list. Otherwise, we should look for another alternative to achieve word contraction task.


regards,
Usman

On Thu, May 31, 2012 at 5:10 PM, Mariano Martinez Peck <[hidden email]> wrote:
AbstractDistributionMap >> defaultTitleFormattingBlock
    ^ [ :each |
    | t |
    t := each.
    (t beginsWith: 'Citezen-')
        ifTrue: [ t := t copyReplaceAll: 'Citezen-' with: 'C' ].
    (t beginsWith: 'Seaside-')
        ifTrue: [ t := t copyReplaceAll: 'Seaside-' with: 'S' ].
    t := t copyReplaceAll: 'Tests-' with: 'T-'.
    "t := (Kontract reduce: t upTo: 10)."
    t ]


On the one hand, it hardcodes stuff like Citizen or Seaside. But what is worse is that that Kontract does not exist...

Cheers,

--
Mariano
http://marianopeck.wordpress.com


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: AbstractDistributionMap >> defaultTitleFormattingBlock looks wrong

Usman Bhatti
I committed a version.
I tried to create some tests but, in its current form, its difficult to test the titles of the entities in a distribution map. 

On Thu, May 31, 2012 at 5:25 PM, Usman Bhatti <[hidden email]> wrote:
Thats correct. We need to clean this code, its a implementation method that somehow proliferated into the abstract class.
I'll take care of it.

I think we already discussed about integrated Kontract in Moose on this list. Otherwise, we should look for another alternative to achieve word contraction task.


regards,
Usman

On Thu, May 31, 2012 at 5:10 PM, Mariano Martinez Peck <[hidden email]> wrote:
AbstractDistributionMap >> defaultTitleFormattingBlock
    ^ [ :each |
    | t |
    t := each.
    (t beginsWith: 'Citezen-')
        ifTrue: [ t := t copyReplaceAll: 'Citezen-' with: 'C' ].
    (t beginsWith: 'Seaside-')
        ifTrue: [ t := t copyReplaceAll: 'Seaside-' with: 'S' ].
    t := t copyReplaceAll: 'Tests-' with: 'T-'.
    "t := (Kontract reduce: t upTo: 10)."
    t ]


On the one hand, it hardcodes stuff like Citizen or Seaside. But what is worse is that that Kontract does not exist...

Cheers,

--
Mariano
http://marianopeck.wordpress.com


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: AbstractDistributionMap >> defaultTitleFormattingBlock looks wrong

Mariano Martinez Peck


On Thu, May 31, 2012 at 7:58 PM, Usman Bhatti <[hidden email]> wrote:
I committed a version.

Thanks Usman. It works now.
 
I tried to create some tests but, in its current form, its difficult to test the titles of the entities in a distribution map. 


No problem for me, I understand ;)
 

On Thu, May 31, 2012 at 5:25 PM, Usman Bhatti <[hidden email]> wrote:
Thats correct. We need to clean this code, its a implementation method that somehow proliferated into the abstract class.
I'll take care of it.

I think we already discussed about integrated Kontract in Moose on this list. Otherwise, we should look for another alternative to achieve word contraction task.


regards,
Usman

On Thu, May 31, 2012 at 5:10 PM, Mariano Martinez Peck <[hidden email]> wrote:
AbstractDistributionMap >> defaultTitleFormattingBlock
    ^ [ :each |
    | t |
    t := each.
    (t beginsWith: 'Citezen-')
        ifTrue: [ t := t copyReplaceAll: 'Citezen-' with: 'C' ].
    (t beginsWith: 'Seaside-')
        ifTrue: [ t := t copyReplaceAll: 'Seaside-' with: 'S' ].
    t := t copyReplaceAll: 'Tests-' with: 'T-'.
    "t := (Kontract reduce: t upTo: 10)."
    t ]


On the one hand, it hardcodes stuff like Citizen or Seaside. But what is worse is that that Kontract does not exist...

Cheers,

--
Mariano
http://marianopeck.wordpress.com


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--
Mariano
http://marianopeck.wordpress.com


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: AbstractDistributionMap >> defaultTitleFormattingBlock looks wrong

Tudor Girba-2
In reply to this post by Usman Bhatti
Hi Usman,

Kontractor is already integrated as MalKontractor.

Cheers,
Doru


On 31 May 2012, at 17:25, Usman Bhatti wrote:

> Thats correct. We need to clean this code, its a implementation method that somehow proliferated into the abstract class.
> I'll take care of it.
>
> I think we already discussed about integrated Kontract in Moose on this list. Otherwise, we should look for another alternative to achieve word contraction task.
>
>
> regards,
> Usman
>
> On Thu, May 31, 2012 at 5:10 PM, Mariano Martinez Peck <[hidden email]> wrote:
> AbstractDistributionMap >> defaultTitleFormattingBlock
>     ^ [ :each |
>     | t |
>     t := each.
>     (t beginsWith: 'Citezen-')
>         ifTrue: [ t := t copyReplaceAll: 'Citezen-' with: 'C' ].
>     (t beginsWith: 'Seaside-')
>         ifTrue: [ t := t copyReplaceAll: 'Seaside-' with: 'S' ].
>     t := t copyReplaceAll: 'Tests-' with: 'T-'.
>     "t := (Kontract reduce: t upTo: 10)."
>     t ]
>
>
> On the one hand, it hardcodes stuff like Citizen or Seaside. But what is worse is that that Kontract does not exist...
>
> Cheers,
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"One cannot do more than one can do."




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev