omniauth-line-notify 0.1.0 → 0.1.1

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: b5bf86824ba633ccac8a3411461729e1749aad0f
4
- data.tar.gz: ac5ee75bbd20f80bffa11644f3d566500e9d61b2
3
+ metadata.gz: 26de388096f990e8c66798ef1a64b9bbfd7e07f5
4
+ data.tar.gz: a92699479e27dbf591d47b3467339d597f9920b4
5
5
  SHA512:
6
- metadata.gz: aad03bc1b6837b591709b48ee8bf31a85170f5ebb2501baf243636fa92d12b65cfdef8204bccf1e687b7676b62d2fb8425cd0f6226e62746b0e88055336d4793
7
- data.tar.gz: 4d06956a5e5abfe70e546eb21f10318f16e3ee75e3e11b29a33dff15960b743e8c1863a534189ee47ab473b9be4d7e6e43ab26906a12f8c0dbcc8ce3bcacbfe0
6
+ metadata.gz: 97fdf8225b8e443d316b17b32034d18a80c078fb02e17e8cacff32bcad1f593eed3c58198d248503c0940db4a05b43d86e2fc145529f69652f6efbed60c8e098
7
+ data.tar.gz: 422efac24466e503259d8fb775e66eceba17411ddb6175dbf9402e487260eb3025480ee440d90cb817b64d1a5a03150091bcea95e9b1f9a1082aeeb2e7611945
data/README.md CHANGED
@@ -33,4 +33,3 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
33
33
  ## Contributing
34
34
 
35
35
  Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/omniauth-line-notify.
36
-
@@ -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://notify­bot.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
@@ -0,0 +1,3 @@
1
+ module OmniAuthLineNotify
2
+ VERSION = "0.1.1"
3
+ end
@@ -0,0 +1,2 @@
1
+ require 'omniauth-line-notify/version'
2
+ require 'omniauth/strategies/line-notify'
@@ -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/line/notify/version'
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 = Omniauth::Line::Notify::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.0
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/line/notify.rb
73
- - lib/omniauth/line/notify/version.rb
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: []
@@ -1,7 +0,0 @@
1
- module Omniauth
2
- module Line
3
- module Notify
4
- VERSION = "0.1.0"
5
- end
6
- end
7
- end
@@ -1,9 +0,0 @@
1
- require "omniauth/line/notify/version"
2
-
3
- module Omniauth
4
- module Line
5
- module Notify
6
- # Your code goes here...
7
- end
8
- end
9
- end