infinitered / rmq

RMQ - RubyMotionQuery
MIT License
307 stars 52 forks source link

live reloading adding colors #271

Open markrickert opened 9 years ago

markrickert commented 9 years ago

I was using live reloading and wanted to add a color to the application in the code block:

class ApplicationStylesheet < RubyMotionQuery::Stylesheet
  def application_setup
    color.add_named :warning,             '#E32935'
  end
end

I added the color, saved the file, and then went to use it in a stylesheet (all while still in live mode).

Got this error when saving:

=> "Live reloading of RMQ stylesheets is now on."
(main)> 2015-06-01 21:17:20.137 Ribos Dev[29713:8246577] stylesheet.rb:190:in `apply_style_to_view:': undefined method `warning' for RubyMotionQuery::Color:Class (NoMethodError)
    from stylesheet.rb:100:in `block in reapply_styles'
    from stylesheet.rb:99:in `reapply_styles'
2015-06-01 21:17:20.165 Ribos Dev[29713:8246577] *** Terminating app due to uncaught exception 'NoMethodError', reason: 'stylesheet.rb:190:in `apply_style_to_view:': undefined method `warning' for RubyMotionQuery::Color:Class (NoMethodError)
    from stylesheet.rb:100:in `block in reapply_styles'
    from stylesheet.rb:99:in `reapply_styles'

Is the application setup part of the application stylesheet not reloaded when in live mode?

squidpunch commented 9 years ago

that would make sense, application setup is configured to specifically only run once. I wonder if we need to wire that up to fire again in the live stylesheets or something..

twerth commented 9 years ago

Live reloading doesn't currently work with application setup stuff. Marking as enhancement.

twerth commented 9 years ago

Application setup doesn't get reloaded with live. Marking as enhancement.