class Giteaucrat::File
Attributes
name[RW]
@return [String]
repo[RW]
@return [Giteaucrat::Repo]
Public Instance Methods
formatter()
click to toggle source
# File lib/giteaucrat/file.rb, line 56 def formatter @formatter ||= Formatters.formatter_for(self) end
owner()
click to toggle source
# File lib/giteaucrat/file.rb, line 39 def owner @owner ||= begin Author.find_by_git_person(repo.git_repo.log(name).last.author) rescue NoMethodError Author.new(name: repo.git_repo.config['user.name'], email: repo.git_repo.config['user.email']) end end
read_contents()
click to toggle source
# File lib/giteaucrat/file.rb, line 48 def read_contents ::File.read(name) end
write_contents(contents)
click to toggle source
# File lib/giteaucrat/file.rb, line 52 def write_contents(contents) ::File.write(name, contents) end
write_copyright!()
click to toggle source
# File lib/giteaucrat/file.rb, line 60 def write_copyright! formatter.write_copyright! end