This repository was archived by the owner on Sep 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232 printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
3333 gem build *.gemspec
3434 gem push *.gem
35+ continue-on-error : true
3536 env :
3637 GEM_HOST_API_KEY : ${{secrets.RUBYGEMS_AUTH_TOKEN}}
Original file line number Diff line number Diff line change 1+ # 0.3.0
2+
3+ - remove 'tanita-api-client' dependency.
4+ - rename module 'Omniauth' to 'OmniAuth'.
5+ - update gem-push GitHub Actions settings in order to ignore error for same version.
6+
17# 0.2.3
28
39- refs #1 setup GitHub Actions for rspec and pushing to RubyGems.
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
3- module Omniauth
3+ module OmniAuth
44 module Tanita
5- VERSION = '0.2.3 '
5+ VERSION = '0.3.0 '
66 end
77end
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33require 'omniauth-oauth2'
4- require 'tanita/api/client'
54
65module OmniAuth
76 module Strategies
8- TANITA = Tanita ::Api ::Client
9-
7+ # OmniAuth strategy for Health Planet
108 class Tanita < OmniAuth ::Strategies ::OAuth2
119 option :name , 'tanita'
1210
1311 option :skip_info , true
1412 option :provider_ignores_state , true
15- option :scope , TANITA ::Scope ::INNERSCAN
13+ option :scope , 'innerscan'
14+
15+ option :client_options , :site => 'https://www.healthplanet.jp' ,
16+ :authorize_url => '/oauth/auth'
1617
17- option :client_options , :site => TANITA ::BASE_URL ,
18- :authorize_url => TANITA ::AUTH_URL_PATH ,
19- :token_url => TANITA ::TOKEN_URL_PATH
18+ private
2019
2120 def callback_url
2221 full_host + script_name + callback_path
23- end
24-
22+ end
2523 end
2624 end
2725end
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ require_relative 'lib/omniauth-tanita/version'
44
55Gem ::Specification . new do |spec |
66 spec . name = 'omniauth-tanita'
7- spec . version = Omniauth ::Tanita ::VERSION
7+ spec . version = OmniAuth ::Tanita ::VERSION
88 spec . authors = [ 'Kenji Koshikawa' ]
99 spec . email = [ 'koshikawa2009@gmail.com' ]
1010
@@ -28,7 +28,6 @@ Gem::Specification.new do |spec|
2828 spec . executables = spec . files . grep ( %r{^exe/} ) { |f | File . basename ( f ) }
2929 spec . require_paths = [ 'lib' ]
3030
31- spec . add_runtime_dependency 'tanita-api-client' , '~> 0.2.3'
3231 spec . add_runtime_dependency 'omniauth-oauth2' , '~> 1.6.0'
3332
3433 spec . add_development_dependency 'bundler' , '~> 2.0'
Original file line number Diff line number Diff line change 99
1010 context 'client options' do
1111 it 'has correct site' do
12- expect ( subject . client . site ) . to eq ( Tanita :: Api :: Client :: BASE_URL )
12+ expect ( subject . client . site ) . to eq ( 'https://www.healthplanet.jp' )
1313 end
1414
1515 it 'has correct authorize_url' do
16- expect ( subject . client . options [ :authorize_url ] ) . to eq ( Tanita :: Api :: Client :: AUTH_URL_PATH )
16+ expect ( subject . client . options [ :authorize_url ] ) . to eq ( '/oauth/auth' )
1717 end
1818
1919 it 'has correct token_url' do
20- expect ( subject . client . options [ :token_url ] ) . to eq ( Tanita :: Api :: Client :: TOKEN_URL_PATH )
20+ expect ( subject . client . options [ :token_url ] ) . to eq ( '/oauth/token' )
2121 end
2222
2323 it 'has default skip_info' do
2727 it 'has default provider_ignores_state' do
2828 expect ( subject . options [ :provider_ignores_state ] ) . to eq ( true )
2929 end
30+
31+ it 'has default scope' do
32+ expect ( subject . options [ :scope ] ) . to eq ( 'innerscan' )
33+ end
3034 end
3135
3236 describe '#callback_url' do
3337 it 'returns callback url' do
3438 allow ( subject ) . to receive ( :full_host ) { 'http://localhost' }
3539 allow ( subject ) . to receive ( :script_name ) { '/v1' }
36- expect ( subject . callback_url ) . to eq 'http://localhost/v1/auth/tanita/callback'
40+ expect ( subject . send ( : callback_url) ) . to eq 'http://localhost/v1/auth/tanita/callback'
3741 end
3842 end
3943end
You can’t perform that action at this time.
0 commit comments