Class: Tagged

Inherits:
Version show all
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

Instance Method Summary collapse

Methods inherited from Version

all, #checkout, #edge?

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_latestObject

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

#tagObject (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.

Returns:

  • (Boolean)


170
171
172
# File 'lib/ratatui_ruby/devtools/tasks/website/version.rb', line 170

def latest?
  @is_latest
end

#nameObject

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

#refObject

Git tag for archive extraction.



157
158
159
# File 'lib/ratatui_ruby/devtools/tasks/website/version.rb', line 157

def ref
  @tag
end

#semverObject

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

#slugObject

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

#typeObject

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