evertils 0.1.11 → 0.1.12

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: 70cf4b4ed27990a1e7bc8adba2afb303c25664da
4
- data.tar.gz: 973f11f9015cbcfc5fe466ee4437a5a3d1e768da
3
+ metadata.gz: ce79321a6d91cff3619f1def89c723e30c1d9d8f
4
+ data.tar.gz: 60800007b0ac1c062c475dcade62fcd0312d0fa3
5
5
  SHA512:
6
- metadata.gz: 2368ca15ec4e1614248a6307a19e4c00082a37f5ad2caedba0ee6a37374ef54c9f5973b50a84f669a946ee60de3e09ae95ba03f1b28b7a4a5df31d42c0a227b6
7
- data.tar.gz: 00a716fd05c348096a6a25a957f10da8f41950badf7f601cbd81b9943854fc74b9ab8ef8541fe84e581b9cb525e906058784cfb8eb3a02d2b95ffc51bb4ee328
6
+ metadata.gz: e182f429d894eaeb9bc70c363a80984118f43098fb1d0ea9c3d04f9ac97fab2731d0898da779a93e1cd2708a2b9c7fd2a672e241c85aa89ee276be6a45e55f0d
7
+ data.tar.gz: 6f7a108499f29b2ad41b4394a3883281a23c28f157debf782f210af4d2eaa88341dcb47516fd94f510c6432b24ffaf931be22f427cb6097db6bafcbc47672ea0
@@ -32,6 +32,18 @@ module Granify
32
32
  opt.on("-b", "--body=BODY", "Note body") do |body|
33
33
  @body = body
34
34
  end
35
+
36
+ opt.on("-t", "--tags=list", "Assign tags to the new note") do |tags|
37
+ @tags = tags
38
+ end
39
+
40
+ opt.on("-c", "--created_on=DATE", "Set note created date") do |created_on|
41
+ # Evernote cuts the last 3 values off of your timestamp because
42
+ # it "accurate to milliseconds", so we have to add them back or
43
+ # else the date is all messed up
44
+ parsed = Date.parse(created_on)
45
+ @created_on = (parsed.to_time.to_i.to_s + "000").to_i
46
+ end
35
47
  end.parse!
36
48
 
37
49
  # user = @model.user
@@ -54,7 +66,7 @@ module Granify
54
66
  message = @body
55
67
  end
56
68
 
57
- note = @model.create_note(@title, message, @notebook, @file)
69
+ note = @model.create_note(@title, message, @notebook, @file, false, @created_on)
58
70
 
59
71
  if note[:note]
60
72
  Notify.success("Note created")
@@ -75,7 +87,7 @@ module Granify
75
87
  # Prefix title to indicate it's shared status
76
88
  @title = "[SHARED] #{@title}"
77
89
 
78
- note = @model.create_note(@title, message, @notebook, @file, true)
90
+ note = @model.create_note(@title, message, @notebook, @file, true, @created_on)
79
91
 
80
92
  if note[:share_url]
81
93
  Notify.success("Note created and shared:\n#{note[:share_url]}")
@@ -147,7 +147,7 @@ module Granify
147
147
  results.should_eval_to(false)
148
148
  end
149
149
 
150
- def create_note(title = date_templates[$request.command], body = template_contents, p_notebook_name = nil, file = nil, share_note = false)
150
+ def create_note(title = date_templates[$request.command], body = template_contents, p_notebook_name = nil, file = nil, share_note = false, created_on)
151
151
  # Create note object
152
152
  our_note = ::Evernote::EDAM::Type::Note.new
153
153
  our_note.resources = []
@@ -172,6 +172,7 @@ module Granify
172
172
  # setup note properties
173
173
  our_note.title = title
174
174
  our_note.content = n_body
175
+ our_note.created = created_on if !created_on.nil?
175
176
 
176
177
  # properly tag logs
177
178
  case $request.command
@@ -194,6 +195,7 @@ module Granify
194
195
 
195
196
  ## Attempt to create note in Evernote account
196
197
  begin
198
+ puts our_note.inspect
197
199
  output = {}
198
200
  output[:note] = @@store.createNote(@@developer_token, our_note)
199
201
 
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Granify
2
- VERSION = '0.1.11'
2
+ VERSION = '0.1.12'
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.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Priebe