globus_client 0.18.0 → 0.19.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: e7af86d10638224774c4bef0d85c4cbbe4e80c67edf432e6194ba097c8cb1cbe
4
- data.tar.gz: 7d2cb00fa8d76638fd8f6c0581766b5d9aaf5c3ed6a0322c69c12a64b1ebbf0d
3
+ metadata.gz: d5042af28565b016cc3a3ad14fd96622e4c29758d7d7bc533c5d613647a23a6a
4
+ data.tar.gz: e0d17308303c4a67487d30d6faba68bbe18e8563d45705bf6cae7201a2964c46
5
5
  SHA512:
6
- metadata.gz: 82be27face7403bf3e05f0c7356cd49fbae59afe06a37aabde60ba9a713237d144d116a57a3aff81c19cfeae046c418d8d828e6864053e8d56a72213213331f5
7
- data.tar.gz: dc6fff3543f1d5b5a0d56ac83c49a1285fc0e28a1949a25234aa4aecfa65d65850444ac3418d69f0c4c9c772ddc4b86d3b225bff14e813d306bb20d10ca64ef6
6
+ metadata.gz: b18bcbdb11fd2a0ee90e0bc496fd94a6a4e24f146630ce9a92722e8d378451974eb11c3184b3b384082f93473c478178d9bbdb2e4f61616fdb57c12476ce4f80
7
+ data.tar.gz: cc4e0a2bf3c679fdf168daf024768f3a1336cda1afd19f14fa0d0f82020c84bedc0cb5aee106ae61de1168146057d9130d65e5b39fb1697464c010fd5782f7a0
data/.rubocop.yml CHANGED
@@ -5,7 +5,7 @@ plugins:
5
5
  - rubocop-rspec
6
6
 
7
7
  AllCops:
8
- TargetRubyVersion: 3.1
8
+ TargetRubyVersion: 4.0
9
9
  DisplayCopNames: true
10
10
  SuggestExtensions: false
11
11
  NewCops: disable
@@ -13,6 +13,11 @@ AllCops:
13
13
  - bin/**
14
14
  - vendor/bundle/**/*
15
15
 
16
+ # Development uses Ruby 4, but the gem still supports Ruby 3.1 consumers.
17
+ Gemspec/RequiredRubyVersion:
18
+ Exclude:
19
+ - globus_client.gemspec
20
+
16
21
  # Per team developer playbook
17
22
  RSpec/MultipleMemoizedHelpers:
18
23
  Enabled: false
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- globus_client (0.18.0)
4
+ globus_client (0.19.1)
5
5
  activesupport (>= 4.2)
6
6
  faraday
7
7
  faraday-retry
@@ -10,119 +10,125 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activesupport (8.0.2)
13
+ activesupport (8.1.4)
14
14
  base64
15
- benchmark (>= 0.3)
16
15
  bigdecimal
17
16
  concurrent-ruby (~> 1.0, >= 1.3.1)
18
17
  connection_pool (>= 2.2.5)
19
18
  drb
20
19
  i18n (>= 1.6, < 2)
20
+ json
21
21
  logger (>= 1.4.2)
22
22
  minitest (>= 5.1)
23
23
  securerandom (>= 0.3)
24
24
  tzinfo (~> 2.0, >= 2.0.5)
25
25
  uri (>= 0.13.1)
26
- addressable (2.8.7)
27
- public_suffix (>= 2.0.2, < 7.0)
26
+ addressable (2.9.0)
27
+ public_suffix (>= 2.0.2, < 8.0)
28
28
  ast (2.4.3)
29
29
  base64 (0.3.0)
30
- benchmark (0.4.1)
31
- bigdecimal (3.2.2)
32
- byebug (12.0.0)
33
- concurrent-ruby (1.3.5)
34
- connection_pool (2.5.3)
35
- crack (1.0.0)
30
+ bigdecimal (4.1.3)
31
+ byebug (13.0.0)
32
+ reline (>= 0.6.0)
33
+ concurrent-ruby (1.3.8)
34
+ connection_pool (3.0.2)
35
+ crack (1.0.1)
36
36
  bigdecimal
