evertils-common 0.3.3.1 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f5c13dc552641eb3ac3da4f5b19c02ca98d78ddf
4
- data.tar.gz: 8f4ae9b9136fb262465016ecd16fe7f926d365d2
3
+ metadata.gz: a09c4903fbee2fd37ef8486857c748ff30b19dee
4
+ data.tar.gz: bf127a13f8c54d7465474b37455eaf81594b6369
5
5
  SHA512:
6
- metadata.gz: 9ccc816fe19580ba58080366c7fcb15fda30e74a92ced1a1373a125519ea59bbdde38fe0d3dc9087f0b815f2cbfb1458e744302b4572f2d2f43f555b554018b2
7
- data.tar.gz: 9596cdd0f2d68f79e829dc14d92c487853cee6b7626accb3f582c56e28d692a13c3c68de1ee0166c4d2eedd91f0552807b7a38c6db8eb4f713e461ecd2323cf4
6
+ metadata.gz: 851d3dd30d1dfc6cc3730270d7f1ffc51b24979c26819513786339cdaed26d321cc184d72cc85482faee8e8e52cd4f74a458785ddcb9e2726290adec46aeeaba
7
+ data.tar.gz: b62356b9d7baf2cd6170f231de0278f6328e070f79075b1f736b6ab3b2eca7db4b01dfaccfa357309d1814c4ed7ef1d533d6c2a4c79f51aecbcd5e28668c76f5
data/.rubocop.yml CHANGED
@@ -110,7 +110,7 @@ Style/Documentation:
110
110
 
111
111
  # Offense count: 1
112
112
  # Cop supports --auto-correct.
113
- Style/EmptyLines:
113
+ Layout/EmptyLines:
114
114
  Exclude:
115
115
  - 'Rakefile'
116
116
 
@@ -118,7 +118,7 @@ Style/EmptyLines:
118
118
  # Cop supports --auto-correct.
119
119
  # Configuration parameters: EnforcedStyle, SupportedStyles.
120
120
  # SupportedStyles: empty_lines, no_empty_lines
121
- Style/EmptyLinesAroundClassBody:
121
+ Layout/EmptyLinesAroundClassBody:
122
122
  Exclude:
123
123
  - 'lib/evertils/common/converter/yaml_to_enml.rb'
124
124
  - 'lib/evertils/test/base.rb'
@@ -127,7 +127,7 @@ Style/EmptyLinesAroundClassBody:
127
127
  # Cop supports --auto-correct.
128
128
  # Configuration parameters: EnforcedStyle, SupportedStyles.
129
129
  # SupportedStyles: empty_lines, no_empty_lines
130
- Style/EmptyLinesAroundModuleBody:
130
+ Layout/EmptyLinesAroundModuleBody:
131
131
  Exclude:
132
132
  - 'lib/evertils/common.rb'
133
133
  - 'lib/evertils/test.rb'
@@ -135,7 +135,7 @@ Style/EmptyLinesAroundModuleBody:
135
135
  # Offense count: 2
136
136
  # Cop supports --auto-correct.
137
137
  # Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
138
- Style/ExtraSpacing:
138
+ Layout/ExtraSpacing:
139
139
  Exclude:
140
140
  - 'Rakefile'
141
141
  - 'lib/evertils/test/base.rb'
@@ -167,19 +167,19 @@ Style/IfUnlessModifier:
167
167
  # Cop supports --auto-correct.
168
168
  # Configuration parameters: EnforcedStyle, SupportedStyles.
169
169
  # SupportedStyles: normal, rails
170
- Style/IndentationConsistency:
170
+ Layout/IndentationConsistency:
171
171
  Exclude:
172
172
  - 'lib/evertils/common/converter/yaml_to_enml.rb'
173
173
 
174
174
  # Offense count: 1
175
175
  # Cop supports --auto-correct.
176
- Style/LeadingCommentSpace:
176
+ Layout/LeadingCommentSpace:
177
177
  Exclude:
178
178
  - 'test/test_notes.rb'
179
179
 
180
180
  # Offense count: 3
181
181
  # Cop supports --auto-correct.
182
- Style/MethodCallParentheses:
182
+ Style/MethodCallWithoutArgsParentheses:
183
183
  Exclude:
184
184
  - 'lib/evertils/common/enml.rb'
185
185
 
@@ -230,7 +230,7 @@ Style/PerlBackrefs:
230
230
  # NamePrefix: is_, has_, have_
