execjs-xtrn 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ea23f93401560e87c30a5e58f9b859021af74fe
4
- data.tar.gz: ff537afc206da297fc767c8364605c64b4bb3822
3
+ metadata.gz: 4abcfd3f47329826a53b863835a51592f1dc1030
4
+ data.tar.gz: e96571ef15e4fe0b91a86a2e461cbdef62e42f29
5
5
  SHA512:
6
- metadata.gz: 305a66d5d0f545b7e328715436436a2b32ed3a21a5363d5d67d1835b147f105e84005dda3a63e5f3a275a88c4bef07483c87ef91f3abb29aa8f0edde7ce8bb09
7
- data.tar.gz: 6dd4f27cd97237f42e8fd6d2a98ba2ee6a700e8105be90066cc0cd7ca46eeadc79e2f8ae358599086d948a331f82407e9efcf4d8590d3728a0b23d383969492e
6
+ metadata.gz: 2842042b3e8091e0caa59f5943635579c673c291d11cd831afb42e08797b26b8a55045c79c72a5e7b886a8ba3037fcf10b42b92c5a37b1faaadcbea8d08cb672
7
+ data.tar.gz: 6328d3e668706b3282a4050ff614050254a0c20f9923219a8d56ff53631f17fdf6776bb4f7496b0e9585f5c819848a234087344353cf99b071ba6cac8f404f4c
data/FarMenu.ini ADDED
@@ -0,0 +1,10 @@
1
+ i: Bundle install
2
+ bundle install -new_console:c
3
+ n: Npm install
4
+ bundle exec rake npm -new_console:c
5
+ --:
6
+ t: Run tests
7
+ bundle exec rake -new_console:c
8
+ --:
9
+ b: Build
10
+ bundle exec rake build -new_console:c
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)
@@ -5,13 +5,8 @@ var
5
5
  i = w.StdIn,
6
6
  o = w.StdErr
7
7
 
8
- !function()
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
  }()
@@ -1,4 +1,5 @@
1
1
  require 'json'
2
+ require_relative 'version'
2
3
 
3
4
  class ExecJS::Xtrn::Child
4
5
 
@@ -1,3 +1,5 @@
1
+ require_relative 'child'
2
+
1
3
  class ExecJS::Xtrn::Error < RuntimeError
2
4
  end
3
5
 
@@ -1,3 +1,5 @@
1
+ require_relative 'engine'
2
+
1
3
  class ExecJS::Xtrn::Node < ExecJS::Xtrn::Engine
2
4
 
3
5
  Run={
@@ -1,4 +1,8 @@
1
+ #
1
2
  # Interface to Node's vm
3
+ #
4
+ require_relative 'node'
5
+
2
6
  class ExecJS::Xtrn::Nvm < ExecJS::Xtrn::Node
3
7
 
4
8
  def exec(code)
@@ -1,5 +1,5 @@
1
1
  module ExecJS
2
2
  module Xtrn
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
@@ -1,3 +1,5 @@
1
+ require_relative 'engine'
2
+
1
3
  class ExecJS::Xtrn::Wsh < ExecJS::Xtrn::Engine
2
4
 
3
5
  Run={
data/lib/execjs/xtrn.rb CHANGED
@@ -1,9 +1,27 @@
1
- %w(
2
- version
3
- engine
4
- child
5
- wsh
6
- node
7
- nvm
8
- init
9
- ).each{|x| require_relative "xtrn/#{x}"}
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.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: 2014-10-21 00:00:00.000000000 Z
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.3
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'
@@ -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