yinx 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/yinx/down_config.rb +2 -1
- data/lib/yinx/note_meta.rb +27 -6
- data/lib/yinx/version.rb +1 -1
- metadata +3 -5
- data/lib/yinx/array.rb +0 -5
- data/lib/yinx/hash.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fd66ccaa0654d53f1efc187f7b21e140bab2c8a
|
4
|
+
data.tar.gz: 20a4c800c0adca5b13e9464539187c3f3aa8be50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56c323674093cd55c88f093c5b574de48ac7e8a0c2ec0e2d6ecc88e19ba51750b3e1dd67c34aa7b6665321bb2f3d22adabb4c8e7705e5c5b5e78a44dee549fc1
|
7
|
+
data.tar.gz: c5924b1a5ee4a25d8419822344dc4c7e14f674f8e47689f6c28df6feac8c3d3fe8c69d0102a3d31ce0dcb90b1e3643e3801d8dab9fc60d2010d4da078ba8ebcf
|
data/lib/yinx/down_config.rb
CHANGED
@@ -15,7 +15,8 @@ module Yinx
|
|
15
15
|
|
16
16
|
%w{book stack tag word}.each do |condition|
|
17
17
|
define_method "wanted_#{condition}s" do
|
18
|
-
|
18
|
+
iv_name = "@wanted_#{condition}s"
|
19
|
+
instance_variable_defined?(iv_name) ? instance_variable_get(iv_name) : []
|
19
20
|
end
|
20
21
|
|
21
22
|
define_method "want_#{condition}?" do |name|
|
data/lib/yinx/note_meta.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
require 'evernote-thrift'
|
2
|
-
require 'yinx/hash'
|
3
|
-
require 'yinx/array'
|
4
2
|
|
5
3
|
class Yinx::NoteMeta
|
6
4
|
|
7
|
-
[:updated, :created, :title, :notebookGuid, :guid, :contentLength, :tagGuids]
|
5
|
+
OfficialApi = [:updated, :created, :title, :notebookGuid, :guid, :contentLength, :tagGuids]
|
6
|
+
|
7
|
+
FullApi = OfficialApi + [:tags, :book, :stack]
|
8
|
+
|
9
|
+
OfficialApi.each do |method|
|
8
10
|
define_method method do
|
9
11
|
iv_name = "@#{method}"
|
10
12
|
unless instance_variable_defined? iv_name
|
@@ -41,7 +43,7 @@ class Yinx::NoteMeta
|
|
41
43
|
end
|
42
44
|
|
43
45
|
def to_h
|
44
|
-
@h =
|
46
|
+
@h = FullApi.each_with_object({}) do |method, hash|
|
45
47
|
hash[method] = send method
|
46
48
|
end
|
47
49
|
end
|
@@ -62,10 +64,29 @@ class Yinx::NoteMeta
|
|
62
64
|
end
|
63
65
|
end
|
64
66
|
|
67
|
+
NoTagGuid, NoTag = 'NoTagGuid', 'NoTag'
|
68
|
+
|
69
|
+
def unwind_tags
|
70
|
+
if tags.empty?
|
71
|
+
[_unwind_tags(NoTagGuid, NoTag)]
|
72
|
+
else
|
73
|
+
tagGuids.zip(tags).map do |tag_id, tag_name|
|
74
|
+
_unwind_tags tag_id, tag_name
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
protected
|
80
|
+
|
81
|
+
attr_writer :tagGuids, :tags
|
82
|
+
|
65
83
|
private
|
66
84
|
|
67
|
-
def
|
68
|
-
self.
|
85
|
+
def _unwind_tags tag_id, tag_name
|
86
|
+
uw = self.dup
|
87
|
+
uw.tagGuids = tag_id
|
88
|
+
uw.tags = tag_name
|
89
|
+
uw
|
69
90
|
end
|
70
91
|
|
71
92
|
end
|
data/lib/yinx/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yinx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ken
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -82,9 +82,7 @@ files:
|
|
82
82
|
- bin/console
|
83
83
|
- bin/setup
|
84
84
|
- lib/yinx.rb
|
85
|
-
- lib/yinx/array.rb
|
86
85
|
- lib/yinx/down_config.rb
|
87
|
-
- lib/yinx/hash.rb
|
88
86
|
- lib/yinx/note_meta.rb
|
89
87
|
- lib/yinx/note_store.rb
|
90
88
|
- lib/yinx/user_store.rb
|
@@ -110,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
108
|
version: '0'
|
111
109
|
requirements: []
|
112
110
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.
|
111
|
+
rubygems_version: 2.6.8
|
114
112
|
signing_key:
|
115
113
|
specification_version: 4
|
116
114
|
summary: Get my evernote metadata
|
data/lib/yinx/array.rb
DELETED
data/lib/yinx/hash.rb
DELETED