omniauth-line-notify 0.1.0 → 0.1.1
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/README.md +0 -1
- data/lib/omniauth/strategies/line-notify.rb +32 -0
- data/lib/omniauth-line-notify/version.rb +3 -0
- data/lib/omniauth-line-notify.rb +2 -0
- data/omniauth-line-notify.gemspec +2 -2
- metadata +4 -3
- data/lib/omniauth/line/notify/version.rb +0 -7
- data/lib/omniauth/line/notify.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: 26de388096f990e8c66798ef1a64b9bbfd7e07f5
|
4
|
+
data.tar.gz: a92699479e27dbf591d47b3467339d597f9920b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97fdf8225b8e443d316b17b32034d18a80c078fb02e17e8cacff32bcad1f593eed3c58198d248503c0940db4a05b43d86e2fc145529f69652f6efbed60c8e098
|
7
|
+
data.tar.gz: 422efac24466e503259d8fb775e66eceba17411ddb6175dbf9402e487260eb3025480ee440d90cb817b64d1a5a03150091bcea95e9b1f9a1082aeeb2e7611945
|
data/README.md
CHANGED
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'omniauth-oauth2'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
module OmniAuth
|
5
|
+
module Strategies
|
6
|
+
class LineNotify < OmniAuth::Strategies::OAuth2
|
7
|
+
option :name, 'line_notify'
|
8
|
+
|
9
|
+
option :client_options, {:site => 'https://notifybot.line.me',
|
10
|
+
:authorize_url => '/oauth/authorize',
|
11
|
+
:token_url => '/oauth/token',
|
12
|
+
:proxy => ENV['http_proxy'] ? URI(ENV['http_proxy']) : nil}
|
13
|
+
|
14
|
+
uid { raw_info['mid'] }
|
15
|
+
|
16
|
+
info do
|
17
|
+
{
|
18
|
+
name: raw_info['displayName'],
|
19
|
+
image: raw_info['pictureUrl'],
|
20
|
+
description: raw_info['statusMessage']
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
# Require: Access token with PROFILE permission issued.
|
25
|
+
def raw_info
|
26
|
+
@raw_info ||= JSON.load(access_token.get('v1/profile').body)
|
27
|
+
rescue ::Errno::ETIMEDOUT
|
28
|
+
raise ::Timeout::Error
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'omniauth
|
4
|
+
require 'omniauth-line-notify/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "omniauth-line-notify"
|
8
|
-
spec.version =
|
8
|
+
spec.version = OmniAuthLineNotify::VERSION
|
9
9
|
spec.authors = ["blueplanet"]
|
10
10
|
spec.email = ["erguolinge@gmail.com"]
|
11
11
|
spec.summary = %q{OmniAuth strategy for LineNotify}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-line-notify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- blueplanet
|
@@ -69,8 +69,9 @@ files:
|
|
69
69
|
- Rakefile
|
70
70
|
- bin/console
|
71
71
|
- bin/setup
|
72
|
-
- lib/omniauth
|
73
|
-
- lib/omniauth
|
72
|
+
- lib/omniauth-line-notify.rb
|
73
|
+
- lib/omniauth-line-notify/version.rb
|
74
|
+
- lib/omniauth/strategies/line-notify.rb
|
74
75
|
- omniauth-line-notify.gemspec
|
75
76
|
homepage: https://github.com//blueplanet/omniauth-line-notify
|
76
77
|
licenses: []
|