File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
_tools/ruby_h_to_go/lib/ruby_h_to_go Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ def write_type_definitions_to_go_file
43
43
end
44
44
45
45
type_definitions . each do |definition |
46
+ next unless target_header_file? ( definition . filepath )
47
+
46
48
definition . write_go_file ( dist_dir )
47
49
end
48
50
end
@@ -53,6 +55,8 @@ def write_struct_definitions_to_go_file
53
55
end
54
56
55
57
struct_definitions . each do |definition |
58
+ next unless target_header_file? ( definition . filepath )
59
+
56
60
definition . write_go_file ( dist_dir )
57
61
end
58
62
end
@@ -73,6 +77,8 @@ def write_function_definitions_to_go_file
73
77
end
74
78
75
79
function_definitions . each do |definition |
80
+ next unless target_header_file? ( definition . filepath )
81
+
76
82
definition . write_go_file ( dist_dir )
77
83
end
78
84
end
@@ -109,5 +115,11 @@ def go_fmt
109
115
system ( "go fmt" , exception : true )
110
116
end
111
117
end
118
+
119
+ # @param filename [String]
120
+ # @return [Boolean]
121
+ def target_header_file? ( filename )
122
+ File . extname ( filename ) == ".h"
123
+ end
112
124
end
113
125
end
You can’t perform that action at this time.
0 commit comments