trove 0.3.0 → 0.4.0

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: f60a074e99a9e9405cc918542cc4e046777b2455d56f9b6654f13b02fbd9452d
4
- data.tar.gz: b94af6fbce0944e7436618ae229d95b73bf6028496f8360f3325e6513270c123
3
+ metadata.gz: c3405df381f814b60dcb01ff70e6e768c79931a0b1d3eef34d09f1249c1dcdb3
4
+ data.tar.gz: 77b95d7dcaaf2107b74eaa4f6c8ec3e7db3e7f07798c36652f9648c8335eb3f2
5
5
  SHA512:
6
- metadata.gz: 550d14d38a0ad59cb45c2339337388dabd077a9c173185d9480b200d645eda21a70c5015a2326a528cbfbf26474f10c17139b401f0d3ed5bf6159316f6bf7c01
7
- data.tar.gz: 66290847eee973fdd38ad8d4a2b6f49dc597a9c1b935627f6dd81b07e3ab75c16b5263a813e404ce9bbeb88cf69a1975f9cd98eff0d7163d69845805e47ca14d
6
+ metadata.gz: d984330ab97029254411191f6cfd89bbabaa45e459b5e4e418849d6937358c8cb64058f605bef4503b1d80c45d75337cc09993ce79ad7e952ce7e8d46e12cd95
7
+ data.tar.gz: cc5a268ac34bffc6ff27c3319167e7b81d1bcc56589968449e90792723e4331cda7b0bc0c0a1db6b3f6cd6d48bc750074b3f43d4da687633a83c4104c86b5554
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.4.0 (2026-04-09)
2
+
3
+ - Dropped support for Ruby < 3.3
4
+
1
5
  ## 0.3.0 (2025-06-07)
2
6
 
3
7
  - Dropped support for Ruby < 3.2
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2020-2025 Andrew Kane
3
+ Copyright (c) 2020-2026 Andrew Kane
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/lib/trove/cli.rb CHANGED
@@ -76,7 +76,7 @@ module Trove
76
76
  data.each { |r| r[c] ||= "<none>" }
77
77
  end
78
78
  end
79
- column_names = columns.map { |c| c.to_s.sub(/_at\z/, "").upcase }
79
+ column_names = columns.map { |c| c.to_s.delete_suffix("_at").upcase }
80
80
  widths = columns.map.with_index { |c, i| [column_names[i].size, data.map { |r| r[c].to_s.size }.max || 0].max }
81
81
 
82
82
  output = String.new("")
@@ -1,5 +1,6 @@
1
1
  require "aws-sdk-s3"
2
2
  require "fileutils"
3
+ require "tmpdir"
3
4
 
4
5
  module Trove
5
6
  module Storage
@@ -15,9 +16,8 @@ module Trove
15
16
  current_size = 0
16
17
  total_size = nil
17
18
 
18
- # TODO better path
19
- tmp = "#{Dir.tmpdir}/trove-#{Time.now.to_f}"
20
- begin
19
+ Dir.mktmpdir do |tmpdir|
20
+ tmp = "#{tmpdir}/trove"
21
21
  File.open(tmp, "wb") do |file|
22
22
  options = {bucket: bucket, key: key(filename)}
23
23
  options[:version_id] = version if version
@@ -30,17 +30,14 @@ module Trove
30
30
  end
31
31
  end
32
32
  FileUtils.mv(tmp, dest)
33
- ensure
34
- # delete file if interrupted
35
- File.unlink(tmp) if File.exist?(tmp)
36
33
  end
37
34
  rescue Aws::S3::Errors::NoSuchKey, Aws::S3::Errors::NotFound
38
35
  raise "File not found"
39
36
  end
40
37
 
41
- def upload(src, filename, &block)
38
+ def upload(src, filename)
42
39
  on_chunk_sent = lambda do |_, current_size, total_size|
43
- block.call(current_size, total_size)
40
+ yield current_size, total_size
44
41
  end
45
42
  resp = nil
46
43
  File.open(src, "rb") do |file|
data/lib/trove/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Trove
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
data/lib/trove.rb CHANGED
@@ -67,7 +67,7 @@ module Trove
67
67
  # update version
68
68
  file["version"] = version
69
69
 
70
- File.write(".trove.yml", config.to_yaml.sub(/\A---\n/, ""))
70
+ File.write(".trove.yml", config.to_yaml.delete_prefix("---\n"))
71
71
  end
72
72
 
73
73
  {
@@ -164,7 +164,7 @@ module Trove
164
164
  uri =
165
165
  begin
166
166
  URI.parse(config["storage"])
167
- rescue URI::InvalidURIError => e
167
+ rescue URI::InvalidURIError
168
168
  raise "Invalid storage"
169
169
  end
170
170
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trove
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
@@ -77,14 +77,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - ">="
79
79
  - !ruby/object:Gem::Version
80
- version: '3.2'
80
+ version: '3.3'
81
81
  required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  requirements:
83
83
  - - ">="
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0'
86
86
  requirements: []
87
- rubygems_version: 3.6.7
87
+ rubygems_version: 4.0.6
88
88
  specification_version: 4
89
89
  summary: Deploy machine learning models in Ruby (and Rails)
90
90
  test_files: []