ruby2js 2.1.4 → 2.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruby2js/filter/vue.rb +24 -5
- data/lib/ruby2js/version.rb +1 -1
- data/ruby2js.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45fd791073d23f08643df9e169c0ed9bb5080878
|
4
|
+
data.tar.gz: 56b543e32dd116330c516de800655109be51069f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60b63eb3edfb9a0d688af957ecf51ae34b5d1456b670d0b78cb3e0bcfaa867b0a553a1d1e1ef747934c0a2993fa5aa1eb3ea18ad46c6fbf4cedb51c17a22b264
|
7
|
+
data.tar.gz: 6f10eb6ff3e67f255c8125b2ea88bd200f77507b60b1c2df1945a929945688c7318e719a533788e6ded68447a93bf1af3e36b30bc6e8693c6fd60750289e9095
|
data/lib/ruby2js/filter/vue.rb
CHANGED
@@ -15,6 +15,11 @@ module Ruby2JS
|
|
15
15
|
:beforeUpdate, :updated, :beforeDestroy, :destroyed
|
16
16
|
]
|
17
17
|
|
18
|
+
VUE_PROPERTIES = [
|
19
|
+
:$data, :$props, :$el, :$options, :$parent, :$root, :$children,
|
20
|
+
:$slots, :$scopedSlots, :$refs, :$isServer, :$attrs, :$listeners
|
21
|
+
]
|
22
|
+
|
18
23
|
def initialize(*args)
|
19
24
|
@vue_h = nil
|
20
25
|
@vue_self = nil
|
@@ -469,9 +474,16 @@ module Ruby2JS
|
|
469
474
|
hash['nativeOn']['change']
|
470
475
|
|
471
476
|
if value and value.type == :ivar
|
472
|
-
hash[
|
477
|
+
hash[:domProps]['value'] ||= value
|
473
478
|
hash[:attrs].delete('value')
|
474
479
|
|
480
|
+
# disable control until script is ready
|
481
|
+
unless hash[:domProps]['disabled'] or hash[:attrs]['disabled']
|
482
|
+
hash[:domProps]['disabled'] = s(:false)
|
483
|
+
hash[:attrs]['disabled'] = s(:true)
|
484
|
+
end
|
485
|
+
|
486
|
+
# define event handler to update ivar on input events
|
475
487
|
if not onChange
|
476
488
|
hash['on']['input'] ||=
|
477
489
|
s(:block, s(:send, nil, :proc), s(:args, s(:arg, :event)),
|
@@ -485,9 +497,16 @@ module Ruby2JS
|
|
485
497
|
checked = hash[:attrs]['checked']
|
486
498
|
|
487
499
|
if checked and checked.type == :ivar
|
488
|
-
hash[
|
500
|
+
hash[:domProps]['checked'] ||= checked
|
489
501
|
hash[:attrs].delete('checked')
|
490
502
|
|
503
|
+
# disable control until script is ready
|
504
|
+
unless hash[:domProps]['disabled'] or hash[:attrs]['disabled']
|
505
|
+
hash[:domProps]['disabled'] = s(:false)
|
506
|
+
hash[:attrs]['disabled'] = s(:true)
|
507
|
+
end
|
508
|
+
|
509
|
+
# define event handler to update ivar on click events
|
491
510
|
if not onChange
|
492
511
|
hash['on']['click'] ||=
|
493
512
|
s(:block, s(:send, nil, :proc), s(:args),
|
@@ -760,11 +779,11 @@ module Ruby2JS
|
|
760
779
|
s(:attr, s(:attr, s(:self), :$props), node.children[0].to_s[2..-1])
|
761
780
|
end
|
762
781
|
|
763
|
-
# expand $options to this.$options
|
782
|
+
# expand instance properties like $options to this.$options
|
764
783
|
def on_gvar(node)
|
765
784
|
return super unless @vue_self
|
766
|
-
if node.children[0]
|
767
|
-
node.updated :attr, [s(:self),
|
785
|
+
if VUE_PROPERTIES.include? node.children[0]
|
786
|
+
node.updated :attr, [s(:self), node.children[0]]
|
768
787
|
else
|
769
788
|
super
|
770
789
|
end
|
data/lib/ruby2js/version.rb
CHANGED
data/ruby2js.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: ruby2js 2.1.
|
2
|
+
# stub: ruby2js 2.1.5 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "ruby2js".freeze
|
6
|
-
s.version = "2.1.
|
6
|
+
s.version = "2.1.5"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
10
10
|
s.authors = ["Sam Ruby".freeze]
|
11
|
-
s.date = "2017-09-
|
11
|
+
s.date = "2017-09-09"
|
12
12
|
s.description = " The base package maps Ruby syntax to JavaScript semantics.\n Filters may be provided to add Ruby-specific or framework specific\n behavior.\n".freeze
|
13
13
|
s.email = "rubys@intertwingly.net".freeze
|
14
14
|
s.files = ["README.md".freeze, "lib/ruby2js".freeze, "lib/ruby2js.rb".freeze, "lib/ruby2js/cgi.rb".freeze, "lib/ruby2js/converter".freeze, "lib/ruby2js/converter.rb".freeze, "lib/ruby2js/converter/arg.rb".freeze, "lib/ruby2js/converter/args.rb".freeze, "lib/ruby2js/converter/array.rb".freeze, "lib/ruby2js/converter/begin.rb".freeze, "lib/ruby2js/converter/block.rb".freeze, "lib/ruby2js/converter/blockpass.rb".freeze, "lib/ruby2js/converter/boolean.rb".freeze, "lib/ruby2js/converter/break.rb".freeze, "lib/ruby2js/converter/case.rb".freeze, "lib/ruby2js/converter/casgn.rb".freeze, "lib/ruby2js/converter/class.rb".freeze, "lib/ruby2js/converter/const.rb".freeze, "lib/ruby2js/converter/cvar.rb".freeze, "lib/ruby2js/converter/cvasgn.rb".freeze, "lib/ruby2js/converter/def.rb".freeze, "lib/ruby2js/converter/defined.rb".freeze, "lib/ruby2js/converter/defs.rb".freeze, "lib/ruby2js/converter/dstr.rb".freeze, "lib/ruby2js/converter/for.rb".freeze, "lib/ruby2js/converter/hash.rb".freeze, "lib/ruby2js/converter/if.rb".freeze, "lib/ruby2js/converter/in.rb".freeze, "lib/ruby2js/converter/ivar.rb".freeze, "lib/ruby2js/converter/ivasgn.rb".freeze, "lib/ruby2js/converter/kwbegin.rb".freeze, "lib/ruby2js/converter/literal.rb".freeze, "lib/ruby2js/converter/logical.rb".freeze, "lib/ruby2js/converter/masgn.rb".freeze, "lib/ruby2js/converter/module.rb".freeze, "lib/ruby2js/converter/next.rb".freeze, "lib/ruby2js/converter/nil.rb".freeze, "lib/ruby2js/converter/nthref.rb".freeze, "lib/ruby2js/converter/opasgn.rb".freeze, "lib/ruby2js/converter/prototype.rb".freeze, "lib/ruby2js/converter/regexp.rb".freeze, "lib/ruby2js/converter/return.rb".freeze, "lib/ruby2js/converter/self.rb".freeze, "lib/ruby2js/converter/send.rb".freeze, "lib/ruby2js/converter/super.rb".freeze, "lib/ruby2js/converter/sym.rb".freeze, "lib/ruby2js/converter/undef.rb".freeze, "lib/ruby2js/converter/until.rb".freeze, "lib/ruby2js/converter/untilpost.rb".freeze, "lib/ruby2js/converter/var.rb".freeze, "lib/ruby2js/converter/vasgn.rb".freeze, "lib/ruby2js/converter/while.rb".freeze, "lib/ruby2js/converter/whilepost.rb".freeze, "lib/ruby2js/converter/xstr.rb".freeze, "lib/ruby2js/execjs.rb".freeze, "lib/ruby2js/filter".freeze, "lib/ruby2js/filter/angular-resource.rb".freeze, "lib/ruby2js/filter/angular-route.rb".freeze, "lib/ruby2js/filter/angularrb.rb".freeze, "lib/ruby2js/filter/camelCase.rb".freeze, "lib/ruby2js/filter/functions.rb".freeze, "lib/ruby2js/filter/jquery.rb".freeze, "lib/ruby2js/filter/minitest-jasmine.rb".freeze, "lib/ruby2js/filter/react.rb".freeze, "lib/ruby2js/filter/require.rb".freeze, "lib/ruby2js/filter/return.rb".freeze, "lib/ruby2js/filter/rubyjs.rb".freeze, "lib/ruby2js/filter/strict.rb".freeze, "lib/ruby2js/filter/underscore.rb".freeze, "lib/ruby2js/filter/vue.rb".freeze, "lib/ruby2js/rails.rb".freeze, "lib/ruby2js/serializer.rb".freeze, "lib/ruby2js/sinatra.rb".freeze, "lib/ruby2js/version.rb".freeze, "ruby2js.gemspec".freeze]
|
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: 2.1.
|
4
|
+
version: 2.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Ruby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|