execjs-xtrn 1.0.0 → 1.0.1
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/FarMenu.ini +10 -0
 - data/README.md +4 -0
 - data/lib/execjs/node/node_modules/split/index.js +3 -3
 - data/lib/execjs/wsh/repl.js +23 -7
 - data/lib/execjs/xtrn/child.rb +1 -0
 - data/lib/execjs/xtrn/engine.rb +2 -0
 - data/lib/execjs/xtrn/node.rb +2 -0
 - data/lib/execjs/xtrn/nvm.rb +4 -0
 - data/lib/execjs/xtrn/version.rb +1 -1
 - data/lib/execjs/xtrn/wsh.rb +2 -0
 - data/lib/execjs/xtrn.rb +27 -9
 - metadata +4 -4
 - data/lib/execjs/xtrn/init.rb +0 -25
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 4abcfd3f47329826a53b863835a51592f1dc1030
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: e96571ef15e4fe0b91a86a2e461cbdef62e42f29
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 2842042b3e8091e0caa59f5943635579c673c291d11cd831afb42e08797b26b8a55045c79c72a5e7b886a8ba3037fcf10b42b92c5a37b1faaadcbea8d08cb672
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 6328d3e668706b3282a4050ff614050254a0c20f9923219a8d56ff53631f17fdf6776bb4f7496b0e9585f5c819848a234087344353cf99b071ba6cac8f404f4c
         
     | 
    
        data/FarMenu.ini
    ADDED
    
    
    
        data/README.md
    CHANGED
    
    | 
         @@ -146,6 +146,10 @@ The following packages have been tested to run under ExecJS::Xtrn out-of-box: 
     | 
|
| 
       146 