37
37
  rexml
38
38
  diff-lcs (1.6.2)
39
- docile (1.4.1)
40
39
  drb (2.2.3)
41
- faraday (2.13.2)
42
- faraday-net_http (>= 2.0, < 3.5)
40
+ faraday (2.15.1)
41
+ faraday-net_http (>= 2.0, < 3.6)
43
42
  json
44
43
  logger
45
- faraday-net_http (3.4.1)
46
- net-http (>= 0.5.0)
47
- faraday-retry (2.3.2)
44
+ faraday-net_http (3.5.0)
45
+ net-http (~> 0.5)
46
+ faraday-retry (2.4.0)
48
47
  faraday (~> 2.0)
49
- hashdiff (1.2.0)
50
- i18n (1.14.7)
48
+ hashdiff (1.2.1)
49
+ i18n (1.15.2)
51
50
  concurrent-ruby (~> 1.0)
52
- json (2.12.2)
53
- language_server-protocol (3.17.0.5)
51
+ io-console (0.9.4)
52
+ json (3.1.0)
53
+ language_server-protocol (3.17.0.6)
54
54
  lint_roller (1.1.0)
55
55
  logger (1.7.0)
56
- minitest (5.25.5)
57
- net-http (0.6.0)
58
- uri
59
- parallel (1.27.0)
60
- parser (3.3.8.0)
56
+ minitest (6.0.6)
57
+ drb (~> 2.0)
58
+ prism (~> 1.5)
59
+ net-http (0.10.0)
60
+ net-protocol (>= 0.3.0)
61
+ uri (>= 0.11.1)
62
+ net-protocol (0.4.0)
63
+ timeout
64
+ parallel (2.3.0)
65
+ parser (3.3.13.0)
61
66
  ast (~> 2.4.1)
62
67
  racc
63
- prism (1.4.0)
64
- public_suffix (6.0.2)
68
+ prism (1.9.0)
69
+ public_suffix (7.0.5)
65
70
  racc (1.8.1)
66
71
  rainbow (3.1.1)
67
- rake (13.3.0)
68
- regexp_parser (2.10.0)
69
- rexml (3.4.1)
70
- rspec (3.13.1)
72
+ rake (13.4.2)
73
+ regexp_parser (2.13.1)
74
+ reline (0.7.0)
75
+ io-console (~> 0.5)
76
+ rexml (3.4.4)
77
+ rspec (3.13.2)
71
78
  rspec-core (~> 3.13.0)
72
79
  rspec-expectations (~> 3.13.0)
73
80
  rspec-mocks (~> 3.13.0)
74
- rspec-core (3.13.5)
81
+ rspec-core (3.13.6)
75
82
  rspec-support (~> 3.13.0)
76
83
  rspec-expectations (3.13.5)
77
84
  diff-lcs (>= 1.2.0, < 2.0)
78
85
  rspec-support (~> 3.13.0)
79
- rspec-mocks (3.13.5)
86
+ rspec-mocks (3.13.8)
80
87
  diff-lcs (>= 1.2.0, < 2.0)
81
88
  rspec-support (~> 3.13.0)
82
- rspec-support (3.13.4)
83
- rubocop (1.78.0)
84
- json (~> 2.3)
89
+ rspec-support (3.13.7)
90
+ rubocop (1.92.1)
91
+ json (>= 2.3)
85
92
  language_server-protocol (~> 3.17.0.2)
86
93
  lint_roller (~> 1.1.0)
87
- parallel (~> 1.10)
94
+ parallel (>= 1.10)
88
95
  parser (>= 3.3.0.2)
89
96
  rainbow (>= 2.2.2, < 4.0)
