derailed / motion-awesome

As if more awesomeness was needed
41 stars 14 forks source link

Removes MotionMap dependency #11

Open mgartner opened 10 years ago

mgartner commented 10 years ago

There are two motivations for this change. The first is that the MotionMap requirement seems to sometimes create dependency issues for users (though I believe that has been fixed in the most recent version).

The second reason is that instantiating a MotionMap::Map is over an order-of-magnitude slower than instantiating a simple hash. This inefficiency led me to override some of the methods of this gem in my own project. For the mild benefit of the helper methods that MotionMap provides, I don't think it significantly improves the code cleanliness enough to warrant the decrease in performance from using a regular hash. Actually, I'd argue that using a hash is more readable, especially for someone with no experience with MotionMap.

I also cleaned up some whitespace in the tests and fixed ones that were broken. I couldn't get the tests or sample app to run without also updating motion-cocoapods, but if you think this gem update shouldn't have been necessary, let me know.