You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
3
3
Wrapping C and C++ libraries by hand for use in Ruby has traditionally been a long, arduous task. For large, complex libraries it can take months. As a result, many C/C++ libraries are either never exposed to Ruby or their bindings quickly become outdated, especially in scientific and technical domains.
4
4
5
-
`ruby-bindgen's` solves this problem by automatically creating bindings from C and C++ header files. It can even generate a CMake build system if needed. It has been battletested against large C/C++ libraries such as Proj and OpenCv.
5
+
`ruby-bindgen` solves this problem by automatically creating bindings from C and C++ header files. It can even generate a CMake build system if needed. It has been battle-tested against large C/C++ libraries such as Proj and OpenCV.
6
6
7
-
For much more information read the extensive [documenation](https://ruby-rice.github.io/ruby-bindgen/).
7
+
For much more information, read the extensive [documentation](https://ruby-rice.github.io/ruby-bindgen/).
define_method<%= signature %>("<%= name %>", &<%= qualified_parent %>::<%= cursor.spelling %>,
122
+
<%= all_args.join(", ") %>)
124
123
```
125
124
126
125
## Key Classes
127
126
128
127
### Config
129
128
130
-
The `Config` class loads the YAML configuration file and resolves platform-specific settings. It detects whether to use `clang:` or `clang-cl:` based on `RUBY_PLATFORM` (`mswin`and `mingw`use `clang-cl:`), resolves relative paths against the config file's directory, and provides hash-like access to all configuration values.
129
+
The `Config` class loads the YAML configuration file and resolves platform-specific settings. It detects whether to use `clang:` or `clang-cl:` based on `RUBY_PLATFORM` (`mswin`uses `clang-cl:`; Linux, macOS, and MinGW use `clang:`), resolves relative paths against the config file's directory, and provides hash-like access to all configuration values.
131
130
132
131
### Inputter
133
132
@@ -177,10 +176,9 @@ The `Namer` class converts C++ names to Ruby conventions:
177
176
178
177
`ruby-bindgen` extends ffi-clang's classes using Ruby refinements in `lib/ruby-bindgen/refinements/`:
179
178
180
-
-**Cursor** - adds `ruby_name`, `cruby_name`, `qualified_name`, and methods for finding children by kind
181
-
-**Type** - adds `fully_qualified_spelling` for reconstructing C++ type names with proper namespace qualification and template arguments
179
+
-**Cursor** - adds `ruby_name`, `cruby_name`, and `anonymous_definer`
180
+
-**Type** - adds `fully_qualified_name` compatibility and helpers for reconstructing C++ type names with proper namespace qualification and template arguments
182
181
-**String** - adds `camelize` and `underscore` for name conversion
183
-
-**SourceRange** - adds `text` for extracting source text from a range
Copy file name to clipboardExpand all lines: docs/index.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
3
3
Wrapping C and C++ libraries by hand is a long, arduous task. For large, complex libraries it can take months. As a result, many C/C++ libraries are either never exposed to Ruby or their bindings quickly become outdated, especially in scientific and technical domains.
4
4
5
-
`ruby-bindgen` and its ecosystem solve this problem by automating binding generation. For simpler libraries, it can generate ready to use bindings. For more complex libraries, it can also generate bindings but some [customizations](#customization) may be needed.
5
+
`ruby-bindgen` and its ecosystem solve this problem by automating binding generation. For simpler libraries, it can generate ready-to-use bindings. For more complex libraries, it can also generate bindings but some [customizations](#customization) may be needed.
6
6
7
-
As an example, there are older, hand-crafted Ruby [bindings](https://github.com/ruby-opencv/ruby-opencv) for [OpenCV](https://opencv.org/). However, they are based on the C API which was subsequently remove by the OpenCV project. `ruby-bindgen` was used to create new OpenCv[bindings](https://github.com/cfis/opencv-ruby) based on the new C++ API. The bindings wrap over [1,000](https://cfis.github.io/opencv-ruby/) C++ classes and almost [10,000](https://cfis.github.io/opencv-ruby/) method calls. Imagine having to do that by hand!
7
+
As an example, there are older, hand-crafted Ruby [bindings](https://github.com/ruby-opencv/ruby-opencv) for [OpenCV](https://opencv.org/). However, they are based on the C API which was subsequently removed by the OpenCV project. `ruby-bindgen` was used to create new OpenCV[bindings](https://github.com/cfis/opencv-ruby) based on the new C++ API. The bindings wrap over [1,000](https://cfis.github.io/opencv-ruby/) C++ classes and almost [10,000](https://cfis.github.io/opencv-ruby/) method calls. Imagine having to do that by hand!
8
8
9
9
## Ecosystem
10
10
`ruby-bindgen` is part of the C/C++ to Ruby toolchain.
0 commit comments