File tree Expand file tree Collapse file tree 6 files changed +25
-4
lines changed
framework_jrebel_jar_directory/dependency.jar
jre_memory_calculator_jar_directory/dependency.jar Expand file tree Collapse file tree 6 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,9 @@ def jrebel_configured?(root_path)
5959 end
6060
6161 def jars_with_jrebel_configured? ( root_path )
62- ( root_path + '**/*.jar' ) . glob . any? { |jar | !`unzip -l "#{ jar } " | grep "rebel-remote\\ .xml$"` . strip . empty? }
62+ ( root_path + '**/*.jar' )
63+ . glob . reject ( &:directory? )
64+ . any? { |jar | !`unzip -l "#{ jar } " | grep "rebel-remote\\ .xml$"` . strip . empty? }
6365 end
6466
6567 def lib_name
Original file line number Diff line number Diff line change @@ -71,7 +71,8 @@ def supports?
7171 def actual_class_count ( root )
7272 ( root + '**/*.class' ) . glob . count +
7373 ( root + '**/*.groovy' ) . glob . count +
74- ( root + '**/*.jar' ) . glob ( File ::FNM_DOTMATCH ) . inject ( 0 ) { |a , e | a + archive_class_count ( e ) }
74+ ( root + '**/*.jar' ) . glob ( File ::FNM_DOTMATCH ) . reject ( &:directory? )
75+ . inject ( 0 ) { |a , e | a + archive_class_count ( e ) }
7576 end
7677
7778 def archive_class_count ( archive )
Original file line number Diff line number Diff line change 4444
4545 it 'does not detect when not enabled' ,
4646 app_fixture : 'framework_jrebel_app_simple' do
47+
4748 expect ( component . detect ) . to be_nil
4849 end
4950 end
5051
5152 it 'downloads the JRebel JAR and the native agent' ,
52- app_fixture : 'framework_jrebel_app_simple' ,
53+ app_fixture : 'framework_jrebel_app_simple' ,
5354 cache_fixture : 'stub-jrebel-archive.zip' do
5455
5556 component . compile
5960 end
6061
6162 it 'adds correct arguments to JAVA_OPTS' ,
62- app_fixture : 'framework_jrebel_app_simple' ,
63+ app_fixture : 'framework_jrebel_app_simple' ,
6364 cache_fixture : 'stub-jrebel-archive.zip' do
6465
6566 allow ( component ) . to receive ( :architecture ) . and_return ( 'x86_64' )
7172 expect ( java_opts ) . to include ( '-Drebel.cloud.platform=cloudfoundry/java-buildpack' )
7273 end
7374
75+ it 'does not throw an error when a directory ends in .jar' ,
76+ app_fixture : 'framework_jrebel_jar_directory' do
77+
78+ expect_any_instance_of ( described_class ) . not_to receive ( :` ) . with ( start_with ( "unzip -l #{ app_dir + 'directory.jar' } " ) )
79+
80+ component . detect
81+ end
82+
7483end
Original file line number Diff line number Diff line change 8888 'Configuration: $CALCULATED_MEMORY && JAVA_OPTS="$JAVA_OPTS $CALCULATED_MEMORY"' )
8989 end
9090
91+ it 'does not throw an error when a directory ends in .jar' ,
92+ app_fixture : 'jre_memory_calculator_jar_directory' ,
93+ cache_fixture : 'stub-memory-calculator.tar.gz' do
94+
95+ expect_any_instance_of ( described_class ) . not_to receive ( :` ) . with ( start_with ( "unzip -l #{ app_dir + 'directory.jar' } " ) )
96+
97+ component . compile
98+ end
99+
91100end
You can’t perform that action at this time.
0 commit comments