enop 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +8 -0
- data/exe/enop +3 -1
- data/lib/enop/enop.rb +23 -9
- data/lib/enop/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c0c8069ace4c20d04e27fe59c67a90d0b158ff9
|
4
|
+
data.tar.gz: 684a364607d64f2807296fd0a9b5d4e87b8e82ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cb46c13de37e241b7e5dcfd5937ae2f070077a20f3e5e132ebaa21baa2c39b84add2a579db85295bffe00c8ca296f13d14c9e6122cd5d3f4a0af3b332db6fb7
|
7
|
+
data.tar.gz: 479883f3d8a65583d4121d879cbb0fa18fc90e21f8ce823dd19075ded2f2c066c3e3b0eac85fc49b9b3c36d8c6dc7e5dcf1a395c677b467028b5734c6f29e9ff
|
data/.gitignore
CHANGED
data/exe/enop
CHANGED
@@ -7,6 +7,7 @@ dbconfig = Arxutils::Dbutil::DBCONFIG_MYSQL
|
|
7
7
|
dbconfig = Arxutils::Dbutil::DBCONFIG_SQLITE3
|
8
8
|
|
9
9
|
token = ARGV[0]
|
10
|
+
url = ARGV[1] if ARGV.size > 10
|
10
11
|
hs = {
|
11
12
|
"db_dir" => Arxutils::Dbutil::DB_DIR,
|
12
13
|
"migrate_dir" => Arxutils::Dbutil::MIGRATE_DIR,
|
@@ -19,7 +20,8 @@ hs = {
|
|
19
20
|
enop = Enop::Enop.new(
|
20
21
|
token,
|
21
22
|
:db,
|
22
|
-
hs
|
23
|
+
hs,
|
24
|
+
url
|
23
25
|
)
|
24
26
|
enop.connect
|
25
27
|
enop.list_notebooks
|
data/lib/enop/enop.rb
CHANGED
@@ -2,17 +2,20 @@
|
|
2
2
|
require 'evernote-thrift'
|
3
3
|
require 'csv'
|
4
4
|
require 'pp'
|
5
|
-
|
5
|
+
require 'openssl'
|
6
6
|
require 'forwardable'
|
7
7
|
|
8
8
|
module Enop
|
9
9
|
class Enop
|
10
10
|
extend Forwardable
|
11
11
|
|
12
|
-
def_delegator( :@dbmgr , :add , :db_add)
|
13
|
-
|
14
|
-
def initialize( authToken , kind, hs )
|
12
|
+
def_delegator( :@dbmgr , :add , :db_add )
|
15
13
|
|
14
|
+
def initialize( authToken , kind , hs , userStoreUrl = nil )
|
15
|
+
# SSL認証を行わないように変更
|
16
|
+
OpenSSL::SSL.module_eval{ remove_const(:VERIFY_PEER) }
|
17
|
+
OpenSSL::SSL.const_set( :VERIFY_PEER, OpenSSL::SSL::VERIFY_NONE )
|
18
|
+
|
16
19
|
@stack_hs = {}
|
17
20
|
@nbinfos = {}
|
18
21
|
@notebookinfo = Struct.new("NotebookInfo", :name, :stack, :defaultNotebook, :count , :tags )
|
@@ -24,18 +27,20 @@ module Enop
|
|
24
27
|
}
|
25
28
|
|
26
29
|
evernoteHost = "www.evernote.com"
|
27
|
-
userStoreUrl = "https://#{evernoteHost}/edam/user"
|
30
|
+
userStoreUrl = "https://#{evernoteHost}/edam/user" unless userStoreUrl
|
31
|
+
userStoreUrl = "https://www.evernote.com/shard/s18/notestore"
|
32
|
+
# userStoreUrl =
|
28
33
|
userStoreTransport = Thrift::HTTPClientTransport.new(userStoreUrl)
|
29
34
|
userStoreProtocol = Thrift::BinaryProtocol.new(userStoreTransport)
|
30
35
|
@userStore = Evernote::EDAM::UserStore::UserStore::Client.new(userStoreProtocol)
|
31
|
-
|
36
|
+
# Invalid method name : 'checkVersion' が返されるので、とりあえずコメント化
|
37
|
+
=begin
|
32
38
|
versionOK = @userStore.checkVersion("Evernote EDAMTest (Ruby)",
|
33
39
|
Evernote::EDAM::UserStore::EDAM_VERSION_MAJOR,
|
34
40
|
Evernote::EDAM::UserStore::EDAM_VERSION_MINOR)
|
35
41
|
puts "Is my Evernote API version up to date? #{versionOK}"
|
36
|
-
puts
|
37
42
|
exit(1) unless versionOK
|
38
|
-
|
43
|
+
=end
|
39
44
|
set_output_dest( get_output_filename_base )
|
40
45
|
end
|
41
46
|
|
@@ -65,7 +70,6 @@ module Enop
|
|
65
70
|
# In that case, you don't need to make this call.
|
66
71
|
#noteStoreUrl = userStore.getNoteStoreUrl(authToken)
|
67
72
|
noteStoreUrl = "https://www.evernote.com/shard/s18/notestore"
|
68
|
-
|
69
73
|
noteStoreTransport = Thrift::HTTPClientTransport.new(noteStoreUrl)
|
70
74
|
noteStoreProtocol = Thrift::BinaryProtocol.new(noteStoreTransport)
|
71
75
|
@noteStore = Evernote::EDAM::NoteStore::NoteStore::Client.new(noteStoreProtocol)
|
@@ -77,8 +81,18 @@ module Enop
|
|
77
81
|
|
78
82
|
begin
|
79
83
|
notebooks = @noteStore.listNotebooks(@authToken)
|
84
|
+
rescue Evernote::EDAM::Error::EDAMUserException => ex
|
85
|
+
parameter = ex.parameter
|
86
|
+
errorCode = ex.errorCode
|
87
|
+
errorText = Evernote::EDAM::Error::EDAMErrorCode::VALUE_MAP[errorCode]
|
88
|
+
|
89
|
+
puts "Authentication failed (parameter: #{parameter} errorCode: #{errorText})"
|
90
|
+
|
91
|
+
exit(1)
|
80
92
|
rescue => ex
|
93
|
+
puts "@authToken=#{@authToken}"
|
81
94
|
puts "Can't call listNotebooks"
|
95
|
+
p ex
|
82
96
|
exit
|
83
97
|
end
|
84
98
|
|
data/lib/enop/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yasuo kominami
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evernote_oauth
|
@@ -154,9 +154,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
version: '0'
|
155
155
|
requirements: []
|
156
156
|
rubyforge_project:
|
157
|
-
rubygems_version: 2.4.
|
157
|
+
rubygems_version: 2.4.5.1
|
158
158
|
signing_key:
|
159
159
|
specification_version: 4
|
160
160
|
summary: evernote operation.
|
161
161
|
test_files: []
|
162
|
-
has_rdoc:
|