File tree Expand file tree Collapse file tree 3 files changed +25
-2
lines changed
core/src/main/java/org/jruby/runtime/load Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -250,7 +250,12 @@ public static SuffixType getSuffixTypeForLoad(final String[] fileHolder) {
250250 }
251251
252252 public static boolean isSourceExt (String file ) {
253- return file .endsWith (".rb" );
253+ for (Suffix suffix : Suffix .SOURCES ) {
254+ if (file .endsWith (suffix .extension )) {
255+ return true ;
256+ }
257+ }
258+ return false ;
254259 }
255260
256261 public static boolean isLibraryExt (String file ) {
Original file line number Diff line number Diff line change @@ -71,5 +71,6 @@ namespace :spec do
7171
7272 permute_specs "jrubyc" , compile_flags do |t |
7373 t . pattern = 'spec/jrubyc/**/*_spec.rb'
74+ t . ruby_opts << "-Xaot.loadClasses"
7475 end
7576end
Original file line number Diff line number Diff line change 11require_relative '../spec_helper'
22
3- describe "JRuby::Compiler.compile_argv" do
3+ describe "Ruby code compiled with JRuby::Compiler.compile_argv" do
44
55 def compile_files ( files )
66 JRuby ::Compiler . compile_argv ( files )
@@ -77,4 +77,21 @@ def compile_files(files)
7777 expect ( res ) . to eql [ true , { :foo => :bar , :baz => 0 } ]
7878 end
7979
80+ describe "can be required" do
81+ before ( :each ) do
82+ @old_loaded_features = $LOADED_FEATURES. dup
83+ end
84+
85+ after ( :each ) do
86+ $LOADED_FEATURES. replace ( @old_loaded_features )
87+ end
88+
89+ it "using base filename" do
90+ puts File . exist? ( File . join ( FILES_DIR , 'symbol_proc.class' ) )
91+ require File . join ( FILES_DIR , 'symbol_proc.class' )
92+
93+ expect ( $symbol_proc_result ) . to_not be nil
94+ expect ( $symbol_proc_result ) . to eql [ 1 , 2 , 3 ]
95+ end
96+ end
8097end
You can’t perform that action at this time.
0 commit comments