sq_mini_racer 0.2.5.0.1.beta3 → 0.2.5.0.2
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 +4 -4
 - data/.dockerignore +12 -0
 - data/Dockerfile +23 -0
 - data/azure-pipelines.yml +69 -0
 - data/azure-template.yml +92 -0
 - data/ext/mini_racer_extension/extconf.rb +58 -51
 - data/lib/sqreen/mini_racer/version.rb +1 -1
 - data/mini_racer.gemspec +0 -1
 - metadata +12 -23
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 124526376fa9a93ba73fd7205e15abca399022b37b91f5f6fd994ecadaf63714
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 5a20fb645e0fbf6f8da6b4bdfbda258f29c05e6d9861928a28c2f2b0311bf7f1
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: b2cb15116b9cda7b82245dee09f93f02cb4634911ef29d2606d084436b7d0d284b6940d69cbc8fd8dc83bfb865b586c943f0c4e13513b8c66ed2437116aaa340
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: f09c7e9b3ad2c3a34514bca93b5f209e1f49a2d8b873a0edf4f1ec0ba55c16dad035809a71364b7da1a817a8677342ed63cbd6a8bd0c4e588db6ee10b3b035af
         
     | 
    
        data/.dockerignore
    ADDED
    
    
    
        data/Dockerfile
    ADDED
    
    | 
         @@ -0,0 +1,23 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ARG RUBY_VERSION=2.7
         
     | 
| 
      
 2 
     | 
    
         
            +
            FROM ruby:${RUBY_VERSION}
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            RUN test ! -f /etc/alpine-release || apk add --no-cache build-base git
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            # without this `COPY .git`, we get the following error:
         
     | 
| 
      
 7 
     | 
    
         
            +
            #   fatal: not a git repository (or any of the parent directories): .git
         
     | 
| 
      
 8 
     | 
    
         
            +
            # but with it we need the full gem just to compile the extension because
         
     | 
| 
      
 9 
     | 
    
         
            +
            # of gemspec's `git --ls-files`
         
     | 
| 
      
 10 
     | 
    
         
            +
            # COPY .git /code/.git
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            COPY Gemfile mini_racer.gemspec /code/
         
     | 
| 
      
 13 
     | 
    
         
            +
            COPY lib/sqreen/mini_racer/version.rb /code/lib/sqreen/mini_racer/version.rb
         
     | 
| 
      
 14 
     | 
    
         
            +
            WORKDIR /code
         
     | 
| 
      
 15 
     | 
    
         
            +
            RUN bundle install
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
            COPY Rakefile /code/
         
     | 
| 
      
 18 
     | 
    
         
            +
            COPY ext /code/ext/
         
     | 
| 
      
 19 
     | 
    
         
            +
            RUN bundle exec rake compile
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
            COPY . /code/
         
     | 
| 
      
 22 
     | 
    
         
            +
            CMD bundle exec irb -rmini_racer
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
    
        data/azure-pipelines.yml
    ADDED
    
    | 
         @@ -0,0 +1,69 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            jobs:
         
     | 
| 
      
 2 
     | 
    
         
            +
              - template: azure-template.yml
         
     | 
| 
      
 3 
     | 
    
         
            +
                parameters:
         
     | 
| 
      
 4 
     | 
    
         
            +
                  name: linux_2_0
         
     | 
| 
      
 5 
     | 
    
         
            +
                  displayName: Linux Ruby 2.0
         
     | 
| 
      
 6 
     | 
    
         
            +
                  rubyVersion: '2.0'
         
     | 
| 
      
 7 
     | 
    
         
            +
                  publishCoverage: true
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
              - template: azure-template.yml
         
     | 
| 
      
 10 
     | 
    
         
            +
                parameters:
         
     | 
| 
      
 11 
     | 
    
         
            +
                  name: linux_2_1
         
     | 
| 
      
 12 
     | 
    
         
            +
                  displayName: Linux Ruby 2.1
         
     | 
| 
      
 13 
     | 
    
         
            +
                  rubyVersion: '2.1'
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
              - template: azure-template.yml
         
     | 
| 
      
 16 
     | 
    
         
            +
                parameters:
         
     | 
| 
      
 17 
     | 
    
         
            +
                  name: linux_2_2
         
     | 
| 
      
 18 
     | 
    
         
            +
                  displayName: Linux Ruby 2.2
         
     | 
| 
      
 19 
     | 
    
         
            +
                  rubyVersion: '2.2'
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
              - template: azure-template.yml
         
     | 
| 
      
 22 
     | 
    
         
            +
                parameters:
         
     | 
| 
      
 23 
     | 
    
         
            +
                  name: linux_2_3
         
     | 
| 
      
 24 
     | 
    
         
            +
                  displayName: Linux Ruby 2.3
         
     | 
| 
      
 25 
     | 
    
         
            +
                  rubyVersion: '2.3'
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
              - template: azure-template.yml
         
     | 
| 
      
 28 
     | 
    
         
            +
                parameters:
         
     | 
| 
      
 29 
     | 
    
         
            +
                  name: linux_2_4
         
     | 
| 
      
 30 
     | 
    
         
            +
                  displayName: Linux Ruby 2.4
         
     | 
| 
      
 31 
     | 
    
         
            +
                  rubyVersion: '2.4'
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
              - template: azure-template.yml
         
     | 
| 
      
 34 
     | 
    
         
            +
                parameters:
         
     | 
| 
      
 35 
     | 
    
         
            +
                  name: linux_2_5
         
     | 
| 
      
 36 
     | 
    
         
            +
                  displayName: Linux Ruby 2.5
         
     | 
