Closed smirninini closed 2 years ago
Hi, I'll try to look at this as soon as possible.
Thanks for reporting, config_scaffolder
generates broken code, I've fixed it but I'm still fighting with some failing scenarios.
v0.2.4
is released
Is it possible load result of snippet to obfuscator like this?
I think as Snippet
is a custom Crystal Object, I'd say it's not possible as it's not a JSON / YAML.
@Pavlentio did last release solve one of your issues?
@josacar plan to take a look this week. I believe you do your best 🙏 and everything ok.
I have the same question as I'm trying to create more or less automated solution... Unfortunately I have no Crystal experience and last time I see Ruby code was over 10 years ago :(
My guess that the file snippet
should contain Snippet var declaration besides the bare scaffolded structure:
Snippet = { # Added
"table_name" => {
"column1_name" => :keep # scaffold
"column2_name" => :keep # scaffold
...
} # Added
@VicDeo can you try https://github.com/josacar/triki/tree/obfuscator-as-a-constant branch?
It should produce something similar as:
SCAFFOLD = {
"city" => {
"ID" => :keep, # scaffold
"Name" => :keep, # scaffold
"CountryCode" => :keep, # scaffold
"District" => :keep, # scaffold
"Population" => :keep, # scaffold
},
"country" => {
"Code" => :keep, # scaffold
"Name" => :keep, # scaffold
"Continent" => :keep, # scaffold
"Region" => :keep, # scaffold
"SurfaceArea" => :keep, # scaffold
"IndepYear" => :keep, # scaffold
"Population" => :keep, # scaffold
"LifeExpectancy" => :keep, # scaffold
"GNP" => :keep, # scaffold
"GNPOld" => :keep, # scaffold
"LocalName" => :keep, # scaffold
"GovernmentForm" => :keep, # scaffold
"HeadOfState" => :keep, # scaffold
"Capital" => :keep, # scaffold
"Code2" => :keep, # scaffold
},
"countrylanguage" => {
"CountryCode" => :keep, # scaffold
"Language" => :keep, # scaffold
"IsOfficial" => :keep, # scaffold
"Percentage" => :keep, # scaffold
}
}
obfuscator_scaffold_snippet.cr
Readme says The output will be a series of configuration statements of the form:
obfuscator.cr