90
- regexp_parser (>= 2.9.3, < 3.0)
91
- rubocop-ast (>= 1.45.1, < 2.0)
97
+ regexp_parser (>= 2.11.3, < 3.0)
98
+ rubocop-ast (>= 1.49.0, < 2.0)
92
99
  ruby-progressbar (~> 1.7)
93
100
  unicode-display_width (>= 2.4.0, < 4.0)
94
- rubocop-ast (1.45.1)
101
+ rubocop-ast (1.50.0)
95
102
  parser (>= 3.3.7.2)
96
- prism (~> 1.4)
97
- rubocop-performance (1.25.0)
103
+ prism (~> 1.7)
104
+ rubocop-performance (1.27.0)
98
105
  lint_roller (~> 1.1)
99
- rubocop (>= 1.75.0, < 2.0)
100
- rubocop-ast (>= 1.38.0, < 2.0)
101
- rubocop-rspec (3.6.0)
106
+ rubocop (>= 1.89.0, < 2.0)
107
+ rubocop-ast (>= 1.47.1, < 2.0)
108
+ rubocop-rspec (3.10.2)
102
109
  lint_roller (~> 1.1)
103
- rubocop (~> 1.72, >= 1.72.1)
110
+ regexp_parser (>= 2.0)
111
+ rubocop (~> 1.86, >= 1.86.2)
104
112
  ruby-progressbar (1.13.0)
105
113
  securerandom (0.4.1)
106
- simplecov (0.22.0)
107
- docile (~> 1.1)
108
- simplecov-html (~> 0.11)
109
- simplecov_json_formatter (~> 0.1)
110
- simplecov-html (0.13.1)
111
- simplecov_json_formatter (0.1.4)
114
+ simplecov (1.3.2)
115
+ timeout (0.6.1)
112
116
  tzinfo (2.0.6)
113
117
  concurrent-ruby (~> 1.0)
114
- unicode-display_width (3.1.4)
115
- unicode-emoji (~> 4.0, >= 4.0.4)
116
- unicode-emoji (4.0.4)
117
- uri (1.0.3)
118
- webmock (3.25.1)
118
+ unicode-display_width (3.3.0)
119
+ unicode-emoji (~> 4.3)
120
+ unicode-emoji (4.3.0)
121
+ uri (1.1.2)
122
+ webmock (3.34.0)
119
123
  addressable (>= 2.8.0)
120
124
  crack (>= 0.3.2)
121
125
  hashdiff (>= 0.4.0, < 2.0.0)
122
- zeitwerk (2.7.3)
126
+ zeitwerk (2.8.3)
123
127
 
124
128
  PLATFORMS
125
129
  arm64-darwin-23
130
+ arm64-darwin-24
131
+ arm64-darwin-25
126
132
  x86_64-darwin-19
127
133
  x86_64-darwin-20
128
134
  x86_64-darwin-21
@@ -140,4 +146,4 @@ DEPENDENCIES
140
146
  webmock
141
147
 
142
148
  BUNDLED WITH
143
- 2.6.9
149
+ 4.0.23
data/README.md CHANGED
@@ -69,6 +69,8 @@ end
69
69
 
70
70
  ## Development
71
71
 
72
+ Use Ruby 4.0.7 for development and testing.
73
+
72
74
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
73
75
 
74
76
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
@@ -83,6 +83,12 @@ class GlobusClient
83
83
  false
84
84
  end
85
85
 
86
+ # @returns true if the user has an access rule with read/write permissions for the directory
87
+ # See https://docs.globus.org/api/transfer/acl/#get_list_of_access_rules
88
+ def writable?
89
+ access_rule&.fetch('permissions') == 'rw'
90
+ end
91
+
86
92
  private
87
93
 
88
94
  attr_reader :path, :user_id, :notify_email
@@ -3,28 +3,31 @@
3
3
  class GlobusClient
4
4
  # Holds all of the client's custom exception classes
5
5
  module Errors
