Class: VersionBoss::Gem::VersionFile
- Inherits:
-
Object
- Object
- VersionBoss::Gem::VersionFile
- Defined in:
- lib/version_boss/gem/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 ⇒ VersionBoss::IncrementableVersion
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.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/version_boss/gem/version_file.rb', line 28 def initialize(path, content_before, version, content_after) unless version.is_a?(VersionBoss::Gem::IncrementableVersion) raise VersionBoss::Error, 'version must be an IncrementableVersion' end @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
83 84 85 |
# File 'lib/version_boss/gem/version_file.rb', line 83 def content_after @content_after end |
#content_before ⇒ String (readonly)
The content in the version file before the version
59 60 61 |
# File 'lib/version_boss/gem/version_file.rb', line 59 def content_before @content_before end |
#path ⇒ String (readonly)
The path to the file relative to the current directory
48 49 50 |
# File 'lib/version_boss/gem/version_file.rb', line 48 def path @path end |
#version ⇒ VersionBoss::IncrementableVersion
The version from the version file
72 73 74 |
# File 'lib/version_boss/gem/version_file.rb', line 72 def version @version end |