diff --git a/lib/motion/project/config.rb b/lib/motion/project/config.rb index 6db139b2..581e314f 100644 --- a/lib/motion/project/config.rb +++ b/lib/motion/project/config.rb @@ -313,5 +313,13 @@ EOS path end end + + def rubymotion_env_value + if spec_mode + 'test' + else + development? ? 'development' : 'release' + end + end end end; end diff --git a/lib/motion/project/template/android.rb b/lib/motion/project/template/android.rb index 8bbf7e0b..b6062e68 100644 --- a/lib/motion/project/template/android.rb +++ b/lib/motion/project/template/android.rb @@ -77,7 +77,7 @@ EOS end payload_c_txt << <PushLocalFrame(env, 32);\n" diff --git a/lib/motion/project/xcode_config.rb b/lib/motion/project/xcode_config.rb index a47c1ccc..d44482d3 100644 --- a/lib/motion/project/xcode_config.rb +++ b/lib/motion/project/xcode_config.rb @@ -411,13 +411,7 @@ EOS end def define_global_env_txt - rubymotion_env = - if spec_mode - 'test' - else - development? ? 'development' : 'release' - end - "rb_define_global_const(\"RUBYMOTION_ENV\", @\"#{rubymotion_env}\");\nrb_define_global_const(\"RUBYMOTION_VERSION\", @\"#{Motion::Version}\");\n" + "rb_define_global_const(\"RUBYMOTION_ENV\", @\"#{rubymotion_env_value}\");\nrb_define_global_const(\"RUBYMOTION_VERSION\", @\"#{Motion::Version}\");\n" end def spritekit_texture_atlas_compiler