class Jeweler::VersionHelper
def bump_major
def bump_major @major += 1 @minor = 0 @patch = 0 @build = nil end
def bump_minor
def bump_minor @minor += 1 @patch = 0 @build = nil end
def bump_patch
def bump_patch @patch += 1 @build = nil end
def initialize(base_dir)
def initialize(base_dir) self.base_dir = base_dir if File.exist?(yaml_path) extend YamlExtension parse_yaml else extend PlaintextExtension parse_plaintext if File.exist?(plaintext_path) end end
def path_to_version_file(filename)
def path_to_version_file(filename) denormalized_path = File.join(@base_dir, filename) absolute_path = File.expand_path(denormalized_path) absolute_path.gsub(Dir.getwd + File::SEPARATOR, '') end
def plaintext_path
def plaintext_path path_to_version_file('VERSION') end
def to_s
def to_s [major, minor, patch, build].compact.join('.') end
def update_to(major, minor, patch, build = nil)
def update_to(major, minor, patch, build = nil) @major = major @minor = minor @patch = patch @build = build end
def yaml_path
def yaml_path path_to_version_file('VERSION.yml') end