Skip to content

Instantly share code, notes, and snippets.

@wprater
Last active August 29, 2015 14:01
Show Gist options
  • Save wprater/1d2235dc95a3200fe95d to your computer and use it in GitHub Desktop.
Save wprater/1d2235dc95a3200fe95d to your computer and use it in GitHub Desktop.
Build RubyMotion for an adhoc environment.
class MyApp
class << self
def app_store?
RUBYMOTION_ENV == 'release'
end
def development?
RUBYMOTION_ENV == 'development'
end
def release?
!development?
end
# Set ENV to ADHOC when building
# ADHOC=1 rake
def adhoc?
NSBundle.mainBundle.objectForInfoDictionaryKey('ADHOC')
end
end
end
# -*- coding: utf-8 -*-
$:.unshift('/Library/RubyMotion/lib')
require 'motion/project/template/ios'
begin
require 'bundler'
Bundler.require
rescue LoadError
end
Motion::Project::App.setup do |app|
unless ENV['ADHOC'].nil?
is_adhoc = ENV['ADHOC'] == '1' || (ENV['ADHOC'] =~ /true/i) == 0
app.info_plist['ADHOC'] = is_adhoc
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment