Class: Debian::Versions::Development

Inherits:
Base
  • Object
show all
Extended by:
MSPRelease::Helpers
Defined in:
lib/msp_release/debian.rb

Constant Summary

Constants included from MSPRelease::Helpers

MSPRelease::Helpers::PROJECT_FILE

Class Method Summary collapse

Instance Method Summary collapse

Methods included from MSPRelease::Helpers

author, changelog, data, data=, data_exists?, fail_if_modified_wc, fail_if_push_pending, git_version, load_data, msp_version, on_release_branch?, remove_data, save_data, time, time_rfc, timestamp

Methods inherited from Base

new_from_string, new_if_matches

Constructor Details

#initialize(timestamp, hash, branch_name) ⇒ Development

Returns a new instance of Development.



96
97
98
99
100
# File 'lib/msp_release/debian.rb', line 96

def initialize(timestamp, hash, branch_name)
  @timestamp   = timestamp
  @hash        = hash
  @branch_name = branch_name
end

Class Method Details

.new_from_working_directory(branch_name, commit_hash) ⇒ Object



90
91
92
93
# File 'lib/msp_release/debian.rb', line 90

def new_from_working_directory(branch_name, commit_hash)
  safe_branch_name = branch_name.gsub(/[^a-z0-9]/i, ".")
  new(timestamp, commit_hash[0...6], safe_branch_name)
end

.patternObject



86
87
88
# File 'lib/msp_release/debian.rb', line 86

def pattern
  /^([0-9]+)-git\+([a-f0-9]+)~([a-z0-9\+\.]+)$/
end

Instance Method Details

#bumpObject



106
107
108
# File 'lib/msp_release/debian.rb', line 106

def bump
  Stable.new(@major, @minor, @bugfix, "1")
end

#to_sObject



102
103
104
# File 'lib/msp_release/debian.rb', line 102

def to_s
  "#{@timestamp}-git+#{@hash}~#{@branch_name}"
end