-
Notifications
You must be signed in to change notification settings - Fork 77
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
config as YAML #90
Comments
Hi @chb0github , YAML might be nice, but not nice enough to complicate the implementation, but this is my personal opinion.
The language name is declared by each implementation and Migrations just calls ScriptEngineManager#getEngineByName(). |
As I read into the spec I realized exactly how this is implemented: Just taken the name given and ask the factory for the script engine with that name: Try this: public class A {
public static void main( String[] args ) {
ScriptEngineManager mgr = new ScriptEngineManager();
List<ScriptEngineFactory> factories = mgr.getEngineFactories();
for (ScriptEngineFactory factory : factories) {
System.out.println("ScriptEngineFactory Info");
String engName = factory.getEngineName();
String engVersion = factory.getEngineVersion();
String langName = factory.getLanguageName();
String langVersion = factory.getLanguageVersion();
System.out.printf("\tScript Engine: %s (%s)%n", engName, engVersion);
List<String> engNames = factory.getNames();
for(String name : engNames) {
System.out.printf("\tEngine Alias: %s%n", name);
}
System.out.printf("\tLanguage: %s (%s)%n", langName, langVersion);
}
}
} Gives you this:
Any of those Aliases would work. The documentation is a bit incomplete - So, I guess then my only ask would be to update the docs a bit to make clear it's the the Engine alias (you can even paste the above code so people can interrogate their system if trying to use other scripts) |
The question to ask yourself about a feature request: Is it about having pretty code or a bad-ass app? I mean, I am evaluating the app, not the code. I am probably submit a PR for the job if it's gonna make it in |
@chb0github I've been considering allowing configurations to be handled differently for a while, including allowing overrides (would be great for different environments that mostly share the same values) and allowing different configuration syntax so a PR would definitely be interesting. As with any PR, we can't guarantee that it would make it in but at least it opens the discussion. |
Is Java 8 allowed? |
Hooks seem like a really cool and powerful feature. But the config syntax is a bit messy:
hook_after_down=JavaScript:printvar.js:when=after:what=down
would be much more inuitive as YAML:
Also, declaring
JavaScript
is redundant if you go by convention:.js
or Groovy as.groovy
The text was updated successfully, but these errors were encountered: