Class: Semverify::VersionFile
- Inherits:
-
Object
- Object
- Semverify::VersionFile
- Defined in:
- lib/semverify/version_file.rb
Overview
Represents a file that contains the gem's version and can update the version
Use VersionFileFactory.find create a VersionFile instance.
Instance Attribute Summary collapse
-
#content_after ⇒ String
readonly
The content in the version file before the version.
-
#content_before ⇒ String
readonly
The content in the version file before the version.
-
#path ⇒ String
readonly
The path to the file relative to the current directory.
-
#version ⇒ Semverify::IncrementableSemver
The version from the version file.
Instance Method Summary collapse
-
#initialize(path, content_before, version, content_after) ⇒ VersionFile
constructor
private
Create an VersionFile instance.
Constructor Details
#initialize(path, content_before, version, content_after) ⇒ VersionFile
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Create an VersionFile instance
Use VersionFileFactory.find create a VersionFile instance.
27 28 29 30 31 32 33 34 35 |
# File 'lib/semverify/version_file.rb', line 27 def initialize(path, content_before, version, content_after) raise Semverify::Error, 'version must be an IncrementableSemver' unless version.is_a?(Semverify::IncrementableSemver) @path = path @content_before = content_before @version = version @content_after = content_after end |
Instance Attribute Details
#content_after ⇒ String (readonly)
The content in the version file before the version
81 82 83 |
# File 'lib/semverify/version_file.rb', line 81 def content_after @content_after end |
#content_before ⇒ String (readonly)
The content in the version file before the version
57 58 59 |
# File 'lib/semverify/version_file.rb', line 57 def content_before @content_before end |
#path ⇒ String (readonly)
The path to the file relative to the current directory
46 47 48 |
# File 'lib/semverify/version_file.rb', line 46 def path @path end |
#version ⇒ Semverify::IncrementableSemver
The version from the version file
70 71 72 |
# File 'lib/semverify/version_file.rb', line 70 def version @version end |