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.exists?(yaml_path) extend YamlExtension parse_yaml else extend PlaintextExtension if File.exists?(plaintext_path) parse_plaintext end end end
def plaintext_path
def plaintext_path denormalized_path = File.join(@base_dir, 'VERSION') absolute_path = File.expand_path(denormalized_path) absolute_path.gsub(Dir.getwd + File::SEPARATOR, '') 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 denormalized_path = File.join(@base_dir, 'VERSION.yml') absolute_path = File.expand_path(denormalized_path) absolute_path.gsub(Dir.getwd + File::SEPARATOR, '') end