| 
      
 37 
     | 
    
         
            +
                  rubyVersion: '2.5'
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
              - template: azure-template.yml
         
     | 
| 
      
 40 
     | 
    
         
            +
                parameters:
         
     | 
| 
      
 41 
     | 
    
         
            +
                  name: linux_2_6
         
     | 
| 
      
 42 
     | 
    
         
            +
                  displayName: Linux Ruby 2.6
         
     | 
| 
      
 43 
     | 
    
         
            +
                  rubyVersion: '2.6'
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
              - template: azure-template.yml
         
     | 
| 
      
 46 
     | 
    
         
            +
                parameters:
         
     | 
| 
      
 47 
     | 
    
         
            +
                  name: linux_2_7
         
     | 
| 
      
 48 
     | 
    
         
            +
                  displayName: Linux Ruby 2.7
         
     | 
| 
      
 49 
     | 
    
         
            +
                  rubyVersion: '2.7'
         
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
      
 51 
     | 
    
         
            +
              - template: azure-template.yml
         
     | 
| 
      
 52 
     | 
    
         
            +
                parameters:
         
     | 
| 
      
 53 
     | 
    
         
            +
                  name: linux_2_7_mini_racer
         
     | 
| 
      
 54 
     | 
    
         
            +
                  displayName: Linux Ruby 2.7 (with mini_racer)
         
     | 
| 
      
 55 
     | 
    
         
            +
                  rubyVersion: '2.7'
         
     | 
| 
      
 56 
     | 
    
         
            +
                  with_mini_racer: true
         
     | 
| 
      
 57 
     | 
    
         
            +
             
     | 
| 
      
 58 
     | 
    
         
            +
              - template: azure-template.yml
         
     | 
| 
      
 59 
     | 
    
         
            +
                parameters:
         
     | 
| 
      
 60 
     | 
    
         
            +
                  name: linux_2_7_therubyracer
         
     | 
| 
      
 61 
     | 
    
         
            +
                  displayName: Linux Ruby 2.7 (with therubyracer)
         
     | 
| 
      
 62 
     | 
    
         
            +
                  rubyVersion: '2.7'
         
     | 
| 
      
 63 
     | 
    
         
            +
                  with_therubyracer: true
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
      
 65 
     | 
    
         
            +
              - template: azure-template.yml
         
     | 
| 
      
 66 
     | 
    
         
            +
                parameters:
         
     | 
| 
      
 67 
     | 
    
         
            +
                  name: macos_10_15
         
     | 
| 
      
 68 
     | 
    
         
            +
                  displayName: MacOS 10.15
         
     | 
| 
      
 69 
     | 
    
         
            +
                  imageName: 'macos-10.15'
         
     | 
    
        data/azure-template.yml
    ADDED
    
    | 
         @@ -0,0 +1,92 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            parameters:
         
     | 
| 
      
 2 
     | 
    
         
            +
              name: ~
         
     | 
| 
      
 3 
     | 
    
         
            +
              displayName: ~
         
     | 
| 
      
 4 
     | 
    
         
            +
              rubyVersion: bundled
         
     | 
| 
      
 5 
     | 
    
         
            +
              imageName: ubuntu-18.04
         
     | 
| 
      
 6 
     | 
    
         
            +
              publishCoverage: false
         
     | 
| 
      
 7 
     | 
    
         
            +
              with_mini_racer: false
         
     | 
| 
      
 8 
     | 
    
         
            +
              with_therubyracer: false
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            jobs:
         
     | 
| 
      
 11 
     | 
    
         
            +
              - job: ${{ parameters.name }}
         
     | 
| 
      
 12 
     | 
    
         
            +
                displayName: ${{ parameters.displayName }}
         
     | 
| 
      
 13 
     | 
    
         
            +
                pool:
         
     | 
| 
      
 14 
     | 
    
         
            +
                  vmImage: ${{ parameters.imageName }}
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
                variables:
         
     | 
| 
      
 17 
     | 
    
         
            +
                  TESTOPTS: -v
         
     | 
| 
      
 18 
     | 
    
         
            +
                  ${{ if eq(parameters.publishCoverage, true) }}:
         
     | 
| 
      
 19 
     | 
    
         
            +
                    CPPFLAGS: --coverage
         
     | 
| 
      
 20 
     | 
    
         
            +
                    LDFLAGS: --coverage
         
     | 
| 
      
 21 
     | 
    
         
            +
                  ${{ if eq(parameters.rubyVersion, 'bundled') }}:
         
     | 
| 
      
 22 
     | 
    
         
            +
                    gem: gem
         
     | 
| 
      
 23 
     | 
    
         
            +
                    bundle: bundle
         
     | 
| 
      
 24 
     | 
    
         
            +
                  ${{ if ne(parameters.rubyVersion, 'bundled') }}:
         
     | 
| 
      
 25 
     | 
    
         
            +
                    gem: /opt/ruby/${{ parameters.rubyVersion }}/bin/gem
         
     | 
| 
      
 26 
     | 
    
         
            +
                    bundle: /opt/ruby/${{ parameters.rubyVersion }}/bin/bundle
         
     | 
| 
      
 27 
     | 
    
         
            +
                    GEM_HOME: /opt/ruby/${{ parameters.rubyVersion }}/lib/ruby/gems/${{ parameters.rubyVersion }}.0
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
                steps:
         
     | 
| 
      
 30 
     | 
    
         
            +
                  - checkout: self
         
     | 
| 
      
 31 
     | 
    
         
            +
                    displayName: Checkout
         
     | 
