mirror of
https://github.com/jimeh/build-emacs-for-macos.git
synced 2026-02-19 08:26:39 +00:00
wip: extract tarball downloading into separate command
This commit is contained in:
29
lib/commit.rb
Normal file
29
lib/commit.rb
Normal file
@@ -0,0 +1,29 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'yaml'
|
||||
|
||||
class Commit
|
||||
attr_reader :sha
|
||||
attr_reader :time
|
||||
|
||||
def initialize(sha:, time:)
|
||||
@sha = sha
|
||||
@time = time
|
||||
end
|
||||
|
||||
def sha_short
|
||||
sha[0..6]
|
||||
end
|
||||
|
||||
def to_hash
|
||||
{
|
||||
'sha' => sha,
|
||||
'sha_short' => sha_short,
|
||||
'time' => time
|
||||
}
|
||||
end
|
||||
|
||||
def to_yaml
|
||||
to_hash.to_yaml
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user