HipByte / Flow

Cross-platform libraries for RubyMotion
BSD 2-Clause "Simplified" License
141 stars 29 forks source link

Add methods to UI::Application to return app build number and version number #58

Open hboon opened 7 years ago

hboon commented 7 years ago

(main)> UI::Application.instance.build_number => "27" (main)> UI::Application.instance.version_number => "1.0.0"

Watson1978 commented 7 years ago

I like version_string instead of version_number because version_number returns String object.

hboon commented 7 years ago

What about build_number? It is a String on iOS, but Fixnum in Android.

jjaffeux commented 7 years ago

@hboon I feel it weird to have this under the UI namespace, how is this related to UI?

andrewhavens commented 7 years ago

I think build_number and version_number are fine. I think most people think of "version number" as something like 1.0.0, not as a literal integer or float. The fact that it is represented as a string is secondary. I don't think version_string is as obvious or necessary.

Watson1978 commented 7 years ago

What about build_number? It is a String on iOS, but Fixnum in Android.

@hboon it may not be a problem, because CFBundleShortVersionString allow only numbers. However, I think that it is necessary to clarify it in the document that these methods return string.

hboon commented 7 years ago

@jjaffeux I thought of that yesterday too. It is a little out of place. I added it there originally because I'd only used UI Flow at the moment and it has a UI:Application class. Any suggestion for a better place? The other "modules" don't seem suitable either.