File tree 1 file changed +14
-17
lines changed
1 file changed +14
-17
lines changed Original file line number Diff line number Diff line change 8
8
9
9
require_relative '../truffle/truffle/cext_preprocessor.rb'
10
10
11
- class Truffle ::CExt ::Preprocessor
11
+ if __FILE__ == $0
12
+ require 'stringio'
12
13
13
- if __FILE__ == $0
14
- require 'stringio'
14
+ file_name = ARGV . first
15
+ original_content = File . read ( file_name )
16
+ output = Truffle ::CEXt ::Preprocessor . patch ( file_name , original_content , Dir . pwd )
15
17
16
- file_name = ARGV . first
17
- original_content = File . read ( file_name )
18
- output = patch ( file_name , original_content , Dir . pwd )
19
-
20
- if ENV [ 'PREPROCESS_DEBUG' ] && original_content != output
21
- patched_file_name = "#{ File . dirname file_name } /.#{ File . basename file_name , '.*' } .patched#{ File . extname file_name } "
22
- File . write patched_file_name , output
23
- $stderr. print `git diff --no-index --color -- #{ file_name } #{ patched_file_name } `
24
- file_name = patched_file_name
25
- end
26
-
27
- expanded_path = File . expand_path ( file_name )
28
- $stdout. puts "#line 1 \" #{ expanded_path } \" "
29
- $stdout. puts output
18
+ if ENV [ 'PREPROCESS_DEBUG' ] && original_content != output
19
+ patched_file_name = "#{ File . dirname file_name } /.#{ File . basename file_name , '.*' } .patched#{ File . extname file_name } "
20
+ File . write patched_file_name , output
21
+ $stderr. print `git diff --no-index --color -- #{ file_name } #{ patched_file_name } `
22
+ file_name = patched_file_name
30
23
end
24
+
25
+ expanded_path = File . expand_path ( file_name )
26
+ $stdout. puts "#line 1 \" #{ expanded_path } \" "
27
+ $stdout. puts output
31
28
end
You can’t perform that action at this time.
0 commit comments