class AocCli::Commands::YearInit

Attributes

git[R]
user[R]
year[R]

Public Class Methods

new(args) click to toggle source
# File lib/aoc_cli/commands.rb, line 22
def initialize(args)
        args = defaults.merge(args).compact
        @user, @year, @git = args[:user], args[:year], args[:git]
end

Public Instance Methods

defaults() click to toggle source
# File lib/aoc_cli/commands.rb, line 35
def defaults
        { user:Prefs.default_alias,
           git:Prefs.bool(key:"init_git") }
end
exec() click to toggle source
# File lib/aoc_cli/commands.rb, line 26
def exec
        Year::Meta.new(u:user, y:year).write
        Year::Progress.new(u:user, y:year).write.init_calendar_db
        Year::GitWrap.new if git
        self
end
respond() click to toggle source
# File lib/aoc_cli/commands.rb, line 32
def respond
        puts "Year #{year} initialised"
end