| 
      
 32 
     | 
    
         
            +
                    clean: true
         
     | 
| 
      
 33 
     | 
    
         
            +
                    submodules: recursive
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
                  - ${{ if ne(parameters.rubyVersion, 'bundled') }}:
         
     | 
| 
      
 36 
     | 
    
         
            +
                    - script: |
         
     | 
| 
      
 37 
     | 
    
         
            +
                        sudo apt-get install -y gnupg
         
     | 
| 
      
 38 
     | 
    
         
            +
                        sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 5D98E7264E3F3D89463B314B12229434A9F003C9
         
     | 
| 
      
 39 
     | 
    
         
            +
                        echo deb [arch=amd64] http://sqreen-download-private.s3.amazonaws.com/deb bionic main | sudo tee -a /etc/apt/sources.list
         
     | 
| 
      
 40 
     | 
    
         
            +
                        sudo apt-get update
         
     | 
| 
      
 41 
     | 
    
         
            +
                        sudo apt-get install -y sq-ruby${{ parameters.rubyVersion }} ruby-
         
     | 
| 
      
 42 
     | 
    
         
            +
                      displayName: Install Ruby
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
                  - ${{ if eq(parameters.rubyVersion, 'bundled') }}:
         
     | 
| 
      
 45 
     | 
    
         
            +
                    - script: sudo $(gem) install bundler --version '< 2.0' --no-document
         
     | 
| 
      
 46 
     | 
    
         
            +
                      displayName: Install bundler
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
                  - ${{ if eq(parameters.imageName, 'ubuntu-18.04') }}:
         
     | 
| 
      
 49 
     | 
    
         
            +
                    - script: |
         
     | 
| 
      
 50 
     | 
    
         
            +
                        sudo apt-get install -y build-essential git curl valgrind g++ make
         
     | 
| 
      
 51 
     | 
    
         
            +
                      displayName: Install Linux packages
         
     | 
| 
      
 52 
     | 
    
         
            +
             
     | 
| 
      
 53 
     | 
    
         
            +
                  - script: $(bundle) install --path vendor/bundle
         
     | 
| 
      
 54 
     | 
    
         
            +
                    displayName: Install gem dependencies
         
     | 
| 
      
 55 
     | 
    
         
            +
                    env:
         
     | 
| 
      
 56 
     | 
    
         
            +
                      ${{ if eq(parameters.with_mini_racer, true) }}:
         
     | 
| 
      
 57 
     | 
    
         
            +
                        LOAD_MINI_RACER: 1
         
     | 
| 
      
 58 
     | 
    
         
            +
                      ${{ if eq(parameters.with_therubyracer, true) }}:
         
     | 
| 
      
 59 
     | 
    
         
            +
                        LOAD_THERUBYRACER: 1
         
     | 
| 
      
 60 
     | 
    
         
            +
             
     | 
| 
      
 61 
     | 
    
         
            +
                  - script: PATH=`dirname $(bundle)`:$PATH CPPFLAGS=$(CPPFLAGS) LDFLAGS=$(LDFLAGS) $(bundle) exec rake compile
         
     | 
| 
      
 62 
     | 
    
         
            +
                    displayName: Compile extension
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
                  - script: |
         
     | 
| 
      
 65 
     | 
    
         
            +
                      find . -name '*.log' -exec cat '{}' \;
         
     | 
| 
      
 66 
     | 
    
         
            +
                    displayName: Print logs
         
     | 
| 
      
 67 
     | 
    
         
            +
                    condition: failed()
         
     | 
| 
      
 68 
     | 
    
         
            +
             
     | 
| 
      
 69 
     | 
    
         
            +
                  - script: $(bundle) exec rake test
         
     | 
| 
      
 70 
     | 
    
         
            +
                    displayName: Run tests
         
     | 
| 
      
 71 
     | 
    
         
            +
                    env:
         
     | 
| 
      
 72 
     | 
    
         
            +
                      ${{ if eq(parameters.with_mini_racer, true) }}:
         
     | 
| 
      
 73 
     | 
    
         
            +
                        LOAD_MINI_RACER: 1
         
     | 
| 
      
 74 
     | 
    
         
            +
                      ${{ if eq(parameters.with_therubyracer, true) }}:
         
     | 
| 
      
 75 
     | 
    
         
            +
                        LOAD_THERUBYRACER: 1
         
     | 
| 
      
 76 
     | 
    
         
            +
             
     | 
| 
      
 77 
     | 
    
         
            +
                  - ${{ if and(eq(parameters.imageName, 'ubuntu-18.04'), eq(parameters.with_mini_racer, false), eq(parameters.with_therubyracer, false)) }}:
         
     | 
| 
      
 78 
     | 
    
         
            +
                    - script: $(bundle) exec rake test:valgrind
         
     | 
| 
      
 79 
     | 
    
         
            +
                      displayName: Run tests w/ valgrind
         
     | 
| 
      
 80 
     | 
    
         
            +
             
     | 
| 
      
 81 
     | 
    
         
            +
                  - script: |
         
     | 
| 
      
 82 
     | 
    
         
            +
                      PATH=$PATH:$(dirname $(which $(gem)))
         
     | 
| 
      
 83 
     | 
    
         
            +
                      $(bundle) exec rake build
         
     | 
