Files
news.gitea.happylizard.me/bin/gems/yell-2.2.2/lib/yell/adapters/file.rb
T
pizza2d1 4cee170d66
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s
Add bin and edit workflow
2026-09-16 13:11:16 -06:00

35 lines
766 B
Ruby

module Yell #:nodoc:
module Adapters #:nodoc:
# The +File+ adapter is the most basic. As one would expect, it's used
# for logging into files.
class File < Yell::Adapters::Io
private
# @overload setup!( options )
def setup!( options )
@filename = ::File.expand_path(Yell.__fetch__(options, :filename, default: default_filename))
super
end
# @overload open!
def open!
@stream = ::File.open(@filename, ::File::WRONLY|::File::APPEND|::File::CREAT)
super
end
def default_filename #:nodoc:
logdir = ::File.expand_path("log")
::File.expand_path(::File.directory?(logdir) ? "#{logdir}/#{Yell.env}.log" : "#{Yell.env}.log")
end
end
end
end