Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support objects as ScalaDsl definitions. #156

Merged
merged 3 commits into from Jan 21, 2012
Merged

Support objects as ScalaDsl definitions. #156

merged 3 commits into from Jan 21, 2012

Conversation

dwskoog
Copy link
Contributor

@dwskoog dwskoog commented Jan 21, 2012

This is what I worked up to make objects behave themselves a bit better than what @teigen and I noticed in #154

When ${baseDir} gets interpolated on Windows the traditional double-quote
delimiters make for a malformed String literal.
Go go abusive reflection.
@@ -84,12 +84,12 @@ import gherkin.I18n

def _ = File.separator
def engine = new SimpleTemplateEngine()
def templateSource = new File("${basedir}${_}src${_}main${_}code_generator${_}I18n.groovy.txt").getText()
def templateSource = new File(/${basedir}${_}src${_}main${_}code_generator${_}I18n.groovy.txt/).getText()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must be some Groovy syntax I'm unfamiliar with. Can you explain?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Groovy User Guide calls it "Slashy String literals". It makes '/' the only escape sequence recognized inside the literal making it safe for interpolating Windows file names and since the antrun plugin doesn't sanitize ${baseDir} it's the only option for making it work cleanly under Windows. I haven't had a chance to check it under Linux so I isolated those changes so people can cherry pick around them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dwskoog hmm, I get errors on OS X with those changes. If you pop into #cucumber on irc.freenode.net we can discuss it.

@aslakhellesoy aslakhellesoy mentioned this pull request Jan 21, 2012
@aslakhellesoy aslakhellesoy merged commit 246e8d5 into cucumber:master Jan 21, 2012
@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants