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 +4 -4
- data/lib/ruby2js/converter.rb +9 -1
- data/lib/ruby2js/converter/return.rb +6 -0
- data/lib/ruby2js/version.rb +1 -1
- data/ruby2js.gemspec +4 -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: 79e49d9decdc351797ffa745dcf061e5b8459220
|
4
|
+
data.tar.gz: 2185f836dfd3ef45b6e6dded9d972f5eb9305c1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e99ee1f1b99d9d6aa7d635cc50f436743fb43a9fc76be5c10b7a31ddb55fe6b4909aeade802473a0312db7d2150b112dce967cbad18c8860a9ec537af13fd9de
|
7
|
+
data.tar.gz: ee5b1422ff8b09c8de8f953c11d42a94f18894570e2b6883032376f22597bd4b1f3eba79bdd81df02b7288b51ee41e1d334044bf18924a3996be9e558e124950
|
data/lib/ruby2js/converter.rb
CHANGED
@@ -98,7 +98,15 @@ module Ruby2JS
|
|
98
98
|
@comments[ast] -= list
|
99
99
|
|
100
100
|
list.map do |comment|
|
101
|
-
comment.text.
|
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
|
data/lib/ruby2js/version.rb
CHANGED
data/ruby2js.gemspec
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
|
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 =
|
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.
|
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.
|
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.
|
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.
|