bazaarvoice / cloudformation-ruby-dsl

Ruby DSL for creating Cloudformation templates
Apache License 2.0
210 stars 76 forks source link

Make all methods public (remove 'private') #112

Closed scarybot closed 7 years ago

scarybot commented 7 years ago

Hi,

We're using this in a fairly complex larger system which needs to make use of some of these methods (particularly import_value()) outside of the regular DSLTemplate scope. This is necessary so that objects including intrinsic functions can be prepared in a modular style and compiled together to create a main template, as passing a JSON block to a DSLTemplate method seems to always result in it being converted into a string, so it's impossible to simply pass the JSON equivalent of the dsl helper function (such as import_value()) without using these (currently private) methods. Hope this is okay.

jonaf commented 7 years ago

Hm, I think this workaround may be satisfactory for your use-case, but I think the library probably needs to be refactored with for this use-case. I don't think we want to blanket expose all of these methods without further thought. See #57

@temujin9 opinions?

temujin9 commented 7 years ago

@jonaf Looking through, most of them are fairly harmless and context-free. There's really only one function on the DSL class that depends on self, and it's already public (exec!). I see no danger in opening up the rest.

@scarybot I would ask that _get_parameter_from_cli remain private, since it's really just a helper function for parameter.

temujin9 commented 7 years ago

Erm . . . correction. _get_parameter_from_cli is the only private function displayed. The rest are already public.