ruby2js 2.1.22 → 2.1.23

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: cfd51a5b122b0cc53549b8fb3c44ae847f1183b6
4
- data.tar.gz: befcb08dff3c11d5570fab15f3a2a462f01b442c
3
+ metadata.gz: 79e49d9decdc351797ffa745dcf061e5b8459220
4
+ data.tar.gz: 2185f836dfd3ef45b6e6dded9d972f5eb9305c1e
5
5
  SHA512:
6
- metadata.gz: 3894c89a49fd835b781c2187e0495950742895297d8f5d3e6987064a18ab3c795ea1fb9d4780d6ab042397f8f7bb97a9ed1170cf3ae90dd7f63ef42917bd57e2
7
- data.tar.gz: fd8740c03765bf694e9099d35a42f896feea4714644c68a201c1532d5f55aee52674f7a79697938cd7d60ab20ce787ad8857ab93bfca89f00a3addfad9ea06d7
6
+ metadata.gz: e99ee1f1b99d9d6aa7d635cc50f436743fb43a9fc76be5c10b7a31ddb55fe6b4909aeade802473a0312db7d2150b112dce967cbad18c8860a9ec537af13fd9de
7
+ data.tar.gz: ee5b1422ff8b09c8de8f953c11d42a94f18894570e2b6883032376f22597bd4b1f3eba79bdd81df02b7288b51ee41e1d334044bf18924a3996be9e558e124950
@@ -98,7 +98,15 @@ module Ruby2JS
98
98
  @comments[ast] -= list
99
99
 
100
100
  list.map do |comment|
101
- comment.text.sub(/^#/, '//') + "\n"
101
+ if comment.text.start_with? '=begin'
102
+ if comment.text.include? '*/'
103
+ comment.text.sub(/\A=begin/, '').sub(/^=end\Z/, '').gsub(/^/, '//')
104
+ else
105
+ comment.text.sub(/\A=begin/, '/*').sub(/^=end\Z/, '*/')
106
+ end
107
+ else
108
+ comment.text.sub(/^#/, '//') + "\n"
109
+ end
102
110
  end
103
111
  end
104
112
 
@@ -49,6 +49,12 @@ module Ruby2JS
49
49
  end
50
50
  end
51
51
  block.push node
52
+ elsif block.last.type == :lvasgn
53
+ block.push s(:return, s(:lvar, block.last.children.first))
54
+ elsif block.last.type == :ivasgn
55
+ block.push s(:return, s(:ivar, block.last.children.first))
56
+ elsif block.last.type == :cvasgn
57
+ block.push s(:return, s(:cvar, block.last.children.first))
52
58
  end
53
59
 
54
60
  if block.length == 1
@@ -2,7 +2,7 @@ module Ruby2JS
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 2
4
4
  MINOR = 1
5
- TINY = 22
5
+ TINY = 23
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -1,9 +1,10 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: ruby2js 2.1.22 ruby lib
2
+ lib = File.expand_path('../lib/', __FILE__)
3
+ $:.unshift lib unless $:.include?(lib)
3
4
 
4
5
  Gem::Specification.new do |s|
5
6
  s.name = "ruby2js".freeze
6
- s.version = "2.1.22"
7
+ s.version = Ruby2JS::VERSION::STRING
7
8
 
8
9
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
10
  s.require_paths = ["lib".freeze]
@@ -15,7 +16,7 @@ Gem::Specification.new do |s|
15
16
  s.homepage = "http://github.com/rubys/ruby2js".freeze
16
17
  s.licenses = ["MIT".freeze]
17
18
  s.required_ruby_version = Gem::Requirement.new(">= 1.9.3".freeze)
18
- s.rubygems_version = "2.6.11".freeze
19
+ s.rubygems_version = "2.6.14".freeze
19
20
  s.summary = "Minimal yet extensible Ruby to JavaScript conversion.".freeze
20
21
 
21
22
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby2js
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.22
4
+ version: 2.1.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Ruby
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  version: '0'
127
127
  requirements: []
128
128
  rubyforge_project:
129
- rubygems_version: 2.6.11
129
+ rubygems_version: 2.6.14
130
130
  signing_key:
131
131
  specification_version: 4
132
132
  summary: Minimal yet extensible Ruby to JavaScript conversion.