diff --git a/config/production_environment.rb b/config/production_environment.rb new file mode 100644 index 0000000..6f29057 --- /dev/null +++ b/config/production_environment.rb @@ -0,0 +1,14 @@ +ROOT_PATH = File.expand_path(File.dirname(__FILE__) + "/../") + +# Setup our load path: +[ + 'lib', + 'vendor/gems/polyglot-0.2.5/lib/', + 'vendor/gems/treetop-1.2.5/lib/', +].each do |dir| + $LOAD_PATH.unshift(File.join(ROOT_PATH, dir)) +end + +require 'rubygems' +require 'treetop' + diff --git a/config/environment.rb b/config/test_environment.rb similarity index 100% rename from config/environment.rb rename to config/test_environment.rb diff --git a/lib/cmock.rb b/lib/cmock.rb index b29315f..1991681 100644 --- a/lib/cmock.rb +++ b/lib/cmock.rb @@ -1,17 +1,15 @@ -$here = File.dirname __FILE__ +require File.expand_path(File.dirname(__FILE__)) + "/../config/production_environment" -require 'rubygems' -require 'treetop' +require "cmock_function_prototype_node_classes" +require "cmock_function_prototype_parser" +require "cmock_header_parser" +require "cmock_generator" +require "cmock_file_writer" +require "cmock_config" +require "cmock_plugin_manager" +require "cmock_generator_utils" +require "cmock_unityhelper_parser" -require "#{$here}/cmock_function_prototype_node_classes" -require "#{$here}/cmock_function_prototype_parser" -require "#{$here}/cmock_header_parser" -require "#{$here}/cmock_generator" -require "#{$here}/cmock_file_writer" -require "#{$here}/cmock_config" -require "#{$here}/cmock_plugin_manager" -require "#{$here}/cmock_generator_utils" -require "#{$here}/cmock_unityhelper_parser" class CMock diff --git a/lib/cmock_plugin_manager.rb b/lib/cmock_plugin_manager.rb index 7a0c7f3..6f44f0b 100644 --- a/lib/cmock_plugin_manager.rb +++ b/lib/cmock_plugin_manager.rb @@ -1,7 +1,7 @@ -require "#{$here}/cmock_generator_plugin_expect.rb" -require "#{$here}/cmock_generator_plugin_ignore.rb" -require "#{$here}/cmock_generator_plugin_cexception.rb" +require "cmock_generator_plugin_expect.rb" +require "cmock_generator_plugin_ignore.rb" +require "cmock_generator_plugin_cexception.rb" class CMockPluginManager diff --git a/rakefile.rb b/rakefile.rb index 95fbd41..8c9f7c6 100644 --- a/rakefile.rb +++ b/rakefile.rb @@ -1,6 +1,6 @@ HERE = File.expand_path(File.dirname(__FILE__)) + '/' -require HERE + 'config/environment' +require HERE + 'config/test_environment' require 'rake' require 'rake/clean' require 'rake/testtask' diff --git a/test/test_helper.rb b/test/test_helper.rb index 5de1961..907ec5e 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,4 +1,4 @@ -require File.expand_path(File.dirname(__FILE__)) + "/../config/environment" +require File.expand_path(File.dirname(__FILE__)) + "/../config/test_environment" require 'test/unit' require 'behaviors' require 'hardmock'