google-oauth-cli 0.1.0 → 0.1.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
  SHA256:
3
- metadata.gz: ee18c4c8bf054e4a04d18b104b22c72e0360355864e2090361f1f520c1bf95f6
4
- data.tar.gz: 6ee8403f8a338e57c7dc199fbc50580577b711b100b651f2f3e0027dd9b07c91
3
+ metadata.gz: 5a04b58395eeb4563cd278f0e195775f06474340620d1bea548d0da4de72ddc7
4
+ data.tar.gz: ebb231140cb5cf762f691a0747a57156aa052115c0bf1584408b8043a20bb7e2
5
5
  SHA512:
6
- metadata.gz: 2ecfed6455a9a51e70ff931ae78c9e0d1ad20fe65d0d87774b0cd37690b6cefb6b140f495215eb88d5994aea157cf6846b7c12193f33d3c3899528f196194a37
7
- data.tar.gz: d2693bb74664c645a7ef5ea7d421847a95ab51f6ccd51076278191c07a8d7ebee231843db0ec7571b24504138ca2ccfe386d468feac0177f6b963fc653ecfddd
6
+ metadata.gz: dbba06cd56dd7b048d216b861cc00cea62521c39f7c5cded50799ea764ce3ecd7ea701ee442c84a281a89ffc918af6e0f91be0178d3b9e8eed8f2886dd784e7b
7
+ data.tar.gz: 03a153672b71cfde33bc0007a29a42979be360f8431b64ce3c835239e1e060fd9ea32f99fd5442d72a0ba63a5e22cd367f0541bf36853fb6ec65497b4d51423f
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml CHANGED
@@ -13,12 +13,13 @@ 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
-
22
16
  Naming/FileName:
23
17
  Exclude:
24
18
  - '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
-
9
+ gem "rspec", "~> 3.12"
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.1.0)
4
+ google-oauth-cli (0.1.1)
5
5
  googleauth (~> 1.5)
6
6
  launchy (~> 2.5)
7
7
 
@@ -11,6 +11,7 @@ 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)
14
15
  faraday (2.7.4)
15
16
  faraday-net_http (>= 2.0, < 3.1)
16
17
  ruby2_keywords (>= 0.0.4)
@@ -37,6 +38,19 @@ GEM
37
38
  rake (13.0.6)
38
39
  regexp_parser (2.7.0)
39
40
  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)
40
54
  rubocop (1.49.0)
41
55
  json (~> 2.3)
42
56
  parallel (~> 1.10)
@@ -60,10 +74,12 @@ GEM
60
74
 
61
75
  PLATFORMS
62
76
  arm64-darwin-22
77
+ x86_64-linux
63
78
 
64
79
  DEPENDENCIES
65
80
  google-oauth-cli!
66
81
  rake (~> 13.0)
82
+ rspec (~> 3.12)
67
83
  rubocop (~> 1.21)
68
84
 
69
85
  BUNDLED WITH
data/Rakefile CHANGED
@@ -1,8 +1,12 @@
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
+
4
8
  require "rubocop/rake_task"
5
9
 
6
10
  RuboCop::RakeTask.new
7
11
 
8
- task default: :rubocop
12
+ task default: %i[spec rubocop]
@@ -24,7 +24,6 @@ class GoogleOAuthCli
24
24
  return data
25
25
  end
26
26
  end
27
- server.close
28
27
  end
29
28
 
30
29
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class GoogleOAuthCli
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
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 = start_server_and_receive_code(state)
55
+ credentials.code = Server.new(port: port, state: state).start
56
56
  fetch_and_save_token!
57
57
 
58
58
  credentials
@@ -62,13 +62,4 @@ 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
74
65
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-oauth-cli
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
  - Yusuke Fujiki
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
11
  date: 2023-04-09 00:00:00.000000000 Z
@@ -47,6 +47,7 @@ executables: []
47
47
  extensions: []
48
48
  extra_rdoc_files: []
49
49
  files:
50
+ - ".rspec"
50
51
  - ".rubocop.yml"
51
52
  - CHANGELOG.md
52
53
  - Gemfile
@@ -67,7 +68,7 @@ metadata:
67
68
  homepage_uri: https://github.com/fujikky/google-oauth-cli
68
69
  source_code_uri: https://github.com/fujikky/google-oauth-cli
69
70
  changelog_uri: https://github.com/fujikky/google-oauth-cli/tree/main/CHANGELOG
70
- post_install_message:
71
+ post_install_message:
71
72
  rdoc_options: []
72
73
  require_paths:
73
74
  - lib
@@ -82,8 +83,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
83
  - !ruby/object:Gem::Version
83
84
  version: '0'
84
85
  requirements: []
85
- rubygems_version: 3.4.1
86
- signing_key:
86
+ rubygems_version: 3.4.10
87
+ signing_key:
87
88
  specification_version: 4
88
89
  summary: Library for Google OAuth authentication from CLI
89
90
  test_files: []