ruby2js 2.1.8 → 2.1.9

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: dc7aa6e17a303aa03f78a4f25bf01ec99dde4f34
4
- data.tar.gz: 583531eec09eecf50076131ff8affccc95839b80
3
+ metadata.gz: bcfebf8a01ec762ebf625014b80727dafb2e22a8
4
+ data.tar.gz: 53775267829213753c29c2ec6927e2ab9f89d917
5
5
  SHA512:
6
- metadata.gz: 6510a902460ad8073f710bfb2facb174121dcefc3884a9a69a65ee8ec18c43c4848d29c9e8055c0da10ebe3b181ae816e88093202ced6ec72f7ef7a5303e9fe4
7
- data.tar.gz: '09cc922113d70a4fb096ef7f73e7e752d18fd0d68ba65be974b55cb8f35db12ecef63fd3f84dcf1307731905c3a92657c07a1ffff0575ff314cde5843b355052'
6
+ metadata.gz: 59b5bc183dec990415f7dc5cdc6592ebc288408ffaf97d8e370a207b589bf224ca5583091220338143c0501a362caaee39e70ece0444a37fb1789ea2fc1ff5ef
7
+ data.tar.gz: 1fcaa9f1f1f15663eeaa3bb2f35cdd9910862415646dc70938f0ccbbebebd7e8402901a7356426a0b68c48c16de24738067a9969729b21c025db094099dd0f3c
@@ -316,13 +316,13 @@ module Ruby2JS
316
316
  # expand 'wunderbar' like method calls
317
317
  def on_send(node)
318
318
  if not @vue_h
319
- # enable React filtering within React class method calls or
319
+ # enable React filtering within Vue class method calls or
320
320
  # React component calls
321
321
  if
322
322
  node.children.first == s(:const, nil, :Vue)
323
323
  then
324
324
  begin
325
- vue_h, @vue_h = @vue_h, :$h
325
+ vue_h, @vue_h = @vue_h, [s(:self), :$createElement]
326
326
  return on_send(node)
327
327
  ensure
328
328
  @vue_h = vue_h
@@ -414,25 +414,20 @@ module Ruby2JS
414
414
  expr.children[1].type == :str
415
415
  then
416
416
  left = expr.children[1]
417
- right = expr.children[2] || s(:str, '')
418
-
419
- unless right.type == :str
420
- right = s(:or, right, s(:str, ''))
421
- end
417
+ right = expr.children[2] || s(:nil)
422
418
 
423
419
  expr = expr.updated(nil,
424
420
  [expr.children[0], left, right])
425
- elsif expr.type != :str
426
- expr = s(:or, expr, s(:str, ''))
427
421
  end
428
422
 
429
- value = s(:send, s(:str, values.join(' ')), :+, expr)
430
- pairs.unshift s(:pair, s(:sym, :class), value)
423
+ hash[:class] = s(:array,
424
+ *values.join(' ').split(' ').map {|str| s(:str, str)},
425
+ expr)
431
426
  end
432
427
  elsif [:hash, :array].include? expr.type
433
428
  hash[:class] = expr
434
429
  else
435
- pairs.unshift s(:pair, s(:sym, :class), expr)
430
+ hash[:class] = s(:array, expr)
436
431
  end
437
432
  else
438
433
  hash[:class] = s(:array,
@@ -605,7 +600,11 @@ module Ruby2JS
605
600
  @vue_apply = false
606
601
 
607
602
  # emit $h (createElement) call
608
- element = node.updated :send, [nil, @vue_h, *process_all(args)]
603
+ if @vue_h.instance_of? Array
604
+ element = node.updated :send, [*@vue_h, *process_all(args)]
605
+ else
606
+ element = node.updated :send, [nil, @vue_h, *process_all(args)]
607
+ end
609
608
  else
610
609
  # calls to $h (createElement) which contain a block
611
610
  #
@@ -666,8 +665,13 @@ module Ruby2JS
666
665
  node.children[0] == s(:const, nil, :Vue)
667
666
  then
668
667
  # explicit calls to Vue.createElement
669
- element = node.updated nil, [nil, :$h,
670
- *process_all(node.children[2..-1])]
668
+ if @vue_h.instance_of? Array
669
+ element = node.updated nil, [*@vue_h,
670
+ *process_all(node.children[2..-1])]
671
+ else
672
+ element = node.updated nil, [nil, @vue_h,
673
+ *process_all(node.children[2..-1])]
674
+ end
671
675
 
672
676
  if @vue_apply
673
677
  # if apply is set, emit code that pushes result
@@ -2,7 +2,7 @@ module Ruby2JS
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 2
4
4
  MINOR = 1
5
- TINY = 8
5
+ TINY = 9
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/ruby2js.gemspec CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: ruby2js 2.1.8 ruby lib
2
+ # stub: ruby2js 2.1.9 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "ruby2js".freeze
6
- s.version = "2.1.8"
6
+ s.version = "2.1.9"
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-16"
11
+ s.date = "2017-09-17"
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.8
4
+ version: 2.1.9
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-16 00:00:00.000000000 Z
11
+ date: 2017-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser