Add <bs>, <wait5>, <wait10>, <del> special keys (Packerisms) #989

Merged
merged 2 commits into from Oct 23, 2014

Projects

None yet

2 participants

@aw
Contributor
aw commented Oct 5, 2014

I noticed a lot of people doing crazy hacks like: '<Wait>'*5 in their templates. This PR steals some good features from Packer, such as <Wait5> and <Wait10>.

I also added some other special keys to match-up with what's available in Packer templates.

@mpapis
Collaborator
mpapis commented Oct 5, 2014

since we are using regexp we could handle the <wait(.*)> and use $1 for the value:

1.9.3-p547 :001 > /<wait(.*)>/ =~ "<wait>"
 => 0
1.9.3-p547 :002 > $1
 => ""
1.9.3-p547 :003 > /<wait(.*)>/ =~ "<wait5>"
 => 0
1.9.3-p547 :004 > $1
 => "5"
@mpapis mpapis added the need info label Oct 5, 2014
@mpapis
Collaborator
mpapis commented Oct 5, 2014

and great that you are working on making us closer to packer - want to add support for it's templates soon

@aw
Contributor
aw commented Oct 5, 2014

👍

ok let me think about this.. could be dangerous but maybe your idea will work.

@mpapis
Collaborator
mpapis commented Oct 5, 2014

you can always do <wait([[:digit:]]*)> add extra check for "" and append to_i:)

@aw
Contributor
aw commented Oct 5, 2014

Yes I was thinking of using /<wait(\d*)>/ .. just doing some tests here.

@mpapis
Collaborator
mpapis commented Oct 9, 2014

hey, any progress? need help with that? or should I merge and add the regexp thing?

@aw
Contributor
aw commented Oct 9, 2014

Sorry, I'll get back to this on the weekend.

@mpapis
Collaborator
mpapis commented Oct 9, 2014

thanks

@mpapis
Collaborator
mpapis commented Oct 15, 2014

oh the weekend past, let me know if you still want to work on the improvement or if I should finish it.

@mpapis mpapis merged commit fe10285 into jedi4ever:master Oct 23, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@mpapis mpapis removed the need info label Oct 23, 2014
@mpapis
Collaborator
mpapis commented Oct 23, 2014

and added the matching, let me know how it works for you (... my vbox just died)

@mpapis mpapis added a commit that referenced this pull request Nov 1, 2014
@mpapis mpapis use to_s instead of string from MatchData, fix #1011, update #989 6d46ea2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment