Skip to content

Commit a5d5e5d

Browse files
committed
Update README and fix gemspec for 1.0 release.
Expand README with project motivation, quick start example, and links to full documentation. Fix gemspec to reference CHANGES.md (not CHANGES) and correct test_files glob pattern.
1 parent 806b870 commit a5d5e5d

File tree

2 files changed

+46
-12
lines changed

2 files changed

+46
-12
lines changed

README.md

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,58 @@
11
# ruby-bindgen
22

3-
Generate Ruby bindings from C and C++ headers.
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.
44

5-
## Prerequisites
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 battle tested against large C/C++ libraries such as Proj and OpenCv.
66

7-
- Ruby 3.2 or later
8-
- libclang (provided by LLVM/Clang)
7+
For much more information read the extensive [documenation](https://ruby-rice.github.io/ruby-bindgen/).
8+
9+
## Quick Start
10+
11+
Create a config file (`rice-bindings.yaml`):
12+
13+
```yaml
14+
project: my_extension
15+
input: ./include
16+
output: ./ext/generated
17+
format: Rice
18+
19+
match:
20+
- "**/*.hpp"
21+
22+
clang:
23+
args:
24+
- -I./include
25+
- -std=c++17
26+
- -xc++
27+
```
28+
29+
Generate bindings:
30+
31+
```bash
32+
ruby-bindgen rice-bindings.yaml
33+
```
34+
35+
This produces `.cpp`, `.hpp`, and `.ipp` files ready to compile as a Ruby extension.
936

1037
## Install
1138

1239
```console
1340
gem install ruby-bindgen
1441
```
1542

16-
## Run
43+
## Requirements
1744

18-
```bash
19-
ruby-bindgen config.yaml
20-
```
45+
- Ruby 3.2+
46+
- libclang (provided by LLVM/Clang)
2147

2248
## Documentation
2349

24-
Documentation is at [ruby-rice.github.io/ruby-bindgen](https://ruby-rice.github.io/ruby-bindgen/).
50+
Full documentation is at [ruby-rice.github.io/ruby-bindgen](https://ruby-rice.github.io/ruby-bindgen/).
51+
52+
- [C++ (Rice) Getting Started](https://ruby-rice.github.io/ruby-bindgen/cpp/getting_started/)
53+
- [C (FFI) Getting Started](https://ruby-rice.github.io/ruby-bindgen/c/getting_started/)
54+
- [Configuration Reference](https://ruby-rice.github.io/ruby-bindgen/configuration/)
55+
56+
## License
57+
58+
BSD-2-Clause

ruby-bindgen.gemspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
1111

1212
spec.metadata = {
1313
"bug_tracker_uri" => "https://github.com/ruby-rice/ruby-bindgen/issues",
14-
"changelog_uri" => "https://github.com/ruby-rice/ruby-bindgen/blob/main/CHANGES",
14+
"changelog_uri" => "https://github.com/ruby-rice/ruby-bindgen/blob/main/CHANGES.md",
1515
"source_code_uri" => "https://github.com/ruby-rice/ruby-bindgen/tree/v#{spec.version}",
1616
}
1717

@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
2020
spec.require_path = "lib"
2121
spec.bindir = "bin"
2222
spec.executables = ["ruby-bindgen"]
23-
spec.files = Dir['CHANGES',
23+
spec.files = Dir['CHANGES.md',
2424
'LICENSE',
2525
'Rakefile',
2626
'README.md',
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
3030
'lib/**/*',
3131
]
3232

33-
spec.test_files = Dir["test/test_*.rb"]
33+
spec.test_files = Dir["test/*_test.rb"]
3434
spec.required_ruby_version = '>= 3.2.0'
3535
spec.date = Time.now.strftime('%Y-%m-%d')
3636
spec.homepage = 'https://github.com/ruby-rice/ruby-bindgen'

0 commit comments

Comments
 (0)