Skip to content

Commit bfacf3a

Browse files
committed
Updated the project template.
1 parent 17261b6 commit bfacf3a

File tree

10 files changed

+108
-33
lines changed

10 files changed

+108
-33
lines changed

Diff for: .gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
# macOS
22
.DS_Store
33

4+
# Visual Studio Code
5+
.vscode/
6+
47
# Editor backup files
58
*~
69

10+
# Pandoc outputs
11+
*.html
12+
713
# Ruby artifacts
814
.bundle
915
.irb_history

Diff for: .ruby-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.7.1

Diff for: CHANGES.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Changelog
2-
=========
1+
# Changelog
32

43
All notable changes to this project will be documented in this file.
54

Diff for: CREDITS.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
Credits
2-
=======
1+
# Credits

Diff for: Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ group :development do
1111
gem 'ffidb'
1212
gem 'rake'
1313
gem 'rspec'
14+
gem 'rubocop', '~> 0.89.1', require: false
1415
gem 'yard'
1516
end

Diff for: Makefile

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This is free and unencumbered software released into the public domain.
2+
3+
VERSION := $(shell cat VERSION)
4+
VERSION_MAJOR = $(word 1,$(subst ., ,$(VERSION)))
5+
VERSION_MINOR = $(word 2,$(subst ., ,$(VERSION)))
6+
VERSION_PATCH = $(word 3,$(subst ., ,$(VERSION)))
7+
8+
BUNDLE = bundle
9+
10+
all: build
11+
12+
build: Rakefile
13+
@$(BUNDLE) exec rake build
14+
15+
test: check
16+
17+
check: Rakefile
18+
@$(BUNDLE) exec rspec
19+
20+
install: build
21+
@$(BUNDLE) exec rake install
22+
23+
uninstall:
24+
@$(BUNDLE) exec rake uninstall
25+
26+
clean:
27+
@rm -Rf *~ *.gem
28+
29+
distclean: clean
30+
31+
mostlyclean: clean
32+
33+
maintainer-clean: clean
34+
35+
.PHONY: all build test check install uninstall
36+
.PHONY: clean distclean mostlyclean maintainer-clean
37+
38+
.SECONDARY:
39+
.SUFFIXES:

Diff for: README.md

+32-26
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,52 @@
1-
OpenXR for Ruby
2-
===============
1+
# OpenXR for Ruby
32

43
[![Project license](https://img.shields.io/badge/license-Public%20Domain-blue.svg)](https://unlicense.org)
4+
[![Ruby compatibility](https://img.shields.io/badge/ruby-2.7%2B-blue)](https://rubygems.org/gems/openxr)
55
[![RubyGems gem](https://img.shields.io/gem/v/openxr.svg)](https://rubygems.org/gems/openxr)
6-
[![Ruby compatibility](https://img.shields.io/badge/ruby-2.7%2B-red)](https://rubygems.org/gems/openxr)
76

87
**OpenXR.rb** implements Ruby bindings for [OpenXR](https://www.khronos.org/openxr/)
98
[1.0](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html),
109
the open standard and cross-platform API for virtual reality (VR) and
1110
augmented reality (AR) hardware.
1211

13-
Installation
14-
------------
15-
16-
$ gem install openxr
17-
18-
Prerequisites
19-
-------------
12+
## Prerequisites
2013

2114
- [Ruby](https://www.ruby-lang.org/en/) 2.7+
2215
with [FFI](https://github.com/ffi/ffi/wiki)
2316

2417
- [OpenXR SDK](https://github.com/KhronosGroup/OpenXR-SDK) 1.0.8+
2518

26-
Examples
27-
--------
19+
## Installation
20+
21+
```bash
22+
$ gem install openxr
23+
```
24+
25+
## Examples
2826

29-
### Loading the library
27+
### Importing the library
3028

31-
require 'openxr'
29+
```ruby
30+
require 'openxr'
31+
```
3232

3333
### Listing extensions
3434

35-
OpenXR::Extension.each do |extension|
36-
puts [extension.name, extension.version].join("\t")
37-
end
35+
```ruby
36+
OpenXR::Extension.each do |extension|
37+
puts [extension.name, extension.version].join("\t")
38+
end
39+
```
3840

3941
### Creating an instance
4042

41-
OpenXR::Instance.create($0) do |instance|
42-
...
43-
end
43+
```ruby
44+
OpenXR::Instance.create($0) do |instance|
45+
...
46+
end
47+
```
4448

45-
Development
46-
-----------
49+
## Development
4750

4851
We recommend Debian 11 (aka [Bullseye](https://www.debian.org/releases/bullseye/))
4952
as a development environment. If you're on a Mac, you can run Debian in a
@@ -52,19 +55,22 @@ or [VirtualBox](https://www.virtualbox.org).
5255

5356
Install the Debian packages for the OpenXR SDK's loader as follows:
5457

55-
$ apt install libopenxr-loader1
58+
```bash
59+
$ apt install libopenxr-loader1
60+
```
5661

5762
That's the only required package, but find related packages of interest using:
5863

59-
$ apt search openxr
64+
```bash
65+
$ apt search openxr
66+
```
6067

6168
In addition, you _will_ need an OpenXR runtime for your hardware. In the
6269
absence of suitable vendor-supplied runtimes, have a look at the open-source
6370
[Monado](https://monado.freedesktop.org) project which supports many common
6471
devices.
6572

66-
See Also
67-
--------
73+
## See Also
6874

6975
- [OpenXR.py](https://github.com/drypy/openxr.py):
7076
OpenXR bindings for Python.

Diff for: Rakefile

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This is free and unencumbered software released into the public domain.
2+
3+
PROJECT = Dir['*.gemspec'].first.sub('.gemspec', '')
4+
VERSION = File.read('VERSION').chomp
5+
6+
require_relative "lib/#{PROJECT}"
7+
8+
require 'rake'
9+
10+
task default: %w(install)
11+
12+
file "#{PROJECT}-#{VERSION}.gem" => %w(build)
13+
14+
desc "Build #{PROJECT}-#{VERSION}.gem from #{PROJECT}.gemspec"
15+
task :build => %W(#{PROJECT}.gemspec VERSION) do |t|
16+
sh "gem build #{t.prerequisites.first}"
17+
end
18+
19+
desc "Install #{PROJECT}-#{VERSION}.gem locally"
20+
task :install => %W(#{PROJECT}-#{VERSION}.gem VERSION) do |t|
21+
sh "gem install #{t.prerequisites.first}"
22+
end

Diff for: TODO.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
To-Dos
2-
======
1+
# To-Dos
32

43
- Improve the README.

Diff for: lib/openxr.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# This is free and unencumbered software released into the public domain.
22

3+
##
4+
# OpenXR for Ruby.
35
module OpenXR; end
46

7+
require_relative 'openxr/version'
8+
59
require_relative 'openxr/abi'
610
require_relative 'openxr/api'
711

@@ -16,7 +20,6 @@ module OpenXR; end
1620
require_relative 'openxr/space'
1721
require_relative 'openxr/swapchain'
1822
require_relative 'openxr/system'
19-
require_relative 'openxr/version'
2023

2124
module OpenXR
2225
##

0 commit comments

Comments
 (0)