231
231
  # NamePrefixBlacklist: is_, has_, have_
232
232
  # NameWhitelist: is_a?
233
- Style/PredicateName:
233
+ Naming/PredicateName:
234
234
  Exclude:
235
235
  - 'spec/**/*'
236
236
  - 'lib/evertils/common.rb'
@@ -256,7 +256,7 @@ Style/RedundantSelf:
256
256
  # Offense count: 3
257
257
  # Cop supports --auto-correct.
258
258
  # Configuration parameters: AllowForAlignment.
259
- Style/SpaceAroundOperators:
259
+ Layout/SpaceAroundOperators:
260
260
  Exclude:
261
261
  - 'Rakefile'
262
262
  - 'lib/evertils/common/authentication.rb'
@@ -282,7 +282,7 @@ Style/SymbolProc:
282
282
  # Cop supports --auto-correct.
283
283
  # Configuration parameters: EnforcedStyle, SupportedStyles.
284
284
  # SupportedStyles: final_newline, final_blank_line
285
- Style/TrailingBlankLines:
285
+ Layout/TrailingBlankLines:
286
286
  Enabled: false
287
287
 
288
288
  # Offense count: 1
@@ -295,7 +295,7 @@ Style/TrailingCommaInLiteral:
295
295
 
296
296
  # Offense count: 1
297
297
  # Cop supports --auto-correct.
298
- Style/TrailingWhitespace:
298
+ Layout/TrailingWhitespace:
299
299
  Exclude:
300
300
  - 'lib/evertils/common/converter/yaml_to_enml.rb'
301
301
 
@@ -308,7 +308,7 @@ Style/UnneededPercentQ:
308
308
  # Offense count: 8
309
309
  # Configuration parameters: EnforcedStyle, SupportedStyles.
310
310
  # SupportedStyles: snake_case, camelCase
311
- Style/VariableName:
311
+ Naming/VariableName:
312
312
  Exclude:
313
313
  - 'lib/evertils/common/authentication.rb'
314
314
 
@@ -99,6 +99,9 @@ module Evertils
99
99
  spec = ::Evernote::EDAM::NoteStore::NotesMetadataResultSpec.new
100
100
  spec.includeTitle = true
101
101
  spec.includeTagGuids = true
102
+ spec.includeContentLength = true
103
+ spec.includeCreated = true
104
+ spec.includeUpdated = true
102
105
 
103
106
  result = @evernote.call(:findNotesMetadata, filter, 0, 10, spec)
104
107
 
@@ -108,6 +111,28 @@ module Evertils
108
111
  end
109
112
  alias_method :find_by_name, :find
110
113
 
114
+ #
115
+ # @since 0.2.0
116
+ def find_with_contents(name)
117
+ raise 'ERROR: Evernote API is incomplete, cannot pull full note content'
118
+
119
+ find_result = find(name)
120
+
121
+ return if find_result.nil?
122
+
123
+ @entity = find_result.entity
124
+
125
+ spec = ::Evernote::EDAM::NoteStore::NoteResultSpec.new
126
+ spec.includeResourcesData = true
127
+ spec.includeContent = true
128
+
129
+ result = @evernote.call(:getNoteWithResultSpec, @entity.guid, spec)
130
+
131
+ @entity = result
132
+
133
+ self if @entity
134
+ end
135
+
111
136
  #
112
137
  # @since 0.3.0
113
138
  def tag(*guids)
@@ -10,20 +10,20 @@ module Evertils
10
10
 
11
11
  #
12
12
  # @since 0.2.0
13
- def find_all(title, notebook = nil, limit = 300)
13
+ def find_all(title, notebook = nil, limit = 300, include_note_body = false)
14
14
  filters = find_filters(title, notebook)
15
15
 
16
- response = @evernote.call(:findNotesMetadata, filters, nil, limit, find_spec)
16
+ response = @evernote.call(:findNotesMetadata, filters, 0, limit, find_spec(include_note_body))
17
17
  response.notes
18
18
  end
19
19
  alias_method :find, :find_all
20
20
 
21
21
  #
22
22
  # @since 0.2.0
23
- def find_one(title, notebook = nil)
23
+ def find_one(title, notebook = nil, include_note_body = false)
24
24
  filters = find_filters(title, notebook)
25
25
 
