trash_lib 1.0.0 → 1.0.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: 75c16e110946d251b05bcd6c1db9e5c7733d2deda45f495896004fae2b8b5e6a
4
- data.tar.gz: 5dd20ad59c2c4e7e214ceef63ee0435a761517f0f0a14c766ce25eebc5855db2
3
+ metadata.gz: a95f6070a2a39e218dff3d06852dbb0f784bf613d5648a616bc39e7104892a74
4
+ data.tar.gz: 7542becd9922251f1bc6fb42079ad5296d1e9af5b611c07816fbe7de338217cc
5
5
  SHA512:
6
- metadata.gz: f677937b43fb8328108f7c24117f42be1199201a152d69b4a021c96d8b37bcdf8e0850a5a9cf42d422e8fe8299aa71f9d1325dc52067f6e8a3a8f374a1e2b28d
7
- data.tar.gz: 33a16451d7c70668d8ce48ae78983d05931efe8a6e7de0264df885ccc6389e6e0367210af8f9a48597f296ae22a9c3fd94d3cbd136340a0ec29922a06dabe01d
6
+ metadata.gz: a54b265683be7bf27b888a3853188cb49b48fc470cea83fe5497aa0091b396640356fe534aec999733565bb01e0aab44304e3f52c1732c11a21fa511b840858f
7
+ data.tar.gz: 825344d5b5c066b83af8bbc7762e0c46a143d0905053f5b77abe5fdc88d393e0e241f2c6e26511b9c6f92f2cda4390e18932f1920b956a84a7e81af19da03009
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [1.0.1] - 2023-08-16
2
+
3
+ - Hot fixed `Trash::put`.
4
+
1
5
  ## [1.0.0] - 2023-08-16
2
6
 
3
7
  - Initial release.
data/lib/trash/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Trash
4
- VERSION = '1.0.0'
4
+ VERSION = '1.0.1'
5
5
  end
data/lib/trash.rb CHANGED
@@ -25,7 +25,7 @@ module Trash
25
25
 
26
26
  # Restore file to original path.
27
27
  def restore
28
- FileUtils.move path, origin, secure: true # FIXME
28
+ FileUtils.move(path, origin, secure: true) # FIXME
29
29
  delete_info
30
30
 
31
31
  nil
@@ -33,7 +33,7 @@ module Trash
33
33
 
34
34
  # Permanently delete the file.
35
35
  def delete
36
- FileUtils.remove_entry_secure path, force: true
36
+ FileUtils.remove_entry_secure(path, force: true)
37
37
  delete_info
38
38
 
39
39
  nil
@@ -50,7 +50,7 @@ module Trash
50
50
  end
51
51
 
52
52
  def delete_info
53
- FileUtils.remove_entry_secure info_path, force: true
53
+ FileUtils.remove_entry_secure(info_path, force: true)
54
54
  end
55
55
  end
56
56
 
@@ -72,8 +72,8 @@ module Trash
72
72
  trash_name = trash_name(path)
73
73
  trash_path = File.join(TRASH_FILE_PATH, trash_name)
74
74
 
75
- FileUtils.move path, trash_path, secure: true
76
- make_trash_info trash_name
75
+ FileUtils.move(path, trash_path, secure: true)
76
+ make_trash_info(path, trash_name)
77
77
 
78
78
  Entry.new trash_path
79
79
  end
@@ -108,7 +108,7 @@ module Trash
108
108
  trash_name
109
109
  end
110
110
 
111
- def make_trash_info(trash_name)
111
+ def make_trash_info(path, trash_name)
112
112
  File.open(File.join(TRASH_INFO_PATH, "#{trash_name}.trashinfo"), 'w') do |file|
113
113
  file.write <<~TRASH_INFO
114
114
  [Trash Info]
@@ -121,5 +121,3 @@ module Trash
121
121
 
122
122
  private_constant :Entry, :TRASH_PATH, :TRASH_FILE_PATH, :TRASH_INFO_PATH
123
123
  end
124
-
125
- pp Trash.list
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trash_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - NNB