| 
      
 84 
     | 
    
         
            +
                      sudo PATH=$PATH $(gem) install pkg/*.gem
         
     | 
| 
      
 85 
     | 
    
         
            +
                    displayName: Check that the gem is installable
         
     | 
| 
      
 86 
     | 
    
         
            +
             
     | 
| 
      
 87 
     | 
    
         
            +
                  - ${{ if eq(parameters.publishCoverage, true) }}:
         
     | 
| 
      
 88 
     | 
    
         
            +
                      - bash: >
         
     | 
| 
      
 89 
     | 
    
         
            +
                          test -z "$CODECOV_TOKEN" || bash <(curl -s https://codecov.io/bash)
         
     | 
| 
      
 90 
     | 
    
         
            +
                        displayName: "Publish coverage (Codecov)"
         
     | 
| 
      
 91 
     | 
    
         
            +
                        env:
         
     | 
| 
      
 92 
     | 
    
         
            +
                          CODECOV_TOKEN: $(CODECOV_TOKEN)
         
     | 
| 
         @@ -26,46 +26,58 @@ def cppflags_add_cpu_extension! 
     | 
|
| 
       26 
26 
     | 
    
         
             
            end
         
     | 
| 
       27 
27 
     | 
    
         | 
| 
       28 
28 
     | 
    
         
             
            def libv8_gem_name
         
     | 
| 
       29 
     | 
    
         
            -
              return "libv8-solaris" if IS_SOLARIS
         
     | 
| 
       30 
     | 
    
         
            -
              return "libv8-alpine" if IS_LINUX_MUSL
         
     | 
| 
      
 29 
     | 
    
         
            +
              #return "libv8-solaris" if IS_SOLARIS
         
     | 
| 
      
 30 
     | 
    
         
            +
              #return "libv8-alpine" if IS_LINUX_MUSL
         
     | 
| 
       31 
31 
     | 
    
         | 
| 
       32 
     | 
    
         
            -
              'libv8'
         
     | 
| 
      
 32 
     | 
    
         
            +
              'libv8-node'
         
     | 
| 
       33 
33 
     | 
    
         
             
            end
         
     | 
| 
       34 
34 
     | 
    
         | 
| 
       35 
     | 
    
         
            -
            def  
     | 
| 
       36 
     | 
    
         
            -
              ' 
     | 
| 
      
 35 
     | 
    
         
            +
            def libv8_requirement
         
     | 
| 
      
 36 
     | 
    
         
            +
              '~> 12.18.4.0.beta1'
         
     | 
| 
       37 
37 
     | 
    
         
             
            end
         
     | 
| 
       38 
38 
     | 
    
         | 
| 
       39 
     | 
    
         
            -
            def libv8_basename
         
     | 
| 
       40 
     | 
    
         
            -
              "#{libv8_gem_name}-#{ 
     | 
| 
      
 39 
     | 
    
         
            +
            def libv8_basename(version)
         
     | 
| 
      
 40 
     | 
    
         
            +
              "#{libv8_gem_name}-#{version}-#{ruby_platform}"
         
     | 
| 
       41 
41 
     | 
    
         
             
            end
         
     | 
| 
       42 
42 
     | 
    
         | 
| 
       43 
     | 
    
         
            -
            def libv8_gemspec
         
     | 
| 
       44 
     | 
    
         
            -
              "#{libv8_basename}.gemspec"
         
     | 
| 
      
 43 
     | 
    
         
            +
            def libv8_gemspec(version)
         
     | 
| 
      
 44 
     | 
    
         
            +
              "#{libv8_basename(version)}.gemspec"
         
     | 
| 
       45 
45 
     | 
    
         
             
            end
         
     | 
| 
       46 
46 
     | 
    
         | 
| 
       47 
47 
     | 
    
         
             
            def libv8_local_path(path=Gem.path)
         
     | 
| 
       48 
     | 
    
         
            -
               
     | 
| 
       49 
     | 
    
         
            -
              candidates = path.map { |p| File.join(p, 'specifications', libv8_gemspec) }
         
     | 
| 
       50 
     | 
    
         
            -
              found = candidates.select { |f| File.exist?(f) }.first
         
     | 
| 
      
 48 
     | 
    
         
            +
              name_glob = "#{libv8_gem_name}-*-#{ruby_platform}"
         
     | 
| 
       51 
49 
     | 
    
         | 
| 
       52 
     | 
    
         
            -
               
     | 
| 
       53 
     | 
    
         
            -
             
     | 
| 
      
 50 
     | 
    
         
            +
              puts "looking for #{name_glob} in #{path.inspect}"
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
              paths = path.map { |p| Dir.glob(File.join(p, 'specifications', name_glob + '.gemspec')) }.flatten
         
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
      
 54 
     | 
    
         
            +
              if paths.empty?
         
     | 
| 
      
 55 
     | 
    
         
            +
                puts "#{name_glob} not found in #{path.inspect}"
         
     | 
| 
      
 56 
     | 
    
         
            +
                return
         
     | 
| 
      
 57 
     | 
    
         
            +
              end
         
     | 
| 
      
 58 
     | 
    
         
            +
             
     | 
| 
      
 59 
     | 
    
         
            +
              specs = paths.map { |p| [p, eval(File.read(p))] }
         
     | 
| 
      
 60 
     | 
    
         
            +
                           .select { |_, spec| Gem::Requirement.new(libv8_requirement).satisfied_by?(spec.version) }
         
     | 
| 
      
 61 
     | 
    
         
            +
              found_path, found_spec = specs.sort_by { |_, spec| spec.version }.last
         
     | 
| 
      
 62 
     | 
    
         
            +
             
     | 
| 
      
 63 
     | 
    
         
            +
              unless found_path && found_spec
         
     | 
| 
      
 64 
     | 
    
         
            +
                puts "not found in specs: no '#{libv8_requirement}' in #{paths.inspect}"
         
     | 
| 
       54 
65 
     | 
    
         
             
                return
         
     | 
| 
       55 
66 
     | 
    
         
             
              end
         
     | 
| 
       56 
67 
     | 
    
         | 
| 
       57 
     | 
    
         
            -
              puts "found in  
     | 
| 
      
 68 
     | 
    
         
            +
              puts "found in specs: #{found_path}"
         
     | 
| 
       58 
69 
     | 
    
         | 
| 
       59 
     | 
    
         
            -
               
     | 
| 
      
 70 
     | 
    
         
            +
              gemdir = File.basename(found_path, '.gemspec')
         
     | 
| 
      
 71 
     | 
    
         
            +
              dir = File.expand_path(File.join(found_path, '..', '..', 'gems', gemdir))
         
     | 
| 
       60 
72 
     | 
    
         | 
| 
       61 
73 
     | 
    
         
             
              unless Dir.exist?(dir)
         
     | 
| 
       62 
     | 
    
         
            -
                puts "not found in  
     | 
| 
      
 74 
     | 
    
         
            +
                puts "not found in gems: #{dir}"
         
     | 
| 
       63 
75 
     | 
    
         
             
                return
         
     | 
| 
       64 
76 
     | 
    
         
             
              end
         
     | 
| 
       65 
77 
     | 
    
         | 
| 
       66 
     | 
    
         
            -
              puts "found in  
     | 
| 
      
 78 
     | 
    
         
            +
              puts "found in gems: #{dir}"
         
     | 
| 
       67 
79 
     | 
    
         | 
| 
       68 
     | 
    
         
            -
              dir
         
     | 
| 
      
 80 
     | 
    
         
            +
              [dir, found_spec]
         
     | 
| 
       69 
81 
     | 
    
         
             
            end
         
     | 
| 
       70 
82 
     | 
    
         | 
| 
       71 
83 
     | 
    
         
             
            def vendor_path
         
     | 
| 
         @@ -73,26 +85,12 @@ def vendor_path 
     | 
|
| 
       73 
85 
     | 
    
         
             
            end
         
     | 
| 
       74 
86 
     | 
    
         | 
| 
       75 
87 
     | 
    
         
             
            def libv8_vendor_path
         
     | 
| 
       76 
     | 
    
         
            -
               
     | 
| 
       77 
     | 
    
         
            -
              path = Dir.glob("#{vendor_path}/#{libv8_basename}").first
         
     | 
| 
       78 
     | 
    
         
            -
             
     | 
| 
       79 
     | 
    
         
            -
              unless path
         
     | 
| 
       80 
     | 
    
         
            -
                puts "#{libv8_basename} not found in #{vendor_path}"
         
     | 
| 
       81 
     | 
    
         
            -
                return
         
     | 
| 
       82 
     | 
    
         
            -
              end
         
     | 
| 
       83 
     | 
    
         
            -
             
     | 
| 
       84 
     | 
    
         
            -
              puts "looking for #{libv8_basename}/lib/libv8.rb in #{vendor_path}"
         
     | 
| 
       85 
     | 
    
         
            -
              unless Dir.glob(File.join(vendor_path, libv8_basename, 'lib', 'libv8.rb')).first
         
     | 
| 
       86 
     | 
    
         
            -
                puts "#{libv8_basename}/lib/libv8.rb not found in #{vendor_path}"
         
     | 
| 
       87 
     | 
    
         
            -
                return
         
     | 
| 
       88 
     | 
    
         
            -
              end
         
     | 
| 
       89 
     | 
    
         
            -
             
     | 
| 
       90 
     | 
    
         
            -
              path
         
     | 
| 
      
 88 
     | 
    
         
            +
              libv8_local_path([vendor_path])
         
     | 
| 
       91 
89 
     | 
    
         
             
            end
         
     | 
| 
       92 
90 
     | 
    
         | 
| 
       93 
91 
     | 
    
         
             
            def parse_platform(str)
         
     | 
| 
       94 
92 
     | 
    
         
             
              Gem::Platform.new(str).tap do |p|
         
     | 
| 
       95 
     | 
    
         
            -
                p.instance_eval { @ 
     | 
| 
      
 93 
     | 
    
         
            +
                p.instance_eval { @version = 'musl' } if str =~ /-musl/ && p.version.nil?
         
     | 
| 
       96 
94 
     | 
    
         
             
                p.instance_eval { @cpu = 'x86_64' } if str =~ /universal.*darwin/
         
     | 
| 
       97 
95 
     | 
    
         
             
              end
         
     | 
| 
       98 
96 
     | 
    
         
             
            end
         
     | 
| 
         @@ -116,21 +114,23 @@ def libv8_remote_search 
     | 
|
| 
       116 
114 
     | 
    
         
             
              json = JSON.parse(body)
         
     | 
| 
       117 
115 
     | 
    
         | 
| 
       118 
116 
     | 
    
         
             
              versions = json.select do |v|
         
     | 
| 
       119 
     | 
    
         
            -
                Gem::Version.new(v['number']) 
     | 
| 
      
 117 
     | 
    
         
            +
                Gem::Requirement.new(libv8_requirement).satisfied_by?(Gem::Version.new(v['number']))
         
     | 
| 
       120 
118 
     | 
    
         
             
              end
         
     | 
| 
       121 
119 
     | 
    
         
             
              abort(<<-ERROR) if versions.empty?
         
     | 
| 
       122 
     | 
    
         
            -
              ERROR: could not find #{ 
     | 
| 
      
 120 
     | 
    
         
            +
              ERROR: could not find #{libv8_gem_name} (requirement #{libv8_requirement}) in rubygems.org
         
     | 
| 
       123 
121 
     | 
    
         
             
              ERROR
         
     | 
| 
       124 
122 
     | 
    
         | 
| 
       125 
123 
     | 
    
         
             
              platform_versions = versions.select do |v|
         
     | 
| 
       126 
124 
     | 
    
         
             
                parse_platform(v['platform']) == ruby_platform unless v['platform'] =~ /universal.*darwin/
         
     | 
| 
       127 
125 
     | 
    
         
             
              end
         
     | 
| 
       128 
126 
     | 
    
         
             
              abort(<<-ERROR) if platform_versions.empty?
         
     | 
| 
       129 
     | 
    
         
            -
              ERROR: found #{libv8_gem_name} 
     | 
| 
       130 
     | 
    
         
            -
                     try "gem install #{libv8_gem_name} 
     | 
| 
      
 127 
     | 
    
         
            +
              ERROR: found gems matching #{libv8_gem_name}:'#{libv8_requirement}', but no binary for #{ruby_platform}
         
     | 
| 
      
 128 
     | 
    
         
            +
                     try "gem install #{libv8_gem_name}:'#{libv8_requirement}'" to attempt to build #{libv8_gem_name} from source
         
     | 
| 
       131 
129 
     | 
    
         
             
              ERROR
         
     | 
| 
       132 
130 
     | 
    
         | 
| 
       133 
     | 
    
         
            -
              platform_versions. 
     | 
| 
      
 131 
     | 
    
         
            +
              puts "found #{libv8_gem_name} for #{ruby_platform} on rubygems: #{platform_versions.map { |v| v['number'] }.join(', ')}"
         
     | 
| 
      
 132 
     | 
    
         
            +
             
     | 
| 
      
 133 
     | 
    
         
            +
              platform_versions.sort_by { |v| Gem::Version.new(v['number']) }.last
         
     | 
| 
       134 
134 
     | 
    
         
             
            end
         
     | 
| 
       135 
135 
     | 
    
         | 
| 
       136 
136 
     | 
    
         
             
            def libv8_download_uri(name, version, platform)
         
     | 
| 
         @@ -142,19 +142,19 @@ def libv8_downloaded_gem(name, version, platform) 
     | 
|
| 
       142 
142 
     | 
    
         
             
            end
         
     | 
| 
       143 
143 
     | 
    
         | 
| 
       144 
144 
     | 
    
         
             
            def libv8_download(name, version, platform)
         
     | 
| 
       145 
     | 
    
         
            -
              FileUtils.mkdir_p(vendor_path)
         
     | 
| 
      
 145 
     | 
    
         
            +
              FileUtils.mkdir_p(File.join(vendor_path, 'cache'))
         
     | 
| 
       146 
146 
     | 
    
         
             
              body = http_get(libv8_download_uri(name, version, platform))
         
     | 
| 
       147 
     | 
    
         
            -
              File.open(File.join(vendor_path, libv8_downloaded_gem(name, version, platform)), 'wb') { |f| f.write(body) }
         
     | 
| 
      
 147 
     | 
    
         
            +
              File.open(File.join(vendor_path, 'cache', libv8_downloaded_gem(name, version, platform)), 'wb') { |f| f.write(body) }
         
     | 
| 
       148 
148 
     | 
    
         
             
            end
         
     | 
| 
       149 
149 
     | 
    
         | 
| 
       150 
150 
     | 
    
         
             
            def libv8_install!
         
     | 
| 
       151 
     | 
    
         
            -
              cmd = "gem install #{libv8_gem_name} --version '#{ 
     | 
| 
      
 151 
     | 
    
         
            +
              cmd = "gem install #{libv8_gem_name} --version '#{libv8_requirement}' --install-dir '#{vendor_path}'"
         
     | 
| 
       152 
152 
     | 
    
         
             
              puts "installing #{libv8_gem_name} using `#{cmd}`"
         
     | 
| 
       153 
153 
     | 
    
         
             
              rc = system(cmd)
         
     | 
| 
       154 
154 
     | 
    
         | 
| 
       155 
155 
     | 
    
         
             
              abort(<<-ERROR) unless rc
         
     | 
| 
       156 
     | 
    
         
            -
              ERROR: could not install #{libv8_gem_name} 
     | 
| 
       157 
     | 
    
         
            -
                      try "gem install #{libv8_gem_name} -v '#{ 
     | 
| 
      
 156 
     | 
    
         
            +
              ERROR: could not install #{libv8_gem_name}:#{libv8_requirement}
         
     | 
| 
      
 157 
     | 
    
         
            +
                      try "gem install #{libv8_gem_name} -v '#{libv8_requirement}'" to attempt to build libv8 from source
         
     | 
| 
       158 
158 
     | 
    
         
             
              ERROR
         
     | 
| 
       159 
159 
     | 
    
         | 
| 
       160 
160 
     | 
    
         
             
              libv8_local_path([vendor_path])
         
     | 
| 
         @@ -168,16 +168,21 @@ def libv8_vendor! 
     | 
|
| 
       168 
168 
     | 
    
         
             
              puts "downloading #{libv8_downloaded_gem(libv8_gem_name, version['number'], version['platform'])} to #{vendor_path}"
         
     | 
| 
       169 
169 
     | 
    
         
             
              libv8_download(libv8_gem_name, version['number'], version['platform'])
         
     | 
| 
       170 
170 
     | 
    
         | 
| 
       171 
     | 
    
         
            -
              package = Gem::Package.new(File.join(vendor_path, libv8_downloaded_gem(libv8_gem_name, version['number'], version['platform'])))
         
     | 
| 
       172 
     | 
    
         
            -
              package.extract_files(File.join(vendor_path, File.basename(libv8_downloaded_gem(libv8_gem_name, version['number'], version['platform']), '.gem')))
         
     | 
| 
      
 171 
     | 
    
         
            +
              package = Gem::Package.new(File.join(vendor_path, 'cache', libv8_downloaded_gem(libv8_gem_name, version['number'], version['platform'])))
         
     | 
| 
      
 172 
     | 
    
         
            +
              package.extract_files(File.join(vendor_path, 'gems', File.basename(libv8_downloaded_gem(libv8_gem_name, version['number'], version['platform']), '.gem')))
         
     | 
| 
      
 173 
     | 
    
         
            +
              FileUtils.mkdir_p(File.join(vendor_path, 'specifications'))
         
     | 
| 
      
 174 
     | 
    
         
            +
              File.open(File.join(vendor_path, 'specifications', File.basename(libv8_downloaded_gem(libv8_gem_name, version['number'], version['platform']), '.gem') + '.gemspec'), 'wb') { |f| f.write(package.spec.to_ruby) }
         
     | 
| 
       173 
175 
     | 
    
         | 
| 
       174 
176 
     | 
    
         
             
              libv8_vendor_path
         
     | 
| 
       175 
177 
     | 
    
         
             
            end
         
     | 
| 
       176 
178 
     | 
    
         | 
| 
       177 
179 
     | 
    
         
             
            def ensure_libv8_load_path
         
     | 
| 
       178 
     | 
    
         
            -
              puts " 
     | 
| 
      
 180 
     | 
    
         
            +
              puts "platform ruby:#{RUBY_PLATFORM} rubygems:#{Gem::Platform.new(RUBY_PLATFORM)} detected:#{ruby_platform}"
         
     | 
| 
       179 
181 
     | 
    
         | 
| 
       180 
     | 
    
         
            -
              libv8_path = libv8_local_path 
     | 
| 
      
 182 
     | 
    
         
            +
              libv8_path, spec = libv8_local_path
         
     | 
| 
      
 183 
     | 
    
         
            +
              if !ENV['ONLY_INSTALLED_LIBV8_GEM'] && !libv8_path
         
     | 
| 
      
 184 
     | 
    
         
            +
                libv8_path, spec = libv8_vendor_path || libv8_vendor!
         
     | 
| 
      
 185 
     | 
    
         
            +
              end
         
     | 
| 
       181 
186 
     | 
    
         | 
| 
       182 
187 
     | 
    
         
             
              abort(<<-ERROR) unless libv8_path
         
     | 
| 
       183 
188 
     | 
    
         
             
              ERROR: could not find #{libv8_gem_name}
         
     | 
| 
         @@ -189,7 +194,7 @@ end 
     | 
|
| 
       189 
194 
     | 
    
         | 
| 
       190 
195 
     | 
    
         
             
            ensure_libv8_load_path
         
     | 
| 
       191 
196 
     | 
    
         | 
| 
       192 
     | 
    
         
            -
            require 'libv8'
         
     | 
| 
      
 197 
     | 
    
         
            +
            require 'libv8-node'
         
     | 
| 
       193 
198 
     | 
    
         | 
| 
       194 
199 
     | 
    
         
             
            IS_DARWIN = RUBY_PLATFORM =~ /darwin/
         
     | 
| 
       195 
200 
     | 
    
         | 
| 
         @@ -208,6 +213,8 @@ cppflags_add_cpu_extension! 
     | 
|
| 
       208 
213 
     | 
    
         
             
            $CPPFLAGS += " -Wno-reserved-user-defined-literal" if IS_DARWIN
         
     | 
| 
       209 
214 
     | 
    
         | 
| 
       210 
215 
     | 
    
         
             
            $LDFLAGS.insert(0, " -stdlib=libc++ ") if IS_DARWIN
         
     | 
| 
      
 216 
     | 
    
         
            +
            $LDFLAGS += " -Wl,--no-undefined " unless IS_DARWIN
         
     | 
| 
      
 217 
     | 
    
         
            +
            $LDFLAGS += " -Wl,-undefined,error " if IS_DARWIN
         
     | 
| 
       211 
218 
     | 
    
         | 
| 
       212 
219 
     | 
    
         
             
            if ENV['CXX']
         
     | 
| 
       213 
220 
     | 
    
         
             
              puts "SETTING CXX"
         
     | 
| 
         @@ -246,7 +253,7 @@ if enable_config('debug') || enable_config('asan') 
     | 
|
| 
       246 
253 
     | 
    
         
             
              CONFIG['debugflags'] << ' -ggdb3 -O0'
         
     | 
| 
       247 
254 
     | 
    
         
             
            end
         
     | 
| 
       248 
255 
     | 
    
         | 
| 
       249 
     | 
    
         
            -
            Libv8.configure_makefile
         
     | 
| 
      
 256 
     | 
    
         
            +
            Libv8::Node.configure_makefile
         
     | 
| 
       250 
257 
     | 
    
         | 
| 
       251 
258 
     | 
    
         
             
            if enable_config('asan')
         
     | 
| 
       252 
259 
     | 
    
         
             
              $CPPFLAGS.insert(0, " -fsanitize=address ")
         
     | 
    
        data/mini_racer.gemspec
    CHANGED
    
    | 
         @@ -21,7 +21,6 @@ Gem::Specification.new do |spec| 
     | 
|
| 
       21 
21 
     | 
    
         
             
              spec.executables   = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
         
     | 
| 
       22 
22 
     | 
    
         
             
              spec.require_paths = ["lib"]
         
     | 
| 
       23 
23 
     | 
    
         | 
| 
       24 
     | 
    
         
            -
              spec.add_development_dependency "bundler", "~> 1.12"
         
     | 
| 
       25 
24 
     | 
    
         
             
              spec.add_development_dependency "rake", "~> 10.0"
         
     | 
| 
       26 
25 
     | 
    
         
             
              spec.add_development_dependency "minitest", "~> 5.0"
         
     | 
| 
       27 
26 
     | 
    
         
             
              spec.add_development_dependency "rake-compiler"
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,29 +1,15 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: sq_mini_racer
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.2.5.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.5.0.2
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Sam Saffron
         
     | 
| 
       8 
     | 
    
         
            -
            autorequire: 
     | 
| 
      
 8 
     | 
    
         
            +
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2020- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2020-12-16 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
     | 
    
         
            -
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
     | 
    
         
            -
              name: bundler
         
     | 
| 
       15 
     | 
    
         
            -
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       16 
     | 
    
         
            -
                requirements:
         
     | 
| 
       17 
     | 
    
         
            -
                - - "~>"
         
     | 
| 
       18 
     | 
    
         
            -
                  - !ruby/object:Gem::Version
         
     | 
| 
       19 
     | 
    
         
            -
                    version: '1.12'
         
     | 
| 
       20 
     | 
    
         
            -
              type: :development
         
     | 
| 
       21 
     | 
    
         
            -
              prerelease: false
         
     | 
| 
       22 
     | 
    
         
            -
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       23 
     | 
    
         
            -
                requirements:
         
     | 
| 
       24 
     | 
    
         
            -
                - - "~>"
         
     | 
| 
       25 
     | 
    
         
            -
                  - !ruby/object:Gem::Version
         
     | 
| 
       26 
     | 
    
         
            -
                    version: '1.12'
         
     | 
| 
       27 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       28 
14 
     | 
    
         
             
              name: rake
         
     | 
| 
       29 
15 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -75,14 +61,18 @@ extensions: 
     | 
|
| 
       75 
61 
     | 
    
         
             
            - ext/prv_ext_loader/extconf.rb
         
     | 
| 
       76 
62 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       77 
63 
     | 
    
         
             
            files:
         
     | 
| 
      
 64 
     | 
    
         
            +
            - ".dockerignore"
         
     | 
| 
       78 
65 
     | 
    
         
             
            - ".gitignore"
         
     | 
| 
       79 
66 
     | 
    
         
             
            - ".travis.yml"
         
     | 
| 
       80 
67 
     | 
    
         
             
            - CHANGELOG
         
     | 
| 
       81 
68 
     | 
    
         
             
            - CODE_OF_CONDUCT.md
         
     | 
| 
      
 69 
     | 
    
         
            +
            - Dockerfile
         
     | 
| 
       82 
70 
     | 
    
         
             
            - Gemfile
         
     | 
| 
       83 
71 
     | 
    
         
             
            - LICENSE.txt
         
     | 
| 
       84 
72 
     | 
    
         
             
            - README.md
         
     | 
| 
       85 
73 
     | 
    
         
             
            - Rakefile
         
     | 
| 
      
 74 
     | 
    
         
            +
            - azure-pipelines.yml
         
     | 
| 
      
 75 
     | 
    
         
            +
            - azure-template.yml
         
     | 
| 
       86 
76 
     | 
    
         
             
            - bin/console
         
     | 
| 
       87 
77 
     | 
    
         
             
            - bin/setup
         
     | 
| 
       88 
78 
     | 
    
         
             
            - ext/mini_racer_extension/compat.hpp
         
     | 
| 
         @@ -99,7 +89,7 @@ homepage: https://github.com/sqreen/mini_racer 
     | 
|
| 
       99 
89 
     | 
    
         
             
            licenses:
         
     | 
| 
       100 
90 
     | 
    
         
             
            - MIT
         
     | 
| 
       101 
91 
     | 
    
         
             
            metadata: {}
         
     | 
| 
       102 
     | 
    
         
            -
            post_install_message: 
     | 
| 
      
 92 
     | 
    
         
            +
            post_install_message:
         
     | 
| 
       103 
93 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       104 
94 
     | 
    
         
             
            require_paths:
         
     | 
| 
       105 
95 
     | 
    
         
             
            - lib
         
     | 
| 
         @@ -111,13 +101,12 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       111 
101 
     | 
    
         
             
                  version: 1.9.3
         
     | 
| 
       112 
102 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       113 
103 
     | 
    
         
             
              requirements:
         
     | 
| 
       114 
     | 
    
         
            -
              - - " 
     | 
| 
      
 104 
     | 
    
         
            +
              - - ">="
         
     | 
| 
       115 
105 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       116 
     | 
    
         
            -
                  version:  
     | 
| 
      
 106 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
       117 
107 
     | 
    
         
             
            requirements: []
         
     | 
| 
       118 
     | 
    
         
            -
             
     | 
| 
       119 
     | 
    
         
            -
             
     | 
| 
       120 
     | 
    
         
            -
            signing_key: 
         
     | 
| 
      
 108 
     | 
    
         
            +
            rubygems_version: 3.1.3
         
     | 
| 
      
 109 
     | 
    
         
            +
            signing_key:
         
     | 
| 
       121 
110 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       122 
111 
     | 
    
         
             
            summary: Minimal embedded v8 for Ruby
         
     | 
| 
       123 
112 
     | 
    
         
             
            test_files: []
         
     |