Set ENV_VARS hash which is available in RubyMotion app.
You can set variables from yaml file or hash in Rakefile.
Add this line to your application's Gemfile:
gem 'motion-env-vars'
And then execute:
$ bundle
Or install it yourself as:
$ gem install motion-env-vars
in you Rakefile
Motion::Project::App.setup do |app|
...
app.env_vars = './config/environment.yaml'
...
end
in config/environment.yaml
consumer_key: xxx
consumer_secret: XXX
in app code after build, motion-env-vars define ENV_VARS constant variable as Hash.
p ENV_VARS #=> { 'consumer_key' => 'xxx', 'consumer_secret' => 'XXX' }
Motion::Project::App.setup do |app|
...
app.env_vars = { 'consumer_key' => 'xxx', 'consumer_secret' => 'XXX' }
...
end
You can also use shell ENV
app.env_vars = ENV.to_hash
Or selectively
app.env_vars = { 'CUSTOMER_KEY' => ENV['CUSTOMER_KEY'], 'CUSTOMER_SECRET' => ENV['CUSTOMER_SECRET'] }
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request