Class: Tagged
- Defined in:
- lib/ratatui_ruby/devtools/tasks/website/version.rb
Overview
A Git release tag version.
Each release gets a tag like v0.6.0. The documentation website shows only the latest patch for each minor version.
Instance Attribute Summary collapse
-
#is_latest ⇒ Object
Set by IndexPage to enable “(latest)” label in menus.
-
#tag ⇒ Object
readonly
The raw Git tag for archive extraction.
Instance Method Summary collapse
-
#initialize(tag) ⇒ Tagged
constructor
Creates a Tagged version.
-
#latest? ⇒ Boolean
Identifies this for “(latest)” labels in menus.
-
#name ⇒ Object
Shows exact version in menus.
-
#ref ⇒ Object
Git tag for archive extraction.
-
#semver ⇒ Object
Enables sorting and grouping by semantic version rules.
-
#slug ⇒ Object
Groups patch releases under one URL.
-
#type ⇒ Object
Distinguishes released docs from trunk in conditionals.
Methods inherited from Version
Constructor Details
#initialize(tag) ⇒ Tagged
Creates a Tagged version.
- tag
-
Git tag string.
135 136 137 |
# File 'lib/ratatui_ruby/devtools/tasks/website/version.rb', line 135 def initialize(tag) @tag = tag end |
Instance Attribute Details
#is_latest ⇒ Object
Set by IndexPage to enable “(latest)” label in menus.
167 168 169 |
# File 'lib/ratatui_ruby/devtools/tasks/website/version.rb', line 167 def is_latest @is_latest end |
#tag ⇒ Object (readonly)
The raw Git tag for archive extraction.
130 131 132 |
# File 'lib/ratatui_ruby/devtools/tasks/website/version.rb', line 130 def tag @tag end |
Instance Method Details
#latest? ⇒ Boolean
Identifies this for “(latest)” labels in menus.
170 171 172 |
# File 'lib/ratatui_ruby/devtools/tasks/website/version.rb', line 170 def latest? @is_latest end |
#name ⇒ Object
Shows exact version in menus. Users know which patch they’re viewing.
147 148 149 |
# File 'lib/ratatui_ruby/devtools/tasks/website/version.rb', line 147 def name @tag end |
#ref ⇒ Object
Git tag for archive extraction.
157 158 159 |
# File 'lib/ratatui_ruby/devtools/tasks/website/version.rb', line 157 def ref @tag end |
#semver ⇒ Object
Enables sorting and grouping by semantic version rules.
162 163 164 |
# File 'lib/ratatui_ruby/devtools/tasks/website/version.rb', line 162 def semver Gem::Version.new(@tag.sub(/^v/, "")) end |
#slug ⇒ Object
Groups patch releases under one URL. Docs for v0.6.0 and v0.6.1 both live at /v0.6/.
141 142 143 144 |
# File 'lib/ratatui_ruby/devtools/tasks/website/version.rb', line 141 def slug segments = semver.segments "v#{segments[0]}.#{segments[1]}" end |
#type ⇒ Object
Distinguishes released docs from trunk in conditionals.
152 153 154 |
# File 'lib/ratatui_ruby/devtools/tasks/website/version.rb', line 152 def type :version end |