mirror of
https://github.com/ThrowTheSwitch/CMock
synced 2025-05-19 02:09:33 -04:00
Remove support for versions of Ruby before 2.0 (as Rubylang doesn’t even support them anymore)
This commit is contained in:
parent
06b9f23054
commit
dd791fe407
@ -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
|
||||
|
@ -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
|
||||
|
2
vendor/c_exception
vendored
2
vendor/c_exception
vendored
@ -1 +1 @@
|
||||
Subproject commit 03e48c5033e8902a07e338b02a84b62c1577ce27
|
||||
Subproject commit b84144889952feff4cda35bad00ebf5fc63e1872
|
2
vendor/unity
vendored
2
vendor/unity
vendored
@ -1 +1 @@
|
||||
Subproject commit c67a4ffcf399a048040c34080358f17a65934200
|
||||
Subproject commit c3658a065de1b9bce53652a80c5904c990b65099
|
Loading…
x
Reference in New Issue
Block a user