Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 61af3b3

Browse files
authored
Merge pull request #4 from koshilife/develop
release v0.3.0
2 parents b6b666f + 8129907 commit 61af3b3

6 files changed

Lines changed: 25 additions & 17 deletions

File tree

.github/workflows/gem-push.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@ jobs:
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}}

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
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.

lib/omniauth-tanita/version.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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
77
end

lib/omniauth/strategies/tanita.rb

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
11
# frozen_string_literal: true
22

33
require 'omniauth-oauth2'
4-
require 'tanita/api/client'
54

65
module 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
2725
end

omniauth-tanita.gemspec

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ require_relative 'lib/omniauth-tanita/version'
44

55
Gem::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'

spec/omniauth/strategies/tanita_spec.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
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
@@ -27,13 +27,17 @@
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
3943
end

0 commit comments

Comments
 (0)