Skip to content

Commit 15122c6

Browse files
committed
Update .gitignore and README.md
* Descriptions for C extension stuff * README list of `mygem` occurences * `.gitignore` Visual Studio and `tmp/`
1 parent 5b6ea23 commit 15122c6

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# VSCode
22
/.vscode/
3+
# Visual Studio
4+
/.vs/
35
# JetBrains
46
/.idea/
57

68
# Ruby
9+
/tmp/
710
/Gemfile.lock
811
# https://github.com/ruby/gem_rbs_collection
912
/.gem_rbs_collection/

README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
# `template-ruby-gem`
22

33
Built upon [`ParadoxV5/mygem`](https://github.com/ParadoxV5/mygem),
4-
this is a moderate yet thorough template for a Ruby Gem project.
5-
Note: just `gem`. The `rake` is for invoking minitest (See [§Rakefile](#Rakefile).
4+
this is a moderate yet thorough template for a Ruby C extension project.
5+
Note: just `gem`. The `rake` is for test-building and invoking minitest (See [§Rakefile](#Rakefile).
66

77

88
## How to Setup
99

1010
* Rename all occurrences of `mygem`, lower- or title-case, with the name of your epic Gem.
11+
* [`ext/mygem/`](ext/mygem/)
12+
* [`ext/mygem/mygem.c` and Line 3](ext/mygem/mygem.c#L3)
13+
* [`ext/mygem/extconf.rb` Line 6](ext/mygem/extconf.rb#L6)
1114
* [`lib/mygem/`](lib/mygem/)
1215
* [`lib/mygem.rb` and Line 1 & 2](lib/mygem.rb#L1-2)
1316
* [`lib/mygem/version.rb Line 3`](lib/mygem/version.rb#L3)
1417
* [`sig/mygem.rbs` and Line 1](sig/mygem.rbs#L1)
1518
* [`test/mygem_test.rb` and Lines 3 & 4](test/mygem_test.rb#L3-4)
1619
* [`mygem.gemspec` and Lines 2, 5 & 7](mygem.gemspec#L2-L7)
20+
* [`Rakefile` Lines 12 & 15](Rakefile#L12-L15)
1721
* Update the [`gemspec`](mygem.gemspec) with your Gem’s information. (See [§`*.gemspec`](#gemspec))
1822
* Overwrite this `README` with an introduction to your epic project.
1923
* Replace *this template’s* [`LICENSE.txt`](LICENSE.txt) with
@@ -28,9 +32,15 @@ Note: just `gem`. The `rake` is for invoking minitest (See [§Rakefile](#Rakefil
2832
Follow [the convention](https://guides.rubygems.org/patterns/#file-names) regarding the file structure:
2933

3034

35+
### [`ext/**`](ext/)
36+
37+
This is the folder where people put their C sources under a sub-folder,
38+
including the [init. function](ext/mygem/mygem.c) and the [config script](ext/mygem/extconf.rb).
39+
Third-party headers can be in `ext/include` for organization.
40+
3141
### [`lib/**`](lib/)
3242

33-
This is the folder where people put their Gem sources, starting with their
43+
This is the folder where people put their Ruby sources, starting with their
3444
[entry script](lib/mygem.rb) right under `lib` and the rest in a sub-folder.
3545

3646

@@ -72,6 +82,8 @@ See [§License](#License)
7282

7383
The cool li’l testing toolkit minitest does not come with an executable,
7484
but rather a Ruby API that generates a handful of [Rake](https://github.com/ruby/rake) tasks.
85+
While we are at it, we might as well include [`rake-compiler`](https://github.com/rake-compiler/rake-compiler/actions)
86+
to automate compiling C during development.
7587

7688

7789
### [`README.md`](README.md)
@@ -87,17 +99,17 @@ Inside this folder are small but thoroughly configured ([minimal modification](#
8799
#### [`documentation.yml`](.github/workflows/documentation.yml)
88100
Generate [YARD docs](https://yardoc.org) and
89101
[publish to GitHub Pages](https://github.blog/changelog/2022-07-27-github-pages-custom-github-actions-workflows-beta)
90-
after the `main` branch receives an update in the Ruby sources ([`lib/`](lib/)) folder.
102+
after the `main` branch receives an update in the sources ([`ext/`](ext/) & [`lib/`](lib/)) folders.
91103

92104
#### [`test.yml`](.github/workflows/test.yml)
93105
Run tests independently (`rake test:isolated`) after any branch receives an update
94106
on the [`.gemspec`](mygem.gemspec) (in the event of library version changes) or
95-
in the sources ([`lib`](lib/)) or test ([`test`](test/)) folders.
107+
in the sources ([`ext`](ext/) & [`lib/`](lib/)) or test ([`test`](test/)) folders.
96108

97109
#### [`type_check.yml`](.github/workflows/type_check.yml)
98110
Check your RBS appendices (see [§sig/**](#sig)) after any branch receives an update
99111
on the [`.gemspec`](mygem.gemspec) (in the event of library version changes) or
100-
in the sources ([`lib`](lib/)) or signature ([`sig`](sig/)) folders.
112+
in the Ruby ([`lib`](lib/)) or signature ([`sig`](sig/)) folders.
101113

102114
#### [`package.yml`](.github/workflows/package.yml)
103115
Publish to RubyGems after the GitHub repo publishes a Release. This workflow requires a “Push rubygem”

0 commit comments

Comments
 (0)