Skip to content

Commit 62b6710

Browse files
committed
Modernize: Implement suggestions by rubocop 1.39
- `bundle exec rubocop --autocorrect` - Add `base64` to dependencies
1 parent b96aaba commit 62b6710

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ GEM
77
remote: https://rubygems.org/
88
specs:
99
ast (2.4.3)
10+
base64 (0.3.0)
1011
diff-lcs (1.6.2)
1112
json (2.18.1)
1213
os (1.1.4)
@@ -61,6 +62,7 @@ PLATFORMS
6162
x86_64-linux
6263

6364
DEPENDENCIES
65+
base64
6466
bundler
6567
crate_ruby!
6668
os

crate_ruby.gemspec

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ Gem::Specification.new do |spec|
3737

3838
spec.files = Dir['lib/**/*']
3939
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
40-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
4140
spec.require_paths = %w[lib]
4241
spec.extra_rdoc_files = Dir['README.rst', 'CHANGES.rst', 'LICENSE', 'NOTICE']
4342
spec.rdoc_options += [
@@ -53,9 +52,11 @@ Gem::Specification.new do |spec|
5352
'changelog_uri' => 'https://github.com/crate/crate_ruby/blob/main/CHANGES.rst',
5453
'documentation_uri' => 'https://www.rubydoc.info/gems/crate_ruby',
5554
'homepage_uri' => spec.homepage,
56-
'source_code_uri' => 'https://github.com/crate/crate_ruby'
55+
'source_code_uri' => 'https://github.com/crate/crate_ruby',
56+
'rubygems_mfa_required' => 'true'
5757
}
5858

59+
spec.add_development_dependency 'base64'
5960
spec.add_development_dependency 'bundler'
6061
spec.add_development_dependency 'os'
6162
spec.add_development_dependency 'rake'

spec/bootstrap.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ def download
5858
Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
5959
request = Net::HTTP::Get.new uri
6060
resp = http.request request
61-
File.open(@fname, 'wb') do |file|
62-
file.write(resp.body)
63-
end
61+
File.binwrite(@fname, resp.body)
6462
end
6563
end
6664

spec/crate_ruby/client_spec.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@
7272
it 'downloads a blob' do
7373
data = client.blob_get(blob_table, digest)
7474
expect(data).to be_truthy
75-
File.open(store_location, 'wb') do |file|
76-
file.write(data)
77-
end
75+
File.binwrite(store_location, data)
7876
end
7977
end
8078

@@ -85,7 +83,8 @@
8583
end
8684

8785
it 'deletes a blob' do
88-
client.blob_delete(blob_table, digest)
86+
response = client.blob_delete(blob_table, digest)
87+
expect(response).to be_falsy
8988
end
9089
end
9190
end
@@ -95,7 +94,7 @@
9594

9695
before do
9796
client.execute("create table #{table_name} " \
98-
'(id integer primary key, name string, address object, tags array(string)) ')
97+
'(id integer primary key, name string, address object, tags array(string)) ')
9998
end
10099

101100
after do

0 commit comments

Comments
 (0)