evertils 0.2.8.2 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: edb1a0bcfe2909e9d4d7c39c8f0f3253a4791de9
4
- data.tar.gz: 4cd7e7cfae51b684137f9319165ed6e84aeba16f
3
+ metadata.gz: 949afe8d09c701e278050a9b01a70ba8126357c9
4
+ data.tar.gz: 30756cf65ccd654a7dd3c742b685b6513d9b6d0d
5
5
  SHA512:
6
- metadata.gz: c1b8af698091efade18b8d36d0e916652b7094e7f71de9e5b54b60f38a2b6dfc8645733061da1f547d6ec21df6c33c8011310d2f8f45daf20f16177a8fda27de
7
- data.tar.gz: 48433ae5e106743eb319a228f5c31b92fdcdacd8500e95f7d9d05875ab0dc4d3c48123bc67b297435ec945a126967375f4780438ac2bb41710a94c2e1bdd0354
6
+ metadata.gz: 18b2aa16bd5473de272b6ac10daac74db7662f35afa472c611612eee3cc38398727c17542475fb0455f488374ad7628ef0532ea08741fdbdec1c2a1b76d70067
7
+ data.tar.gz: a3e665e1c366f52d82fb5ed7fc6fe14707b9ebb67ad1cf2bf8d0f11a551e16f4115d3e7043a16eabb1fe8527c5bbe00b5129a36966cd95d79ee7870aff4318ea
data/evertils.gemspec CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.add_runtime_dependency 'notifaction'
17
17
  s.add_runtime_dependency 'mime-types'
18
- s.add_runtime_dependency 'evertils-common', '~> 0.2.8'
18
+ s.add_runtime_dependency 'evertils-common', '~> 0.3.1'
19
19
 
20
20
  s.add_development_dependency "bundler", "~> 1.10"
21
21
  s.add_development_dependency "rake", "~> 10.0"
@@ -0,0 +1,9 @@
1
+ <div><span style="font-size: 18px;">Completed</span></div>
2
+ <ul>
3
+ <li>...</li>
4
+ </ul>
5
+ <br />
6
+ <div><span style="font-size: 18px;">Logs</span></div>
7
+ <ul>
8
+ <li>...</li>
9
+ </ul>
@@ -1,16 +1,17 @@
1
1
  module Evertils
2
2
  module Controller
3
3
  class Generate < Controller::Base
4
- attr_accessor :force, :start
4
+ attr_accessor :force, :start, :name
5
5
 
6
6
  # required user-created notebooks
7
7
  NOTEBOOK_DAILY = :Daily
8
8
  NOTEBOOK_WEEKLY = :Weekly
9
9
  NOTEBOOK_MONTHLY = :Monthly
10
10
  NOTEBOOK_DEPLOYMENT = :Deployments
11
+ NOTEBOOK_MTS = :'Monthly Task Summaries'
11
12
 
12
13
  def pre_exec
13
- @methods_require_internet.push(:daily, :weekly, :monthly)
14
+ @methods_require_internet.push(:daily, :weekly, :monthly, :mts)
14
15
 
15
16
  OptionParser.new do |opt|
16
17
  opt.banner = "#{Evertils::PACKAGE_NAME} generate timeframe [...-flags]"
@@ -22,6 +23,10 @@ module Evertils
22
23
  opt.on("-s", "--start=START", "Specify a date for the note") do |date|
23
24
  @start = DateTime.parse(date)
24
25
  end
26
+
27
+ opt.on("-n", "--name=NAME", "A name to pass to the script (not all command support this flag)") do |name|
28
+ @name = name
29
+ end
25
30
  end.parse!
26
31
 
27
32
  super
@@ -33,12 +38,6 @@ module Evertils
33
38
  body = @format.template_contents
34
39
  parent_notebook = NOTEBOOK_DAILY
35
40
 
36
- if !@force
37
- if @model.note_exists(title)
38
- Notify.error("There's already a log for today!")
39
- end
40
- end
41
-
42
41
  @model.create_note(title, body, parent_notebook)
43
42
  end
44
43
 
@@ -49,10 +48,6 @@ module Evertils
49
48
  parent_notebook = NOTEBOOK_WEEKLY
50
49
 
51
50
  if !@force
52
- if @model.note_exists(title)
53
- Notify.error("There's already a log for this week!")
54
- end
55
-
56
51
  if !Date.today.monday?
57
52
  Notify.error("Sorry, you can only create new weekly logs on Mondays")
58
53
  end
@@ -67,14 +62,30 @@ module Evertils
67
62
  body = @format.template_contents
68
63
  parent_notebook = NOTEBOOK_MONTHLY
69
64
 
70
- if !@force
71
- if @model.note_exists(title)
72
- Notify.error("There's already a log for this month!")
73
- end
74
- end
75
-
76
65
  @model.create_note(title, body, parent_notebook)
77
66
  end
67
+
68
+ # generate monthly task summary templates
69
+ def mts
70
+ Notify.error("Name argument is required") if @name.nil?
71
+
72
+ title = "#{@name} #{DateTime.now.strftime('%m-%Y')}"
73
+ body = @format.template_contents
74
+ parent_notebook = NOTEBOOK_MTS
75
+
76
+ # create the note from template
77
+ mts_note = @model.create_note(title, body, parent_notebook)
78
+
79
+ # tag it
80
+ # TODO: maybe move this out of controller?
81
+ tag_manager = Evertils::Common::Manager::Tag.new
82
+ month_tag = tag_manager.find("month-#{DateTime.now.strftime('%-m')}")
83
+ mts_note.tag(month_tag.prop(:name))
84
+
85
+ # TODO: commented out until support for multiple tags is added
86
+ # client_tag = tag_manager.find_or_create(@name)
87
+ # mts_note.tag(client_tag.prop(:name))
88
+ end
78
89
  end
79
90
  end
80
91
  end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Evertils
2
- VERSION = '0.2.8.2'
2
+ VERSION = '0.2.9'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evertils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8.2
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Priebe
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.2.8
47
+ version: 0.3.1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.2.8
54
+ version: 0.3.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -99,6 +99,7 @@ files:
99
99
  - lib/configs/templates/daily-friday.enml
100
100
  - lib/configs/templates/daily.enml
101
101
  - lib/configs/templates/monthly.enml
102
+ - lib/configs/templates/mts.enml
102
103
  - lib/configs/templates/weekly.enml
103
104
  - lib/controller.rb
104
105
  - lib/controllers/convert.rb