Commit 11adfa6d authored by Cool Fire's avatar Cool Fire

Use built-in jruby parser when running jruby

parent f1af5dea
Pipeline #253 passed with stages
in 1 minute and 55 seconds
...@@ -54,7 +54,7 @@ jruby_1.7: ...@@ -54,7 +54,7 @@ jruby_1.7:
- master - master
script: script:
- ruby -v - ruby -v
- JRUBY_OPTS="-J-Djruby.launch.inproc=true" ruby scheck.rb - ruby scheck.rb --jruby
jruby_9.1: jruby_9.1:
image: jruby:9.1 image: jruby:9.1
...@@ -65,7 +65,7 @@ jruby_9.1: ...@@ -65,7 +65,7 @@ jruby_9.1:
- master - master
script: script:
- ruby -v - ruby -v
- JRUBY_OPTS="-J-Djruby.launch.inproc=true" ruby scheck.rb - ruby scheck.rb --jruby
rubocop: rubocop:
stage: linting stage: linting
......
#!/usr/bin/env ruby #!/usr/bin/env ruby
jruby = ARGV.length == 1
ret = 0 ret = 0
require 'jruby' if jruby
Dir["**/*.rb"].each do |f| Dir["**/*.rb"].each do |f|
res = String.new
if jruby
begin
JRuby.parse(File.read(f))
res = 'Syntax OK'
rescue SyntaxError => e
puts e.to_s
end
else
res = `ruby -c #{f}` res = `ruby -c #{f}`
end
if res.empty? if res.empty?
ret = 1 ret = 1
puts "#{f} FAILED!" puts "#{f} FAILED!"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment