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

improve extension development by using some DSL features #23

Closed
jdwije opened this issue Sep 7, 2014 · 1 comment
Closed

improve extension development by using some DSL features #23

jdwije opened this issue Sep 7, 2014 · 1 comment

Comments

@jdwije
Copy link
Owner

jdwije commented Sep 7, 2014

The extension API could be streamlined and thought out more. It doesn't have to be perfect but this might be a good opportunity to try out the DSL features of ruby.

Whilst I'm not in favour of the instance_eval() which yields a block like API akin to:

Class::new do |c|
  c.title = "xxx"
  c.desciption = File.open("xx.txt")
end

I do like the idea of modifying the core ruby syntax to be a bit more Lewt Extension tailored within the context of a LEWT Extension. For example the options & the command could be set like this:

MyExt < LewtExtension
  options ++ :param { 
                :default => false, 
                :definitions => "what this option is about",
                :type => String
                }
  command :my_command
end
@jdwije
Copy link
Owner Author

jdwije commented Sep 17, 2014

bugger it

@jdwije jdwije closed this as completed Sep 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant