scarpe-team / scarpe

Scarpe - shoes but running on webview

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix unexpected non-style keyword args

noahgibbs opened this issue · comments

If you run "bundle exec rake test" right now you'll see a lot of messages like these:

Unexpected non-style keyword(s) in Shoes::Para initialize: [:align]

Each of them is a case where we're passing a keyword arg through to Drawable#initialize that it doesn't recognize. That could be a problem in initialize (Stack, Flow) or where we don't properly implement a property (align).

There's already a PR that implements Para style align (#472).

Added a PR for :top, :width and :height on all drawables (#485).

Here are the keyword arguments I see with problems, with duplicates removed and out of order:

Unexpected non-style keyword(s) in Shoes::Para initialize: [:top, :align, :margin]
Unexpected non-style keyword(s) in Shoes::Para initialize: [:margin_bottom]

Unexpected non-style keyword(s) in Shoes::Stack initialize: [:border]

Unexpected non-style keyword(s) in Shoes::Span initialize: [:fill]

Unexpected non-style keyword(s) in Shoes::Oval initialize: [:fill]

# MenuPanel is a Shoes::Widget -- need to figure out how Widgets should work
Unexpected non-style keyword(s) in MenuPanel initialize: [:width, :height]

So in each of those cases, we need to implement the property or figure out how it gets passed through (or whether it should.) We also need to make sure we're properly using init_args (now-current arg passing) for Stack, Flow and DocumentRoot.

Once all this is done, we can make unexpected keyword properties an error rather than a console print, which would be a very good thing.