mini_racer 0.1.14 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 53d1807f65d860a1321d3a7f67a619ac19eb85b2
4
- data.tar.gz: b2cd4481d6f6e83bd53d197b5e59d9725d2b2e89
2
+ SHA256:
3
+ metadata.gz: b2bb1ce568e44bcf3f6fcc469942ee12bd418cb21faaedbf1ed60a1b89e4ee47
4
+ data.tar.gz: 4a38af517388189628e22c7f9bf6b8129489847ff1b4d79b741e248b0f88fc6d
5
5
  SHA512:
6
- metadata.gz: 4f8da52c573d97113036a15c754bf633aad04f45d5cf5ca5273e9be032ca0048c39fbddf0bc8065514364c5517e2d39c0a78dc8dc9289b24eb8bd6b4027b471a
7
- data.tar.gz: 83c98e5c6b95a439be8b33048991b83c7d9cbc4f00b6102a04b37318fdb22ab97582289f1ef4c518340250d2325d584a045f6a70c1de2616bfc8532535ee7f70
6
+ metadata.gz: 9e8f42aad8b92fc27e9d430edea330fd583743ea7c81c6bbb5097de797af02b2905b87006798559e61e95ab2a0a9fb667e4d0758a3021876c81be138bc890e3d
7
+ data.tar.gz: 5e17012b06081f0b3f303f549908c348bed54ef9151069c1a6efcfb778708fde80fe2108a6f5f9f9908a9aec52449ad65a85fd2f0ae49892d89dfba59cc568c2
data/.travis.yml CHANGED
@@ -1,19 +1,23 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1
4
- - 2.2
5
- - 2.3.3
6
- - 2.4.0
3
+ - 2.3
4
+ - 2.4
5
+ - 2.5
6
+ - ruby-head
7
7
  matrix:
8
8
  include:
9
+ - rvm: 2.5.1
10
+ os: osx
11
+ osx_image: xcode9.4
9
12
  - rvm: 2.4.0
10
13
  os: osx
11
- osx_image: xcode8.2
14
+ osx_image: xcode8.3
12
15
  - rvm: 2.4.0
13
16
  os: osx
14
17
  osx_image: xcode7.3
15
18
  dist: trusty
16
19
  sudo: true
17
20
  before_install:
18
- - gem install bundler -v 1.12.0
21
+ - gem update --system
22
+ - gem install bundler -v 1.16.2
19
23
  cache: bundler
data/CHANGELOG CHANGED
@@ -1,3 +1,19 @@
1
+ - 06-07-2018
2
+
3
+ - 0.2.0
4
+ - FEATURE: context#call to allow for cheaper invocation of functions
5
+ - FIX: rare memory leak when terminating a long running attached function
6
+ - FIX: rare segfault when terminating a long running attached function
7
+ - FIX: Reimplement Isolate#idle_notification using idle_notification_deadline, API remains the same @ignisf
8
+ - Account for changes in the upstream V8 API @ignisf
9
+ - Support for libv8 6.7
10
+
11
+ 23-08-2017
12
+
13
+ - 0.1.15
14
+
15
+ - bump dependency of libv8 to 6.3
16
+
1
17
  23-08-2017
2
18
 
3
19
  - 0.1.14
data/README.md CHANGED
@@ -10,6 +10,12 @@ It was created as an alternative to the excellent [therubyracer](https://github.
10
10
 
11
11
  MiniRacer has an adapter for [execjs](https://github.com/rails/execjs) so it can be used directly with Rails projects to minify assets, run babel or compile CoffeeScript.
12
12
 
13
+ ### A note about Ruby version Support
14
+
15
+ MiniRacer only supports non-EOL versions of Ruby. See [Ruby](https://www.ruby-lang.org/en/downloads) to see the list of non-EOL Rubies.
16
+
17
+ If you require support for older versions of Ruby install an older version of the gem.
18
+
13
19
  ## Features
14
20
 
15
21
  ### Simple eval for JavaScript
@@ -283,6 +289,22 @@ context.eval("a = 2")
283
289
  # nothing works on the context from now on, its a shell waiting to be disposed
284
290
  ```
285
291
 
292
+ ### Function call
293
+
294
+ This calls the function passed as first argument:
295
+
296
+ ```ruby
297
+ context = MiniRacer::Context.new
298
+ context.eval('function hello(name) { return "Hello, " + name + "!" }')
299
+ context.call('hello', 'George')
300
+ # "Hello, George!"
301
+ ```
302
+
303
+ Performance is slightly better than running `eval('hello("George")')` since:
304
+
305
+ - compilation of eval'd string is avoided
306
+ - function arguments don't need to be converted to JSON
307
+
286
308
  ## Performance
287
309
 
288
310
  The `bench` folder contains benchmark.
@@ -9,6 +9,7 @@ $CPPFLAGS += " -rdynamic" unless $CPPFLAGS.split.include? "-rdynamic"
9
9
  $CPPFLAGS += " -fPIC" unless $CPPFLAGS.split.include? "-rdynamic" or RUBY_PLATFORM =~ /darwin/
10
10
  $CPPFLAGS += " -std=c++0x"
11
11
  $CPPFLAGS += " -fpermissive"
12
+ $CPPFLAGS += " -Wno-reserved-user-defined-literal" if RUBY_PLATFORM =~ /darwin/
12
13
 
13
14
  $LDFLAGS.insert 0, " -stdlib=libstdc++ " if RUBY_PLATFORM =~ /darwin/
14
15