6
+ # Base class for all of the client's custom exceptions, so that consumers can rescue any of them
7
+ class Error < StandardError; end
8
+
6
9
  # Error raised when the Globus Auth or Transfer API returns a 400 error
7
- class BadRequestError < StandardError; end
10
+ class BadRequestError < Error; end
8
11
 
9
12
  # Error raised by the Globus Auth API returns a 401 Unauthorized
10
- class UnauthorizedError < StandardError; end
13
+ class UnauthorizedError < Error; end
11
14
 
12
15
  # Error raised when the Globus Auth or Transfer API returns a 403 Forbidden
13
- class ForbiddenError < StandardError; end
16
+ class ForbiddenError < Error; end
14
17
 
15
18
  # Error raised when the Globus Auth or Transfer API returns a 404 NotFound
16
- class ResourceNotFound < StandardError; end
19
+ class ResourceNotFound < Error; end
17
20
 
18
21
  # Error raised when a consumer acts upon an access rule that was not found
19
- class AccessRuleNotFound < StandardError; end
22
+ class AccessRuleNotFound < Error; end
20
23
 
21
24
  # Error raised when response has an unexpected error (e.g., an HTTP 500)
22
- class InternalServerError < StandardError; end
25
+ class InternalServerError < Error; end
23
26
 
24
27
  # Error raised when the Globus Transfer API returns a 502 Bad Gateway
25
- class EndpointError < StandardError; end
28
+ class EndpointError < Error; end
26
29
 
27
30
  # Error raised when the remote server returns a 503 Bad Gateway
28
- class ServiceUnavailable < StandardError; end
31
+ class ServiceUnavailable < Error; end
29
32
  end
30
33
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class GlobusClient
4
- VERSION = '0.18.0'
4
+ VERSION = '0.19.1'
5
5
  end
data/lib/globus_client.rb CHANGED
@@ -50,7 +50,7 @@ class GlobusClient # rubocop:disable Metrics/ClassLength
50
50
  # rubocop:enable Metrics/ParameterLists
51
51
 
52
52
  delegate :config, :disallow_writes, :allow_writes, :delete_access_rule, :file_count, :list_files, :mkdir, :rename, :total_size,
53
- :user_valid?, :get_filenames, :has_files?, :exists?, :task_list, :tasks_in_progress?,
53
+ :user_valid?, :get_filenames, :has_files?, :exists?, :writable?, :task_list, :tasks_in_progress?,
54
54
  :delete, :get, :post, :put, to: :instance
55
55
 
56
56
  def default_transfer_url
@@ -211,6 +211,12 @@ class GlobusClient # rubocop:disable Metrics/ClassLength
211
211
  .exists?
212
212
  end
213
213
 
214
+ def writable?(...)
215
+ Endpoint
216
+ .new(...)
217
+ .writable?
218
+ end
219
+
214
220
  def user_valid?(...)
215
221
  Identity
216
222
  .new
metadata CHANGED
@@ -1,16 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: globus_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 0.19.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Collier
8
8
  - Laura Wrubel
9
9
  - Mike Giarlo
10
- autorequire:
11
10
  bindir: exe
12
11
  cert_chain: []
13
- date: 2025-07-18 00:00:00.000000000 Z
12
+ date: 1980-01-02 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: activesupport
@@ -102,7 +101,6 @@ metadata:
102
101
  source_code_uri: https://github.com/sul-dlss/globus_client
103
102
  changelog_uri: https://github.com/sul-dlss/globus_client/releases
104
103
  rubygems_mfa_required: 'true'
105
- post_install_message:
106
104
  rdoc_options: []
107
105
  require_paths:
108
106
  - lib
@@ -117,8 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
115
  - !ruby/object:Gem::Version
118
116
  version: '0'
119
117
  requirements: []
120
- rubygems_version: 3.5.11
121
- signing_key:
118
+ rubygems_version: 4.0.20
122
119
  specification_version: 4
123
120
  summary: Interface for interacting with the Globus API.
124
121
  test_files: []