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

[#360] Add include support for Ruby DSL #950

Merged
merged 2 commits into from
Jun 16, 2016

Conversation

llby
Copy link
Contributor

@llby llby commented May 15, 2016

This PR add include support for Ruby DSL.
And Fix bug parser include at the Windows.
Like this conditions

  • First conf include absolute path
  • Second(child) conf include relative path

Because URI.parse return u.scheme = c.
When Windows absolute path is C:/projects/fluentd/test/tmp/config.
Then used open-uri and basepath change /.

But after merge this PR.
There is a bug.
When It has some drives In the Windows.
Like a C: and D:
And upper case.
I think it is rare case.
If you need fix this bug.
Please make issue.

if args.first =~ /\.rb$/
path = File.expand_path(args.first)
data = File.read(path)
self.instance_eval(data, @proxy.include_basepath)
Copy link
Member

Choose a reason for hiding this comment

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

The 2nd argument of instance_eval should be the filename (path), not base path.

@tagomoris
Copy link
Member

Almost looks good to me.

@llby
Copy link
Contributor Author

llby commented Jun 15, 2016

@tagomoris
Thank you your review
I got the instance_eval 2nd args

and ... dsl code is cool!!

why test is failed??

@tagomoris tagomoris closed this Jun 15, 2016
@tagomoris tagomoris reopened this Jun 15, 2016
@tagomoris tagomoris merged commit 6c02f88 into fluent:master Jun 16, 2016
@tagomoris
Copy link
Member

Merged. Thank you for contribution!

@tagomoris
Copy link
Member

This patch disables (overwrites) Kernel.include, but I think there are no users who wants to use mixin in configuration.

repeatedly pushed a commit that referenced this pull request Jun 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants