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 +4 -4
- data/lib/controllers/new.rb +14 -2
- data/lib/helpers/evernote.rb +3 -1
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce79321a6d91cff3619f1def89c723e30c1d9d8f
|
4
|
+
data.tar.gz: 60800007b0ac1c062c475dcade62fcd0312d0fa3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e182f429d894eaeb9bc70c363a80984118f43098fb1d0ea9c3d04f9ac97fab2731d0898da779a93e1cd2708a2b9c7fd2a672e241c85aa89ee276be6a45e55f0d
|
7
|
+
data.tar.gz: 6f7a108499f29b2ad41b4394a3883281a23c28f157debf782f210af4d2eaa88341dcb47516fd94f510c6432b24ffaf931be22f427cb6097db6bafcbc47672ea0
|
data/lib/controllers/new.rb
CHANGED
@@ -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]}")
|
data/lib/helpers/evernote.rb
CHANGED
@@ -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