ruby2js 3.1.1 → 3.1.2

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
  SHA256:
3
- metadata.gz: c818d7a2fb520e13fea6b323e1c0b0fc1feb696d4fc4acdd2eff72a5de29ca22
4
- data.tar.gz: 161e0c26b4f648c85522dc6f54d5802b3feae071427790f20df9354ef742a49c
3
+ metadata.gz: 7bde5c5bd57b0599c6d259986d4b3ccfe3ca2a055d6d11c80730666ca4172860
4
+ data.tar.gz: e45ed225f7a1826de460f0a6370ff525465e138fe5c7feb5d8881dcb243a8ff0
5
5
  SHA512:
6
- metadata.gz: 575f68cebfd725c1d43b3eb0ee2aea8174b867b42839b5c1ec237999fdf68a2be6251a4130fb6a4a438597c55e874c41448ebb745eb60e311713e49c9bc4cb0c
7
- data.tar.gz: a8ea6eb2cdbae3a2ac24cad9101a6496a7b2f3d7865cbda1535bfb6d034694cd618d5c3b843db49267e29cb87f7acbc1bd6552da17bfb4115a0a4f6f31151050
6
+ metadata.gz: b44e98bc72e235b40a53745027ed24abba5eff043ccc0923014284301ef65210a34c043878aa35d86f8234c7246e119c92f8f21ac10ec175dbd932aaa8ee7cae
7
+ data.tar.gz: 743fd931691369c969df41a88cc19fa4a7bdf465afede108bce34fbfeddfa6ef74583aea260031f38ceb4aea37fecbfa4ca0cda95f48bcb6cd15d8c1dc95b3c4
@@ -31,6 +31,8 @@ module Ruby2JS
31
31
  @vue_reactive = []
32
32
  @vue_filter_functions = false
33
33
 
34
+ @vue_setup = false
35
+
34
36
  super
35
37
 
36
38
  @exclude_methods << @vue_methods
@@ -49,6 +51,29 @@ module Ruby2JS
49
51
  end
50
52
  end
51
53
 
54
+ # if options[:vue_h] is set, return an array of nodes
55
+ def process(node)
56
+ return super if @vue_setup
57
+ @vue_setup = true
58
+ if @vue_h
59
+ if node.type == :begin
60
+ begin
61
+ @vue_apply = true
62
+ process s(:send, s(:block, s(:send, nil, :proc),
63
+ s(:args, s(:shadowarg, :$_)),
64
+ s(:begin, s(:lvasgn, :$_, s(:array)), process(node),
65
+ s(:return, s(:gvar, :$_)))), :[])
66
+ ensure
67
+ @vue_apply = nil
68
+ end
69
+ else
70
+ process s(:array, node)
71
+ end
72
+ else
73
+ process node
74
+ end
75
+ end
76
+
52
77
  # Example conversion
53
78
  # before:
54
79
  # (class (const nil :Foo) (const nil :Vue) nil)
@@ -2,7 +2,7 @@ module Ruby2JS
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 3
4
4
  MINOR = 1
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby2js
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Ruby
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-09 00:00:00.000000000 Z
11
+ date: 2019-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser