google-oauth-cli 0 → 0.1.0

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
  SHA256:
3
- metadata.gz: 3c1098a8c935b0a923a921c05a3261fbe4a2d36e4696e06429b62fcd1ee31dcd
4
- data.tar.gz: d1c5de860873466f3262791e937be3bd94843a7ded20d75ca5cdde4a873ea555
3
+ metadata.gz: ee18c4c8bf054e4a04d18b104b22c72e0360355864e2090361f1f520c1bf95f6
4
+ data.tar.gz: 6ee8403f8a338e57c7dc199fbc50580577b711b100b651f2f3e0027dd9b07c91
5
5
  SHA512:
6
- metadata.gz: f868d39de9f0a48276d147dbc4dee234a18edcf1b9501d41ac944ef990b25817bb76acb581dd391e8f037631dff3a764d1f16542f0f62df761e46f0871ca8ee4
7
- data.tar.gz: 457c0e60ac397ae92fe657028762db5690a354c51d79f84d650702083745815bea773316e746141d8e07c365ec92684989f7e0da0edd250140171a607dac6cd4
6
+ metadata.gz: 2ecfed6455a9a51e70ff931ae78c9e0d1ad20fe65d0d87774b0cd37690b6cefb6b140f495215eb88d5994aea157cf6846b7c12193f33d3c3899528f196194a37
7
+ data.tar.gz: d2693bb74664c645a7ef5ea7d421847a95ab51f6ccd51076278191c07a8d7ebee231843db0ec7571b24504138ca2ccfe386d468feac0177f6b963fc653ecfddd
data/.rubocop.yml CHANGED
@@ -13,13 +13,12 @@ Style/StringLiteralsInInterpolation:
13
13
  Style/Documentation:
14
14
  Enabled: false
15
15
 
16
+ Layout/LineLength:
17
+ Max: 120
18
+
19
+ Metrics/MethodLength:
20
+ Max: 30
21
+
16
22
  Naming/FileName:
17
23
  Exclude:
18
24
  - 'lib/google-oauth-cli.rb'
19
- - 'spec/google-oauth-cli_spec.rb'
20
-
21
- Metrics/BlockLength:
22
- Max: 28
23
-
24
- Metrics/MethodLength:
25
- Max: 15
data/Gemfile CHANGED
@@ -6,5 +6,5 @@ source "https://rubygems.org"
6
6
  gemspec
7
7
 
8
8
  gem "rake", "~> 13.0"
9
- gem "rspec", "~> 3.12"
9
+
10
10
  gem "rubocop", "~> 1.21"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- google-oauth-cli (0)
4
+ google-oauth-cli (0.1.0)
5
5
  googleauth (~> 1.5)
6
6
  launchy (~> 2.5)
7
7
 
@@ -11,7 +11,6 @@ GEM
11
11
  addressable (2.8.3)
12
12
  public_suffix (>= 2.0.2, < 6.0)
13
13
  ast (2.4.2)
14
- diff-lcs (1.5.0)
15
14
  faraday (2.7.4)
16
15
  faraday-net_http (>= 2.0, < 3.1)
17
16
  ruby2_keywords (>= 0.0.4)
@@ -38,19 +37,6 @@ GEM
38
37
  rake (13.0.6)
39
38
  regexp_parser (2.7.0)
40
39
  rexml (3.2.5)
41
- rspec (3.12.0)
42
- rspec-core (~> 3.12.0)
43
- rspec-expectations (~> 3.12.0)
44
- rspec-mocks (~> 3.12.0)
45
- rspec-core (3.12.1)
46
- rspec-support (~> 3.12.0)
47
- rspec-expectations (3.12.2)
48
- diff-lcs (>= 1.2.0, < 2.0)
49
- rspec-support (~> 3.12.0)
50
- rspec-mocks (3.12.5)
51
- diff-lcs (>= 1.2.0, < 2.0)
52
- rspec-support (~> 3.12.0)
53
- rspec-support (3.12.0)
54
40
  rubocop (1.49.0)
55
41
  json (~> 2.3)
56
42
  parallel (~> 1.10)
@@ -74,12 +60,10 @@ GEM
74
60
 
75
61
  PLATFORMS
76
62
  arm64-darwin-22
77
- x86_64-linux
78
63
 
79
64
  DEPENDENCIES
80
65
  google-oauth-cli!
81
66
  rake (~> 13.0)
82
- rspec (~> 3.12)
83
67
  rubocop (~> 1.21)
84
68
 
85
69
  BUNDLED WITH
data/Rakefile CHANGED
@@ -1,12 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
4
  require "rubocop/rake_task"
9
5
 
10
6
  RuboCop::RakeTask.new
11
7
 
12
- task default: %i[spec rubocop]
8
+ task default: :rubocop
@@ -24,6 +24,7 @@ class GoogleOAuthCli
24
24
  return data
25
25
  end
26
26
  end
27
+ server.close
27
28
  end
28
29
 
29
30
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class GoogleOAuthCli
4
- VERSION = ""
4
+ VERSION = "0.1.0"
5
5
  end
@@ -52,7 +52,7 @@ class GoogleOAuthCli
52
52
  raise(Error, "Attempted to open #{uri} and failed because #{exception}")
53
53
  end
54
54
 
55
- credentials.code = Server.new(port: port, state: state).start
55
+ credentials.code = start_server_and_receive_code(state)
56
56
  fetch_and_save_token!
57
57
 
58
58
  credentials
@@ -62,4 +62,13 @@ class GoogleOAuthCli
62
62
  credentials.fetch_access_token!
63
63
  credentials_file&.write({ refresh_token: credentials.refresh_token }.to_json)
64
64
  end
65
+
66
+ def start_server_and_receive_code(state)
67
+ server = Thread.new do
68
+ Thread.current.report_on_exception = false
69
+ Server.new(port: port, state: state).start
70
+ end
71
+ server.join
72
+ server.value
73
+ end
65
74
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-oauth-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: '0'
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yusuke Fujiki
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-10 00:00:00.000000000 Z
11
+ date: 2023-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: googleauth
@@ -47,7 +47,6 @@ executables: []
47
47
  extensions: []
48
48
  extra_rdoc_files: []
49
49
  files:
50
- - ".rspec"
51
50
  - ".rubocop.yml"
52
51
  - CHANGELOG.md
53
52
  - Gemfile
@@ -68,7 +67,7 @@ metadata:
68
67
  homepage_uri: https://github.com/fujikky/google-oauth-cli
69
68
  source_code_uri: https://github.com/fujikky/google-oauth-cli
70
69
  changelog_uri: https://github.com/fujikky/google-oauth-cli/tree/main/CHANGELOG
71
- post_install_message:
70
+ post_install_message:
72
71
  rdoc_options: []
73
72
  require_paths:
74
73
  - lib
@@ -83,8 +82,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
82
  - !ruby/object:Gem::Version
84
83
  version: '0'
85
84
  requirements: []
86
- rubygems_version: 3.4.10
87
- signing_key:
85
+ rubygems_version: 3.4.1
86
+ signing_key:
88
87
  specification_version: 4
89
88
  summary: Library for Google OAuth authentication from CLI
90
89
  test_files: []
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper