omniauth-haobtc 0.2.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c9cfa13bbeaece895677a157cab2edc1082c211
4
- data.tar.gz: f217e16a46184091e42681456422e98a4b9a28db
3
+ metadata.gz: 2eb69f28abea216a0acfc3f1ef1d54ba11ef624d
4
+ data.tar.gz: abeca270c82b57da38f0a88f75ba16c256bec143
5
5
  SHA512:
6
- metadata.gz: e4346cc24434a87ea026f3b036b5cee739f8d1b0d411161c7e7e5eea62588313d792e1500b52d0543bd4a73d62c3c4b6cb67615f5d4b2a0dd26cb038215d9776
7
- data.tar.gz: 48a4c4f85e66b9c475174fa5ec062a0a925de4dec2a2a3be5db247f76a96c3c297925d0b881a1af590c01686880e5a084ef164cc54f19c3998cdb3cbfc127772
6
+ metadata.gz: 739d4279897e3effa4f4edc072269e2ec146a8a8992d2861cff3ee282e3e2345577bfb60b552cb9dfec93e271676492e507bfac45d1da2ae7dd28b15d49abe65
7
+ data.tar.gz: 8d3e6485d3d07cfa3f3bbc9a072796798c39e44a13dc8a53bad9f2d9cd44c759947af7f84a00d8ea0658236e82abccaed1d0bfa0f92a58737463129a9712d9bc
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /*/**.swp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in omniauth-haobtc.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,20 @@
1
+ ## Installation
2
+
3
+ Add this line to your application's Gemfile:
4
+
5
+ ```ruby
6
+ gem 'omniauth-haobtc'
7
+ ```
8
+
9
+ And then execute:
10
+
11
+ $ bundle
12
+
13
+ Or install it yourself as:
14
+
15
+ $ gem install omniauth-haobtc
16
+
17
+ ## Contributing
18
+
19
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Freeza91/omniauth-haobtc.
20
+
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "omniauth/haobtc"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,2 @@
1
+ require "omniauth/haobtc/version"
2
+ require "omniauth/strategies/haobtc"
@@ -0,0 +1,5 @@
1
+ module Omniauth
2
+ module Haobtc
3
+ VERSION = "0.2.1"
4
+ end
5
+ end
@@ -0,0 +1,48 @@
1
+ # encoding: utf-8
2
+
3
+ require 'omniauth/strategies/oauth2'
4
+
5
+ module OmniAuth
6
+ module Strategies
7
+ class Haobtc < OmniAuth::Strategies::OAuth2
8
+ option :name, "haobtc"
9
+
10
+ option :client_options, {
11
+ :site => 'https://haobtc.com',
12
+ :authorize_url => '/auth/oauth/authorize/',
13
+ :token_url => "/auth/oauth/get_token/"
14
+ }
15
+
16
+ uid do
17
+ @uid ||= begin
18
+ access_token.options[:mode] = :query
19
+ access_token.options[:param_name] = :access_token
20
+ end
21
+ end
22
+
23
+ info do
24
+ user_info = raw_info['user_info']
25
+ {
26
+ :username => user_info['username'],
27
+ :fullname => user_info['fullname'],
28
+ :address => user_info['address'],
29
+ :provider => user_info['provider'],
30
+ :uuid => user_info['uuid']
31
+ }
32
+ end
33
+
34
+ # extra do
35
+ # {
36
+ # :raw_info => raw_info
37
+ # }
38
+ # end
39
+
40
+ def raw_info
41
+ @raw_info ||= access_token.get('https://haobtc.com/api/v1/user/profile').parsed
42
+ end
43
+
44
+ end
45
+ end
46
+ end
47
+
48
+ OmniAuth.config.add_camelization('haobtc', 'Haobtc')
@@ -0,0 +1,30 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'omniauth/haobtc/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+
8
+ spec.name = "omniauth-haobtc"
9
+ spec.version = Omniauth::Haobtc::VERSION
10
+ spec.authors = ["freez91"]
11
+ spec.email = ["useyes91@gmail.com"]
12
+
13
+ spec.summary = %q{OmniAuth strategies for haobtc}
14
+ spec.description = %q{OmniAuth strategies for haobtc}
15
+ spec.homepage = "https://github.com/Freeza91/omniauth-haobtc"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ f.match(%r{^(test|spec|features)/})
19
+ end
20
+ spec.bindir = "exe"
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.require_paths = ["lib"]
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.13"
25
+ spec.add_development_dependency "rake", "~> 10.0"
26
+ spec.add_dependency 'omniauth', '~> 1.0'
27
+ spec.add_dependency 'omniauth-oauth', '~> 1.0'
28
+ spec.add_dependency 'omniauth-oauth2', '~> 1.0'
29
+
30
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-haobtc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - freez91
@@ -86,7 +86,17 @@ email:
86
86
  executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
- files: []
89
+ files:
90
+ - ".gitignore"
91
+ - Gemfile
92
+ - README.md
93
+ - Rakefile
94
+ - bin/console
95
+ - bin/setup
96
+ - lib/omniauth/haobtc.rb
97
+ - lib/omniauth/haobtc/version.rb
98
+ - lib/omniauth/strategies/haobtc.rb
99
+ - omniauth-haobtc.gemspec
90
100
  homepage: https://github.com/Freeza91/omniauth-haobtc
91
101
  licenses: []
92
102
  metadata: {}