Class: Evertils::Controller::Generate

Inherits:
Base
  • Object
show all
Defined in:
lib/evertils/controllers/generate.rb

Constant Summary

Constants inherited from Base

Base::OK, Base::QUIT, Base::QUIT_SOFT

Instance Attribute Summary

Attributes inherited from Base

#config, #request

Instance Method Summary collapse

Methods inherited from Base

#can_exec?, #exec, #initialize, #post_exec, #pre_exec, #sample

Constructor Details

This class inherits a constructor from Evertils::Controller::Base

Instance Method Details

#dailyObject

generate daily notes



11
12
13
14
# File 'lib/evertils/controllers/generate.rb', line 11

def daily
  note = Type::Daily.new(@config)
  note.create if note.should_create?
end

#monthlyObject

generate monthly notes



24
25
26
27
28
# File 'lib/evertils/controllers/generate.rb', line 24

def monthly
  note = Type::Monthly.new(@config)
  note.create if note.should_create?
  note.add_weekly_note_link
end

#morningObject

creates the notes required to start the day

- priority queue
- daily
- weekly (if today is Monday and there isn't a weekly log already)
- monthly (if today is the 1st and there isn't a monthly log already)


49
50
51
52
53
54
# File 'lib/evertils/controllers/generate.rb', line 49

def morning
  pq
  daily
  weekly
  monthly
end

#mts(arg) ⇒ Object

generate monthly task summary templates



31
32
33
34
35
36
# File 'lib/evertils/controllers/generate.rb', line 31

def mts(arg)
  Notify.error('Name argument is required', {}) if arg.nil?

  note = Type::MonthlyTaskSummary.new(@config, arg[1])
  note.create if note.should_create?
end

#pqObject

generate priority queue notes



39
40
41
42
# File 'lib/evertils/controllers/generate.rb', line 39

def pq
  note = Type::PriorityQueue.new(@config)
  note.create if note.should_create?
end

#weeklyObject

generate weekly notes



17
18
19
20
21
# File 'lib/evertils/controllers/generate.rb', line 17

def weekly
  note = Type::Weekly.new(@config)
  note.create if note.should_create?
  note.add_daily_note_link
end