Skip to content

Commit b342510

Browse files
committed
📝 More documentation
1 parent b26d84c commit b342510

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ end
162162

163163
Your `version.rb` file now abides the Ruby convention of directory / path matching the namespace / class!
164164

165-
## Epoch Usage (Epoch Semantic Versioning)
165+
## Epoch Usage (Epoch Semantic Versioning, as of version 1.1.7)
166166

167167
In the standard `bundle gem my_lib` code you get the following in `lib/my_lib/version.rb`:
168168

@@ -182,6 +182,12 @@ module MyLib
182182
end
183183
```
184184

185+
The Epoch and Major versions are derived from the formula:
186+
187+
```
188+
{EPOCH * 1000 + MAJOR}.MINOR.PATCH
189+
```
190+
185191
This will start your library with the following version segments:
186192

187193
* `epoch = 0`
@@ -190,12 +196,6 @@ This will start your library with the following version segments:
190196
* `patch = 0`
191197
* `pre = nil`
192198

193-
The Epoch and Major versions are derived from the formula:
194-
195-
```
196-
{EPOCH * 1000 + MAJOR}.MINOR.PATCH
197-
```
198-
199199
And the segments are defined as:
200200

201201
```
@@ -205,7 +205,7 @@ MINOR: Increment when you add functionality in a backwards-compatible manner.
205205
PATCH: Increment when you make backwards-compatible bug fixes.
206206
```
207207

208-
Therefore if you set your version number to:
208+
Therefore, if you set your version number to:
209209

210210
```ruby
211211
VERSION = "27016.42.86-pre.7"
@@ -215,11 +215,11 @@ You will get the following version segments:
215215

216216
```
217217
{
218-
epoch: 27,
219-
major: 16,
220-
minor: 42,
221-
patch: 86,
222-
pre: "pre-7",
218+
epoch: 27,
219+
major: 16,
220+
minor: 42,
221+
patch: 86,
222+
pre: "pre-7",
223223
}
224224
```
225225

@@ -349,9 +349,11 @@ RSpec.describe(MyLib::Version) do
349349
expect(described_class).to(have_version_as_string)
350350
expect(described_class.to_s).to(be_a(String))
351351
expect(described_class).to(have_major_as_integer)
352+
expect(described_class).to(have_epoch_as_integer)
352353
expect(described_class).to(have_minor_as_integer)
353354
expect(described_class).to(have_patch_as_integer)
354355
expect(described_class).to(have_pre_as_nil_or_string)
356+
# This would be %i[epoch major minor patch pre] for epoch version schemes
355357
expect(described_class.to_h.keys).to(match_array(%i[major minor patch pre]))
356358
expect(described_class.to_a).to(be_a(Array))
357359
end
@@ -405,7 +407,8 @@ This Library adheres to [![Epoch Semantic Versioning][📌semver-img]][📌semve
405407
Violations of this scheme should be reported as bugs.
406408
Specifically, if a minor or patch version is released that breaks backward compatibility,
407409
a new version should be immediately released that restores compatibility.
408-
Breaking changes to the public API, including dropping a supported platform (i.e. minor version of Ruby), will only be introduced with new major versions.
410+
Breaking changes to the public API, including dropping a supported platform (i.e. minor version of Ruby),
411+
will only be introduced with new major versions.
409412
Epoch will only be bumped if there are dramatic changes, and that is not expected to happen ever.
410413

411414
### 📌 Is "Platform Support" part of the public API?

0 commit comments

Comments
 (0)