26
- response = @evernote.call(:findNotesMetadata, filters, nil, 10, find_spec)
26
+ response = @evernote.call(:findNotesMetadata, filters, 0, 10, find_spec(include_note_body))
27
27
 
28
28
  notes = response.notes.detect { |note| note.title == title }
29
29
  notes
@@ -53,6 +53,7 @@ module Evertils
53
53
  spec.includeTitle = true
54
54
  spec.includeUpdated = true
55
55
  spec.includeCreated = true
56
+ spec.includeContent = true if include_note_content
56
57
 
57
58
  pool = @evernote.call(:findNotesMetadata, filter, 0, 300, spec)
58
59
 
@@ -94,7 +95,7 @@ module Evertils
94
95
  spec.includeUpdated = true
95
96
  spec.includeCreated = true
96
97
 
97
- @evernote.call(:findNotesMetadata, filter, nil, 300, spec)
98
+ @evernote.call(:findNotesMetadata, filter, 0, 300, spec)
98
99
  end
99
100
 
100
101
  private
@@ -127,9 +128,12 @@ module Evertils
127
128
 
128
129
  #
129
130
  # @since 0.3.2
130
- def find_spec
131
+ def find_spec(include_note_body)
131
132
  spec = ::Evernote::EDAM::NoteStore::NotesMetadataResultSpec.new
132
133
  spec.includeTitle = true
134
+ spec.includeContentLength = true
135
+ spec.includeCreated = true
136
+ spec.includeUpdated = true
133
137
  spec
134
138
  end
135
139
  end
@@ -22,6 +22,14 @@ module Evertils
22
22
  entity
23
23
  end
24
24
 
25
+ #
26
+ # @since 0.3.0
27
+ def find_with_contents(name)
28
+ entity = Evertils::Common::Entity::Note.new
29
+ entity.find_with_contents(name)
30
+ entity
31
+ end
32
+
25
33
  #
26
34
  # @since 0.3.1
27
35
  def find_or_create(name, stack = nil)
@@ -110,7 +110,7 @@ module Evertils
110
110
  nb = Manager::Notebook.instance
111
111
  query = nb.find(@notebook.to_s)
112
112
  notebook = query.entity
113
- @note.notebookGuid = notebook.guid if query
113
+ @note.notebookGuid = notebook if query
114
114
  end
115
115
  end
116
116
  end
@@ -72,6 +72,13 @@ module Evertils
72
72
  entity.find(name)
73
73
  end
74
74
 
75
+ #
76
+ # @since 0.3.4
77
+ def find_note_contents(name)
78
+ entity = Manager::Note.instance
79
+ entity.find_with_contents(name)
80
+ end
81
+
75
82
  #
76
83
  # @since 0.3.1
77
84
  def find_notebook(name)
@@ -1,5 +1,5 @@
1
1
  module Evertils
2
2
  module Common
3
- VERSION = "0.3.3.1".freeze
3
+ VERSION = '0.3.4'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evertils-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3.1
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Priebe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-02 00:00:00.000000000 Z
11
+ date: 2017-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '10.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '10.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mime-types
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
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
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: evernote-thrift
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: notifaction
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: 0.4.3
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 0.4.3
83
83
  description: Evernote utilities for your CLI workflow
@@ -89,10 +89,10 @@ executables:
89
89
  extensions: []
90
90
  extra_rdoc_files: []
91
91
  files:
92
- - .gitignore
93
- - .hound.yml
94
- - .rubocop.yml
95
- - .travis.yml
92
+ - ".gitignore"
93
+ - ".hound.yml"
94
+ - ".rubocop.yml"
95
+ - ".travis.yml"
96
96
  - Gemfile
97
97
  - LICENSE.txt
98
98
  - README.md
@@ -145,17 +145,17 @@ require_paths:
145
145
  - lib
146
146
  required_ruby_version: !ruby/object:Gem::Requirement
147
147
  requirements:
148
- - - '>='
148
+ - - ">="
149
149
  - !ruby/object:Gem::Version
150
150
  version: '0'
151
151
  required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  requirements:
153
- - - '>='
153
+ - - ">="
154
154
  - !ruby/object:Gem::Version
155
155
  version: '0'
156
156
  requirements: []
157
157
  rubyforge_project:
158
- rubygems_version: 2.0.14.1
158
+ rubygems_version: 2.6.12
159
159
  signing_key:
160
160
  specification_version: 4
161
161
  summary: EN (heart) CLI