From dd791fe4079176e9fdc4b7a53e681040a716fc13 Mon Sep 17 00:00:00 2001 From: Mark VanderVoord Date: Mon, 20 Mar 2017 16:18:09 -0400 Subject: [PATCH] =?UTF-8?q?Remove=20support=20for=20versions=20of=20Ruby?= =?UTF-8?q?=20before=202.0=20(as=20Rubylang=20doesn=E2=80=99t=20even=20sup?= =?UTF-8?q?port=20them=20anymore)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/cmock.rb | 3 --- lib/cmock_header_parser.rb | 2 +- test/test_helper.rb | 12 ++++-------- test/unit/cmock_header_parser_test.rb | 1 - test/unit/cmock_plugin_manager_test.rb | 8 ++------ vendor/c_exception | 2 +- vendor/unity | 2 +- 7 files changed, 9 insertions(+), 21 deletions(-) diff --git a/lib/cmock.rb b/lib/cmock.rb index b6ee7a9..8243ce5 100644 --- a/lib/cmock.rb +++ b/lib/cmock.rb @@ -13,9 +13,6 @@ "cmock_generator_utils", "cmock_unityhelper_parser"].each {|req| require "#{File.expand_path(File.dirname(__FILE__))}/#{req}"} - -$QUICK_RUBY_VERSION = RUBY_VERSION.split('.').inject(0){|vv,v| vv * 100 + v.to_i } - class CMock def initialize(options=nil) diff --git a/lib/cmock_header_parser.rb b/lib/cmock_header_parser.rb index b37419c..dc60a44 100644 --- a/lib/cmock_header_parser.rb +++ b/lib/cmock_header_parser.rb @@ -48,7 +48,7 @@ class CMockHeaderParser def import_source(source) # let's clean up the encoding in case they've done anything weird with the characters we might find - source = source.force_encoding("ISO-8859-1").encode("utf-8", :replace => nil) if ($QUICK_RUBY_VERSION > 10900) + source = source.force_encoding("ISO-8859-1").encode("utf-8", :replace => nil) # void must be void for cmock _ExpectAndReturn calls to process properly, not some weird typedef which equates to void # to a certain extent, this action assumes we're chewing on pre-processed header files, otherwise we'll most likely just get stuff from @treat_as_void diff --git a/test/test_helper.rb b/test/test_helper.rb index 8df9b5c..9bbe3b0 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -15,14 +15,10 @@ end def create_stub(funcs) stub = Class.new - #if (RUBY_VERSION.split('.')[0].to_i >= 2) - # funcs.each_pair {|k,v| stub.define_singleton_method(k) {|*unused| return v } } - #else - blob = "class << stub\n" - funcs.each_pair {|k,v| blob += "def #{k.to_s}(unused=nil)\n #{v.inspect}\nend\n" } - blob += "end" - eval blob - #end + blob = "class << stub\n" + funcs.each_pair {|k,v| blob += "def #{k.to_s}(unused=nil)\n #{v.inspect}\nend\n" } + blob += "end" + eval blob stub end diff --git a/test/unit/cmock_header_parser_test.rb b/test/unit/cmock_header_parser_test.rb index 22b2ac5..692741d 100644 --- a/test/unit/cmock_header_parser_test.rb +++ b/test/unit/cmock_header_parser_test.rb @@ -5,7 +5,6 @@ # ========================================== $ThisIsOnlyATest = true -$QUICK_RUBY_VERSION = RUBY_VERSION.split('.').inject(0){|vv,v| vv * 100 + v.to_i } require File.expand_path(File.dirname(__FILE__)) + "/../test_helper" require 'cmock_header_parser' diff --git a/test/unit/cmock_plugin_manager_test.rb b/test/unit/cmock_plugin_manager_test.rb index a079f1d..3619a82 100644 --- a/test/unit/cmock_plugin_manager_test.rb +++ b/test/unit/cmock_plugin_manager_test.rb @@ -21,12 +21,8 @@ describe CMockPluginManager, "Verify CMockPluginManager Module" do :ignore => :args_and_calls ) - #if (RUBY_VERSION.split('.')[0].to_i >= 2) - # @config.define_singleton_method( :plugins ){ @plugins || [] } - # @config.define_singleton_method( :plugins= ){ |val| @plugins = val } - #else - eval "class << @config\ndef plugins\n@plugins||[]\nend\ndef plugins=(val)\n@plugins=val\nend\nend\n" - #end + eval "class << @config\ndef plugins\n@plugins||[]\nend\ndef plugins=(val)\n@plugins=val\nend\nend\n" + end after do diff --git a/vendor/c_exception b/vendor/c_exception index 03e48c5..b841448 160000 --- a/vendor/c_exception +++ b/vendor/c_exception @@ -1 +1 @@ -Subproject commit 03e48c5033e8902a07e338b02a84b62c1577ce27 +Subproject commit b84144889952feff4cda35bad00ebf5fc63e1872 diff --git a/vendor/unity b/vendor/unity index c67a4ff..c3658a0 160000 --- a/vendor/unity +++ b/vendor/unity @@ -1 +1 @@ -Subproject commit c67a4ffcf399a048040c34080358f17a65934200 +Subproject commit c3658a065de1b9bce53652a80c5904c990b65099