infinitered/rmq — pull request #112 by mwise (2014-09-15 04:09:16+00:00)
Title: modified app_width and app_height in stylesheet.rb to work for iOS 8

Ok, so this is the quick stylesheet.rb hack that I mentioned in https://github.com/infinitered/rmq/issues/110

I tried to make the smallest change possible, so I didn't modify app_size and put the conditional check for iOS 8 (via UIScreen#coordinateSpace) in the app_width and app_height methods. I'm quite sure there are several other places where the iOS bounds calculation change will have an impact. This was more a conversation-starter than a full iOS 8 compatibility patch (obviously!) or even a ready-to-merge change.

The specs use rotate_device and are kind of a disaster. More specifically:
* using rotate_device seems to have some nasty side-effects when run (against iOS 7, at least), like complaints about style tags not being available in the InspectorStylesheet. I believe this has to do with rotate_device only being available after you use the 'tests' method to enable controller/view testing - it seems like the RubyMotion team assumes you'll be returning early from application(application, didFinishLaunchingWithOptions) in the test environment, but it looks like the RMQ suite actually tests against the app
* rotate_device is slow, so I've lumped the various orientations into a single method. Note the trailing `rotate_device to: :portrait` - without it, some of the width/height based specs throughout the suite fail.
* the actual rotation stuff probably belongs in the device.rb spec, and I noticed that the `portrait?` and `landscape?` specs are pending over there. Perhaps you'd noticed some of this stuff before, and (probably wisely) sidestepped it via the empty specs? If a stubbing framework were available, I would probably vote for testing those methods over there and stubbing them in the stylesheet.rb spec to test the iOS 7 width/height inversion logic.

So, yeah. You asked for a PR, and you got it! I hope the above is helpful. Please let me know if you have any thoughts or advice or would like me to run things down in a particular way. RMQ rocks - I'd be happy to help however I can.

Cheers,
Mark