mini_racer/mini_racer.gemspec

41 lines
1.6 KiB
Ruby
Raw Normal View History

2016-05-04 06:54:51 +00:00
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'mini_racer/version'
Gem::Specification.new do |spec|
spec.name = "mini_racer"
spec.version = MiniRacer::VERSION
spec.authors = ["Sam Saffron"]
spec.email = ["sam.saffron@gmail.com"]
spec.summary = %q{Minimal embedded v8 for Ruby}
spec.description = %q{Minimal embedded v8 engine for Ruby}
spec.homepage = "https://github.com/discourse/mini_racer"
2016-05-04 06:54:51 +00:00
spec.license = "MIT"
spec.metadata = {
"bug_tracker_uri" => "https://github.com/discourse/mini_racer/issues",
"changelog_uri" => "https://github.com/discourse/mini_racer/blob/v#{spec.version}/CHANGELOG",
"documentation_uri" => "https://www.rubydoc.info/gems/mini_racer/#{spec.version}",
"source_code_uri" => "https://github.com/discourse/mini_racer/tree/v#{spec.version}",
}
2016-05-04 06:54:51 +00:00
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(benchmark|test|spec|features|examples)/}) }
2016-05-04 06:54:51 +00:00
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
2016-05-14 01:26:03 +00:00
spec.add_development_dependency "bundler", "~> 1.12"
2016-05-04 06:54:51 +00:00
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "minitest", "~> 5.0"
spec.add_development_dependency "rake-compiler"
Introduce compatibility with V8 7.3 (#138) * Mechanical removal of use of non-maybe String::ToObject() Due to the non-maybe version of String::ToObject() being deprecated and altogether removed from V8 [1] it is necessary to migrate to using the maybe version. This commit is a mechanical change that uses the context at hand when calling String::ToObject() to pass it to it. The resulting MaybeLocal is then unwrapped with MaybeLocal::ToLocalChecked() as I consider the verifications performed on the String instances to be sufficient to ensure no crashes. [1] https://chromium-review.googlesource.com/c/v8/v8/+/1172350/ https://chromium.googlesource.com/v8/v8/+/c8376b0069ebe16c67acf90c3cda3457ddccba4f * Mechanical removal of use of non-maybe Local<T>::ToString() Due to the non-maybe version of Local<T>::ToString() being deprecated and altogether removed from V8 [1] it is necessary to migrate to using the maybe version. This commit is a mechanical change that uses the context at hand when calling Local<T>::ToString() to pass it to it. The resulting MaybeLocal is then unwrapped with MaybeLocal::ToLocalChecked() as I consider the context of the uses to be sufficiently safe. [1] https://chromium-review.googlesource.com/c/v8/v8/+/1172350/ https://chromium.googlesource.com/v8/v8/+/c8376b0069ebe16c67acf90c3cda3457ddccba4f * Mechanical removal of the use of non-maybe Value::Int32Value() and NumberValue() Due to the non-maybe version of Value::Int32Value() and Value::NumberValue() being deprecated and altogether removed from V8 [1] it is necessary to migrate to using the maybe versions. This commit is a mechanical change that uses the context at hand when calling Value::Int32Value() or Value::NumberValue() to pass it to the respective function. The resulting Maybe is then unwrapped with Maybe::ToChecked() as I consider the verifications performed on the Value instances to be sufficient to ensure no crashes. [1] https://chromium-review.googlesource.com/c/v8/v8/+/1172350/ https://chromium.googlesource.com/v8/v8/+/c8376b0069ebe16c67acf90c3cda3457ddccba4f * Mechanical removal of use of String::Utf8Length() without isolate Due to the version of String::Utf8Length() with no paramters being deprecated and altogether removed from V8 [1] it is necessary to migrate to using the version that accepts isolate as a parameter. This commit is a mechanical change that uses the isolate available in the context where String::Utf8Length() is called. This is a breaking change imposing use of V8 6.9.411 or up. [1] https://chromium-review.googlesource.com/c/v8/v8/+/1124724/ https://chromium.googlesource.com/v8/v8/+/3dd5c6fe38355b8323597341409b37f931de5a85 * Remove the uses of deprecated snapshot-related functions Due to V8::CreateSnapshotDataBlob() and V8::WarmUpSnapshotDataBlob() being deprecated and altogether removed from V8 [1] it is necessary to migrate to using local implementations of them. This commit introduces create_snapshot_data_blob(), warm_up_snapshot_data_blob() and the helper function run_extra_code(). Their implementations have been copied over from [2]. [1] https://github.com/v8/v8/commit/b3738e658345adabaa958b9f9a94ca01fc87d5e4 https://chromium-review.googlesource.com/c/v8/v8/+/1019442/ [2] https://github.com/v8/v8/blob/7.3.492.27/test/cctest/test-serialize.cc https://chromium.googlesource.com/v8/v8.git/+/30602560a8fdb0bbfb50d70be867f32b72758a2f/test/cctest/test-serialize.cc * Non-trivial removal of uses of non-maybe Date::New() Due to the non-maybe version of Date::New() being deprecated and altogether removed from V8 [1] it is necessary to migrate to using the maybe version. This commit introduces a context argument to the convert_ruby_to_v8() function so it can be passed to the maybe version of Date::New(). This imposed changes throughout the code base so that the context can be passed together with the isolate to convert_ruby_to_v8(). [1] https://chromium-review.googlesource.com/c/v8/v8/+/1357056 https://github.com/v8/v8/commit/e84b92d7658dee79c34304a67c4fb84c93cd071b * Non-trivial removal of use of non-maybe Local<T>::ToString() This commit builds upon fe62f7935582bd889742ec77ee2289a8f6cb16e6. The use of Local<T>::ToString() in convert_result_to_ruby() did not have an immediately available context to use. This commit unwraps the context from p_ctx and passes it to the function and then unwraps the MaybeLocal result with MaybeLocal::ToLocalChecked() assuming the verification beforehand is sufficient to ensure there won't be any crashes. * Update the changelog * Replace placeholder in LICENSE.txt
2019-04-24 23:39:56 +00:00
spec.add_dependency 'libv8', '>= 6.9.411'
2016-05-04 06:54:51 +00:00
spec.require_paths = ["lib", "ext"]
spec.extensions = ["ext/mini_racer_extension/extconf.rb"]
spec.required_ruby_version = '>= 2.3'
2016-05-04 06:54:51 +00:00
end