class Hookers::Changelog::Project
Attributes
name[RW]
uri[RW]
Public Class Methods
discover()
click to toggle source
# File lib/hookers/changelog/project.rb, line 17 def self.discover remote_uri = %x[git remote -v].split(/\n/).first.split(/\s+/).at(1) return nil if remote_uri.nil? remote_uri.gsub!(/(git@|git:\/\/)/, "https://") remote_uri.gsub!(/:(?!\/\/)/, "/") remote_uri.gsub!(/\.git$/, "") name = remote_uri.split(/\//).at(-1) new(name, remote_uri) end
new(name, uri)
click to toggle source
# File lib/hookers/changelog/project.rb, line 8 def initialize(name, uri) self.name = name self.uri = uri end
Public Instance Methods
commit_uri(id)
click to toggle source
# File lib/hookers/changelog/project.rb, line 13 def commit_uri(id) "#{self.uri}/commit/#{id}" end