mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-06-06 05:25:29 +00:00
Remove support for versions of Ruby before 2.0 (as Rubylang doesn’t even support them anymore)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
+4
-8
@@ -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
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
Vendored
+1
-1
Submodule vendor/c_exception updated: 03e48c5033...b841448899
Vendored
+1
-1
Submodule vendor/unity updated: c67a4ffcf3...c3658a065d
Reference in New Issue
Block a user