freee 0.0.1 → 0.0.2
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/bin/freee +6 -27
- data/lib/freee.rb +7 -2
- data/lib/freee/util.rb +1 -1
- data/lib/freee/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6d9fa495f32e128662402a0a6470045e56f66a24
|
|
4
|
+
data.tar.gz: e1b07621fa88214885d162ded3d6329dec23431f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9249688a8787a1872daa1497d8cf104057ec7dd093eca0e8f4b70bdeeb99403ae47230a1209457061e0afdd16dd18cd557192595dbcdeef98de56a3ed4b5c1f6
|
|
7
|
+
data.tar.gz: 57f3256878d05178bad5b6292f6986daf05d374059406dbc8306099085c83834d12ae4fcf762fbda8da9faed564e3505ce1eae95782e26a9f8616f3175dfc669
|
data/bin/freee
CHANGED
|
@@ -14,33 +14,12 @@ module Freee
|
|
|
14
14
|
redirect_uri = ask("Redirect URI\n")
|
|
15
15
|
authorization_code = ask("Authorization code\n")
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
params = {
|
|
24
|
-
grant_type: 'authorization_code',
|
|
25
|
-
code: authorization_code.to_s,
|
|
26
|
-
redirect_uri: redirect_uri.to_s,
|
|
27
|
-
headers: {
|
|
28
|
-
'Content-Type' => 'application/json',
|
|
29
|
-
'Authorization' => HTTPAuth::Basic.pack_authorization(
|
|
30
|
-
client_id.to_s,
|
|
31
|
-
secret_key.to_s
|
|
32
|
-
)
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
client = OAuth2::Client.new(client_id, secret_key, options) do |con|
|
|
37
|
-
con.request :url_encoded
|
|
38
|
-
con.request :json
|
|
39
|
-
con.response :json, content_type: /\bjson$/
|
|
40
|
-
con.adapter Faraday.default_adapter
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
say("Token: #{client.get_token(params).token}")
|
|
17
|
+
puts 'Token: ' + Freee::Util.create_token(
|
|
18
|
+
client_id: client_id,
|
|
19
|
+
secret_key: secret_key,
|
|
20
|
+
redirect_uri: redirect_uri,
|
|
21
|
+
authorization_code: authorization_code
|
|
22
|
+
)
|
|
44
23
|
end
|
|
45
24
|
end
|
|
46
25
|
end
|
data/lib/freee.rb
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
require 'freee/version'
|
|
2
1
|
require 'oauth2'
|
|
3
2
|
require 'faraday'
|
|
4
3
|
require 'faraday_middleware'
|
|
5
4
|
require 'httpauth'
|
|
6
5
|
require 'thor'
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
require 'freee/version'
|
|
8
|
+
require 'freee/base'
|
|
9
|
+
|
|
10
|
+
path = File.dirname(File.absolute_path(__FILE__))
|
|
11
|
+
Dir.glob(path + '/freee/*').each do |d|
|
|
12
|
+
require d if FileTest.file?(d)
|
|
13
|
+
end
|
|
9
14
|
|
|
10
15
|
module Freee
|
|
11
16
|
OPTIONS = {
|
data/lib/freee/util.rb
CHANGED
|
@@ -16,7 +16,7 @@ module Freee
|
|
|
16
16
|
params = {
|
|
17
17
|
grant_type: 'authorization_code',
|
|
18
18
|
code: kwarg[:authorization_code],
|
|
19
|
-
redirect_uri: kwarg[:
|
|
19
|
+
redirect_uri: kwarg[:redirect_uri],
|
|
20
20
|
headers: {
|
|
21
21
|
'Content-Type' => 'application/json',
|
|
22
22
|
'Authorization' => HTTPAuth::Basic.pack_authorization(
|
data/lib/freee/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: freee
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Keiji Matsuzaki
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-06-
|
|
11
|
+
date: 2014-06-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: oauth2
|