Tuesday, 15 July 2014

How Do I Transfer Command Line Arguments Into A RubyMotion Application? -



How Do I Transfer Command Line Arguments Into A RubyMotion Application? -

i want rubymotion application able access command line arguments when calling ios simulator.

rake foo=bar

how can this?

the easiest way utilize motion-envgem (https://github.com/clayallsopp/motion-env)

#gemfile gem "motion-env"

now phone call bundler install.

then alter rake file read parameters , set them on app object

#rakefile motion::project::app.setup |app| app.name = 'my cool app' app.env['foo'] = env['foo'] end

finally access variable in application

class appdelegate def application(application, didfinishlaunchingwithoptions: options) puts "environment=#{env['foo']}" end end

rubymotion

No comments:

Post a Comment