146 
     | 
    
         
             
              * [UglifyJS2](https://github.com/mishoo/UglifyJS2) via [uglifier](https://github.com/lautis/uglifier)
         
     | 
| 
       147 
147 
     | 
    
         
             
              * [Handlebars](http://handlebarsjs.com/) via [handlebars_assets](https://github.com/leshill/handlebars_assets) gem
         
     | 
| 
       148 
148 
     | 
    
         | 
| 
      
 149 
     | 
    
         
            +
            CoffeeScript since v1.9.0 introduces new incompatibility:
         
     | 
| 
      
 150 
     | 
    
         
            +
            it uses `Object.create` that is missing from WSH.
         
     | 
| 
      
 151 
     | 
    
         
            +
            To fix it, `Object.create` was manually defined in ExecJS::Xtrn::Wsh.
         
     | 
| 
      
 152 
     | 
    
         
            +
             
     | 
| 
       149 
153 
     | 
    
         
             
            ## Testing
         
     | 
| 
       150 
154 
     | 
    
         | 
| 
       151 
155 
     | 
    
         
             
            After git checkout, required NPM modules must be installed. Simply run:
         
     | 
| 
         @@ -36,8 +36,8 @@ function split (matcher, mapper, options) { 
     | 
|
| 
       36 
36 
     | 
    
         
             
                  stream.queue(piece)
         
     | 
| 
       37 
37 
     | 
    
         
             
              }
         
     | 
| 
       38 
38 
     | 
    
         | 
| 
       39 
     | 
    
         
            -
              function next (stream, buffer) { 
     | 
| 
       40 
     | 
    
         
            -
                var pieces = (soFar + buffer).split(matcher)
         
     | 
| 
      
 39 
     | 
    
         
            +
              function next (stream, buffer) {
         
     | 
| 
      
 40 
     | 
    
         
            +
                var pieces = ((soFar != null ? soFar : '') + buffer).split(matcher)
         
     | 
| 
       41 
41 
     | 
    
         
             
                soFar = pieces.pop()
         
     | 
| 
       42 
42 
     | 
    
         | 
| 
       43 
43 
     | 
    
         
             
                if (maxLength && soFar.length > maxLength)
         
     | 
| 
         @@ -53,7 +53,7 @@ function split (matcher, mapper, options) { 
     | 
|
| 
       53 
53 
     | 
    
         
             
                next(this, decoder.write(b))
         
     | 
| 
       54 
54 
     | 
    
         
             
              },
         
     | 
| 
       55 
55 
     | 
    
         
             
              function () {
         
     | 
| 
       56 
     | 
    
         
            -
                if(decoder.end) 
     | 
| 
      
 56 
     | 
    
         
            +
                if(decoder.end)
         
     | 
| 
       57 
57 
     | 
    
         
             
                  next(this, decoder.end())
         
     | 
| 
       58 
58 
     | 
    
         
             
                if(soFar != null)
         
     | 
| 
       59 
59 
     | 
    
         
             
                  emit(this, soFar)
         
     | 
    
        data/lib/execjs/wsh/repl.js
    CHANGED
    
    | 
         @@ -5,13 +5,8 @@ var 
     | 
|
| 
       5 
5 
     | 
    
         
             
              i = w.StdIn,
         
     | 
| 
       6 
6 
     | 
    
         
             
              o = w.StdErr
         
     | 
| 
       7 
7 
     | 
    
         | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
       10 
     | 
    
         
            -
              var
         
     | 
| 
       11 
     | 
    
         
            -
                fso = new ActiveXObject("Scripting.FileSystemObject"),
         
     | 
| 
       12 
     | 
    
         
            -
                j2 = fso.GetParentFolderName(w.ScriptFullName)+"/json2.js"
         
     | 
| 
       13 
     | 
    
         
            -
              new Function(fso.OpenTextFile(j2).ReadAll())()
         
     | 
| 
       14 
     | 
    
         
            -
            }()
         
     | 
| 
      
 8 
     | 
    
         
            +
            json2()
         
     | 
| 
      
 9 
     | 
    
         
            +
            oCreate()
         
     | 
| 
       15 
10 
     | 
    
         | 
| 
       16 
11 
     | 
    
         
             
            while(!i.AtEndOfStream)
         
     | 
| 
       17 
12 
     | 
    
         
             
              o.WriteLine(wrap(i.ReadLine()))
         
     | 
| 
         @@ -38,4 +33,25 @@ function ok(v) 
     | 
|
| 
       38 
33 
     | 
    
         
             
              return 'undefined'==typeof v ? {} : {ok: v}
         
     | 
| 
       39 
34 
     | 
    
         
             
            }
         
     | 
| 
       40 
35 
     | 
    
         | 
| 
      
 36 
     | 
    
         
            +
            // Load JSON2
         
     | 
| 
      
 37 
     | 
    
         
            +
            function json2()
         
     | 
| 
      
 38 
     | 
    
         
            +
            {
         
     | 
| 
      
 39 
     | 
    
         
            +
              var
         
     | 
| 
      
 40 
     | 
    
         
            +
                fso = new ActiveXObject("Scripting.FileSystemObject"),
         
     | 
| 
      
 41 
     | 
    
         
            +
                j2 = fso.GetParentFolderName(w.ScriptFullName)+"/json2.js"
         
     | 
| 
      
 42 
     | 
    
         
            +
              new Function(fso.OpenTextFile(j2).ReadAll())()
         
     | 
| 
      
 43 
     | 
    
         
            +
            }
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
            // Fix for CoffeeScript 1.9+
         
     | 
| 
      
 46 
     | 
    
         
            +
            function oCreate()
         
     | 
| 
      
 47 
     | 
    
         
            +
            {
         
     | 
| 
      
 48 
     | 
    
         
            +
              if(Object.create) return
         
     | 
| 
      
 49 
     | 
    
         
            +
              Object.create=function(proto)
         
     | 
| 
      
 50 
     | 
    
         
            +
              {
         
     | 
| 
      
 51 
     | 
    
         
            +
                f=function(){}
         
     | 
| 
      
 52 
     | 
    
         
            +
                f.prototype=proto
         
     | 
| 
      
 53 
     | 
    
         
            +
                return new f
         
     | 
| 
      
 54 
     | 
    
         
            +
              }
         
     | 
| 
      
 55 
     | 
    
         
            +
            }
         
     | 
| 
      
 56 
     | 
    
         
            +
             
     | 
| 
       41 
57 
     | 
    
         
             
            }()
         
     | 
    
        data/lib/execjs/xtrn/child.rb
    CHANGED
    
    
    
        data/lib/execjs/xtrn/engine.rb
    CHANGED
    
    
    
        data/lib/execjs/xtrn/node.rb
    CHANGED
    
    
    
        data/lib/execjs/xtrn/nvm.rb
    CHANGED
    
    
    
        data/lib/execjs/xtrn/version.rb
    CHANGED
    
    
    
        data/lib/execjs/xtrn/wsh.rb
    CHANGED
    
    
    
        data/lib/execjs/xtrn.rb
    CHANGED
    
    | 
         @@ -1,9 +1,27 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            %w(
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
      
 1 
     | 
    
         
            +
            %w(wsh nvm).each{|x| require_relative "xtrn/#{x}"}
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module ExecJS::Xtrn
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
              Engines=[Nvm, Node, Wsh]
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
              class << self
         
     | 
| 
      
 8 
     | 
    
         
            +
                attr_accessor :engine
         
     | 
| 
      
 9 
     | 
    
         
            +
              end
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
              # Find best available Engine
         
     | 
| 
      
 12 
     | 
    
         
            +
              self.engine=Engines.find{|k| k::Valid} || Engine
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
              # Install into ExecJS
         
     | 
| 
      
 15 
     | 
    
         
            +
              def self.init
         
     | 
| 
      
 16 
     | 
    
         
            +
                slf=self
         
     | 
| 
      
 17 
     | 
    
         
            +
                sc=(class<<ExecJS;self;end)
         
     | 
| 
      
 18 
     | 
    
         
            +
                Engine.methods(false).each{|m| sc.instance_eval{define_method(m){|*args| slf.engine.send m, *args }}}
         
     | 
| 
      
 19 
     | 
    
         
            +
              end
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
              init
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
              def self.stats
         
     | 
| 
      
 24 
     | 
    
         
            +
                Hash[([Child, Engine]+Engines).map{|k| [k.name.sub(/.*\W/, ''), k.stats]}]
         
     | 
| 
      
 25 
     | 
    
         
            +
              end
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: execjs-xtrn
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.0.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Stas Ukolov
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2015-03-20 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     | 
| 
         @@ -89,6 +89,7 @@ extra_rdoc_files: [] 
     | 
|
| 
       89 
89 
     | 
    
         
             
            files:
         
     | 
| 
       90 
90 
     | 
    
         
             
            - .gitignore
         
     | 
| 
       91 
91 
     | 
    
         
             
            - .travis.yml
         
     | 
| 
      
 92 
     | 
    
         
            +
            - FarMenu.ini
         
     | 
| 
       92 
93 
     | 
    
         
             
            - Gemfile
         
     | 
| 
       93 
94 
     | 
    
         
             
            - LICENSE.txt
         
     | 
| 
       94 
95 
     | 
    
         
             
            - README.md
         
     | 
| 
         @@ -101,7 +102,6 @@ files: 
     | 
|
| 
       101 
102 
     | 
    
         
             
            - lib/execjs/xtrn.rb
         
     | 
| 
       102 
103 
     | 
    
         
             
            - lib/execjs/xtrn/child.rb
         
     | 
| 
       103 
104 
     | 
    
         
             
            - lib/execjs/xtrn/engine.rb
         
     | 
| 
       104 
     | 
    
         
            -
            - lib/execjs/xtrn/init.rb
         
     | 
| 
       105 
105 
     | 
    
         
             
            - lib/execjs/xtrn/node.rb
         
     | 
| 
       106 
106 
     | 
    
         
             
            - lib/execjs/xtrn/nvm.rb
         
     | 
| 
       107 
107 
     | 
    
         
             
            - lib/execjs/xtrn/version.rb
         
     | 
| 
         @@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       133 
133 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       134 
134 
     | 
    
         
             
            requirements: []
         
     | 
| 
       135 
135 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       136 
     | 
    
         
            -
            rubygems_version: 2.0. 
     | 
| 
      
 136 
     | 
    
         
            +
            rubygems_version: 2.0.14
         
     | 
| 
       137 
137 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       138 
138 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       139 
139 
     | 
    
         
             
            summary: 'Proof-of-concept: make ExecJS fast even without therubyracer'
         
     | 
    
        data/lib/execjs/xtrn/init.rb
    DELETED
    
    | 
         @@ -1,25 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            module ExecJS::Xtrn
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
              Engines=[Nvm, Node, Wsh]
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
              class << self
         
     | 
| 
       6 
     | 
    
         
            -
                attr_accessor :engine
         
     | 
| 
       7 
     | 
    
         
            -
              end
         
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
              # Find best available Engine
         
     | 
| 
       10 
     | 
    
         
            -
              self.engine=Engines.find{|k| k::Valid} || Engine
         
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
              # Install into ExecJS
         
     | 
| 
       13 
     | 
    
         
            -
              def self.init
         
     | 
| 
       14 
     | 
    
         
            -
                slf=self
         
     | 
| 
       15 
     | 
    
         
            -
                sc=(class<<ExecJS;self;end)
         
     | 
| 
       16 
     | 
    
         
            -
                Engine.methods(false).each{|m| sc.instance_eval{define_method(m){|*args| slf.engine.send m, *args }}}
         
     | 
| 
       17 
     | 
    
         
            -
              end
         
     | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
       19 
     | 
    
         
            -
              init
         
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
     | 
    
         
            -
              def self.stats
         
     | 
| 
       22 
     | 
    
         
            -
                Hash[([Child, Engine]+Engines).map{|k| [k.name.sub(/.*\W/, ''), k.stats]}]
         
     | 
| 
       23 
     | 
    
         
            -
              end
         
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
            end
         
     |