etc/templates/ruby.erb in ffidb-0.12.0 vs etc/templates/ruby.erb in ffidb-0.13.0
- old
+ new
@@ -11,38 +11,38 @@
ffi_lib [<%= dlopen_paths_for(library).map(&:inspect).join(', ') %>]
<% end %>
<% for enum in @enums[library] || [] %>
<% if enum.comment %>
- # <%= enum.comment %>
+<%= format_comment(enum.comment, ' #') %>
<% end %>
<%= enum.name %> = :int
<% for name, value in enum.values || {} %>
<%= name %> = <%= value %>
<% end %>
<% end %>
<% for struct in @structs[library] || [] %>
<% if struct.comment %>
- # <%= struct.comment %>
+<%= format_comment(struct.comment, ' #') %>
<% end %>
<% if struct.opaque? %>
- <%= struct.name %> = FFI::Pointer
+ <%= struct.name %> = :pointer
<% else %>
class <%= struct.name %> < FFI::Struct
<% for (name, type), i in (struct.fields || {}).each_with_index %>
- <%= i.zero? ? 'layout' : ' '*6 %> :<%= name %>, <%= struct_type(type).inspect %><%= (i == (struct.fields || {}).size-1) ? '' : ',' %> # <%= type %>
+ <%= i.zero? ? 'layout' : ' '*6 %> :<%= name %>, <%= struct_type(type) %><%= (i == (struct.fields || {}).size-1) ? '' : ',' %> # <%= type %>
<% end %>
end
<% end %>
<% end %>
<% for function in @functions[library] || [] %>
<% if function.comment %>
- # <%= function.comment %>
+<%= format_comment(function.comment, ' #') %>
<% end %>
attach_function :<%= function.name %>, [<%=
- function.parameters.each_value.map { |p| param_type(p.type).inspect }.join(', ')
- %>], :<%= param_type(function.type) %>
+ function.parameters.each_value.map { |param| param_type(param.type) }.join(', ')
+ %>], <%= param_type(function.type) %>
<% end %>
end # <%= options[:module] || library&.name&.capitalize || :FFI %>
<% end %>