can_cli 0.1.2 → 0.1.5
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 +4 -4
- data/README.md +22 -21
- data/bin/can +2 -1
- data/can.gemspec +19 -1
- data/lib/can/argparse.rb +38 -37
- data/lib/can/version.rb +3 -1
- data/lib/can.rb +8 -8
- data/lib/empty.rb +6 -4
- data/lib/error.rb +6 -4
- data/lib/info.rb +8 -6
- data/lib/list.rb +9 -7
- data/lib/trash.rb +13 -23
- data/lib/trashinfo.rb +9 -7
- data/lib/untrash.rb +8 -6
- metadata +7 -8
- data/.gitignore +0 -56
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ef7ac987b3841244c13797ef32aed1e802118990c5c295ac3d70173176deb7f
|
4
|
+
data.tar.gz: 0f1dfb82d03e44ddb22858c875e65d677ef16b426e43c3a7ec447d5dd8ae29d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9512482717cc9be8b1093561eba9524bd438765e9e16eb75829b9fff1ed0c2ac3ec14a8ddcb0cf4c569d3d2f14f69edb21d1dabf04c3a48060defee64d21e041
|
7
|
+
data.tar.gz: 10fad64ddcb3dc23f0681fa41c426a553522b467a5dfa377e1b3e4fd620c0cfaec3e4f9c5dadeea51fb8bf94a2e2bf2ab9ce951a7343aa33a661a7996a2da4cc
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
<h1 style="text-align: center;">can</h1>
|
2
|
+
-----------------------------
|
2
3
|
|
3
4
|
A command line implementation of the [Freedesktop XDG trash
|
4
5
|
specification](https://specifications.freedesktop.org/trash-spec/trashspec-latest.html).
|
@@ -6,42 +7,42 @@ specification](https://specifications.freedesktop.org/trash-spec/trashspec-lates
|
|
6
7
|
Can seeks to follow the behavior of the GNOME Files
|
7
8
|
(Nautilus) trash implementation.
|
8
9
|
|
9
|
-
|
10
|
-
multiple files---it will create an info file for each and
|
11
|
-
move each to the trash directory.
|
10
|
+
## Installation
|
12
11
|
|
13
|
-
|
12
|
+
Can is available as a
|
13
|
+
[Gem](https://rubygems.org/gems/can_cli) and as an [AUR
|
14
|
+
package](https://aur.archlinux.org/packages/can).
|
14
15
|
|
15
|
-
|
16
|
+
Install Gem:
|
17
|
+
`gem install can`
|
16
18
|
|
17
|
-
|
19
|
+
Install on AUR:
|
20
|
+
`paru -S can`
|
18
21
|
|
19
|
-
|
22
|
+
## Usage
|
23
|
+
|
24
|
+
**Does not cover all options**
|
20
25
|
|
21
|
-
|
26
|
+
**Trash files**
|
27
|
+
`can foo.txt bar.txt`
|
22
28
|
|
29
|
+
**Trash directories and files**
|
23
30
|
`can -r foo.txt bar.d`
|
24
31
|
|
25
|
-
|
26
|
-
|
32
|
+
**List files in trashcan**
|
27
33
|
`can -l`
|
28
34
|
|
29
|
-
|
30
|
-
|
35
|
+
**List files in trashcan that match a regex**
|
31
36
|
`can -l '^foo'`
|
32
37
|
|
33
|
-
|
34
|
-
|
38
|
+
**View trashinfo of files**
|
35
39
|
`can -n foo.txt bar.d`
|
36
40
|
|
37
|
-
|
38
|
-
|
41
|
+
**Untrash files**
|
39
42
|
`can -u foo.txt bar.d`
|
40
43
|
|
41
|
-
|
42
|
-
|
44
|
+
**Empty files from trashcan**
|
43
45
|
`can -e foo.txt bar.d`
|
44
46
|
|
45
|
-
|
46
|
-
|
47
|
+
**Empty entire trashcan**
|
47
48
|
`can -e`
|
data/bin/can
CHANGED
data/can.gemspec
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'lib/can/version'
|
2
4
|
|
3
5
|
Gem::Specification.new do |s|
|
@@ -8,8 +10,24 @@ Gem::Specification.new do |s|
|
|
8
10
|
s.description = 'A command-line trashcan interface implementing the FreeDesktop trash specification as a drop-in replacement for rm.'
|
9
11
|
s.authors = ['Sawyer Shepherd']
|
10
12
|
s.email = 'contact@sawyershepherd.org'
|
11
|
-
s.files =
|
13
|
+
s.files = [
|
14
|
+
'LICENSE',
|
15
|
+
'README.md',
|
16
|
+
'bin/can',
|
17
|
+
'can.gemspec',
|
18
|
+
'lib/can/argparse.rb',
|
19
|
+
'lib/can/version.rb',
|
20
|
+
'lib/can.rb',
|
21
|
+
'lib/empty.rb',
|
22
|
+
'lib/error.rb',
|
23
|
+
'lib/info.rb',
|
24
|
+
'lib/list.rb',
|
25
|
+
'lib/trash.rb',
|
26
|
+
'lib/trashinfo.rb',
|
27
|
+
'lib/untrash.rb'
|
28
|
+
]
|
12
29
|
s.homepage = 'https://github.com/sawshep/can'
|
13
30
|
s.license = 'GPL-3.0'
|
31
|
+
s.required_ruby_version = '>= 3.0'
|
14
32
|
s.add_runtime_dependency 'highline', '~> 2.0'
|
15
33
|
end
|
data/lib/can/argparse.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'optparse'
|
2
4
|
require 'set'
|
3
5
|
require 'can/version'
|
4
6
|
|
5
|
-
$options = Set.new
|
6
7
|
|
7
8
|
# This needs to be here because OptParse only looks
|
8
9
|
# at `Version` and @version for the version number,
|
@@ -14,79 +15,79 @@ module Can
|
|
14
15
|
USAGE = 'Usage: can [OPTION] [FILE]...'
|
15
16
|
|
16
17
|
MODES = {
|
17
|
-
:
|
18
|
-
|
19
|
-
:
|
20
|
-
|
21
|
-
:
|
22
|
-
|
23
|
-
:
|
24
|
-
|
18
|
+
list: ['-l', '--list',
|
19
|
+
'list files in the trash'],
|
20
|
+
info: ['-n', '--info',
|
21
|
+
'see information about a trashed file'],
|
22
|
+
untrash: ['-u', '--untrash',
|
23
|
+
'restore a trashed file'],
|
24
|
+
empty: ['-e', '--empty',
|
25
|
+
'permanently remove a file from the trash;
|
25
26
|
use with no arguments to empty entire
|
26
|
-
trashcan']
|
27
|
-
}
|
27
|
+
trashcan']
|
28
|
+
}.freeze
|
28
29
|
|
29
30
|
OPTIONS = {
|
30
|
-
:
|
31
|
-
|
31
|
+
force: ['-f', '--force',
|
32
|
+
'ignore nonexistent files and arguments,
|
32
33
|
never prompt'],
|
33
|
-
:
|
34
|
-
:
|
35
|
-
|
34
|
+
prompt: ['-i', nil, 'prompt before every trashing'],
|
35
|
+
recursive: ['-r', '--recursive',
|
36
|
+
'trash directories and their contents
|
36
37
|
recursively']
|
37
|
-
}
|
38
|
+
}.freeze
|
38
39
|
|
39
|
-
ALL_FLAGS = MODES.merge(OPTIONS)
|
40
|
+
ALL_FLAGS = MODES.merge(OPTIONS).freeze
|
40
41
|
|
41
42
|
module ArgParse
|
42
43
|
Version = VERSION
|
43
44
|
def self.init_args
|
45
|
+
options = Set.new
|
46
|
+
|
44
47
|
OptionParser.new do |opts|
|
45
48
|
opts.banner = USAGE
|
46
49
|
|
47
|
-
ALL_FLAGS.each do |mode,
|
48
|
-
opts.on(short_opt(mode), long_opt(mode), help_string(mode)) do |
|
49
|
-
|
50
|
+
ALL_FLAGS.each do |mode, _v|
|
51
|
+
opts.on(short_opt(mode), long_opt(mode), help_string(mode)) do |_opt|
|
52
|
+
options << mode
|
50
53
|
end
|
51
54
|
end
|
52
55
|
end.parse!
|
53
56
|
|
54
|
-
if ArgParse.incompatible_opts?
|
55
|
-
|
56
|
-
|
57
|
+
Error.fatal 'Too many mode arguments' if ArgParse.incompatible_opts?(options)
|
58
|
+
|
59
|
+
options
|
57
60
|
end
|
58
61
|
|
59
|
-
# Sees if
|
60
|
-
def self.incompatible_opts?
|
62
|
+
# Sees if options has incompatible items
|
63
|
+
def self.incompatible_opts?(options)
|
61
64
|
modes = MODES.keys
|
62
|
-
(
|
65
|
+
(options & modes).length > 1
|
63
66
|
end
|
64
67
|
|
65
|
-
def self.
|
66
|
-
(
|
68
|
+
def self.mode(options)
|
69
|
+
(options & MODES.keys).first || :trash
|
67
70
|
end
|
68
71
|
|
69
|
-
def self.short_opt
|
72
|
+
def self.short_opt(mode)
|
70
73
|
ALL_FLAGS[mode][0]
|
71
74
|
end
|
72
75
|
|
73
|
-
def self.long_opt
|
76
|
+
def self.long_opt(mode)
|
74
77
|
ALL_FLAGS[mode][1]
|
75
78
|
end
|
76
79
|
|
77
80
|
# Returns a mode's help string
|
78
|
-
def self.help_string
|
81
|
+
def self.help_string(mode)
|
79
82
|
ALL_FLAGS[mode][2]
|
80
83
|
end
|
81
84
|
|
82
85
|
# Returns an options's corresponding mode, if it is valid
|
83
|
-
def self.valid_opt?
|
84
|
-
result = MODES.find
|
86
|
+
def self.valid_opt?(opt)
|
87
|
+
result = MODES.find do |_k, v|
|
85
88
|
v[0..2].include? opt
|
86
|
-
}
|
87
|
-
if result
|
88
|
-
result.first
|
89
89
|
end
|
90
|
+
result&.first
|
90
91
|
end
|
91
92
|
end
|
92
93
|
end
|
data/lib/can/version.rb
CHANGED
data/lib/can.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'fileutils'
|
2
4
|
|
3
5
|
require 'can/argparse'
|
@@ -18,22 +20,20 @@ module Can
|
|
18
20
|
HOME_TRASH_INFO_DIRECTORY = File.join(HOME_TRASH_DIRECTORY, 'info')
|
19
21
|
HOME_TRASH_FILES_DIRECTORY = File.join(HOME_TRASH_DIRECTORY, 'files')
|
20
22
|
|
21
|
-
def self.init_dirs
|
23
|
+
def self.init_dirs
|
22
24
|
FileUtils.mkpath HOME_TRASH_FILES_DIRECTORY
|
23
25
|
FileUtils.mkpath HOME_TRASH_INFO_DIRECTORY
|
24
26
|
end
|
25
27
|
|
26
28
|
def self.can
|
27
|
-
ArgParse.init_args
|
29
|
+
@options = ArgParse.init_args
|
28
30
|
|
29
|
-
mode = ArgParse.
|
31
|
+
mode = ArgParse.mode @options
|
30
32
|
|
31
|
-
|
33
|
+
init_dirs
|
32
34
|
|
33
|
-
|
35
|
+
send mode
|
34
36
|
|
35
|
-
if
|
36
|
-
$exit = EXIT_SUCCESS
|
37
|
-
end
|
37
|
+
$exit = EXIT_SUCCESS if @options.include?(:force)
|
38
38
|
end
|
39
39
|
end
|
data/lib/empty.rb
CHANGED
@@ -1,19 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Can
|
2
4
|
def self.empty
|
3
5
|
# Remove everything in the files and info directory
|
4
|
-
if ARGV.
|
6
|
+
if ARGV.empty?
|
5
7
|
FileUtils.rm_r Dir.glob("#{HOME_TRASH_INFO_DIRECTORY}/*"), secure: true
|
6
8
|
FileUtils.rm_r Dir.glob("#{HOME_TRASH_FILES_DIRECTORY}/*"), secure: true
|
7
9
|
else
|
8
|
-
ARGV.
|
9
|
-
trashinfo_filename = filename
|
10
|
+
ARGV.each do |filename|
|
11
|
+
trashinfo_filename = "#{filename}.trashinfo"
|
10
12
|
|
11
13
|
file_path = File.join(HOME_TRASH_FILES_DIRECTORY, filename)
|
12
14
|
trashinfo_file_path = File.join(HOME_TRASH_INFO_DIRECTORY, trashinfo_filename)
|
13
15
|
|
14
16
|
FileUtils.remove_entry_secure file_path
|
15
17
|
FileUtils.remove_entry_secure trashinfo_file_path
|
16
|
-
|
18
|
+
end
|
17
19
|
end
|
18
20
|
end
|
19
21
|
end
|
data/lib/error.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
EXIT_SUCCESS = 0
|
2
4
|
EXIT_FAILURE = 1
|
3
5
|
|
@@ -8,14 +10,14 @@ at_exit do
|
|
8
10
|
end
|
9
11
|
|
10
12
|
module Error
|
11
|
-
def self.nonfatal
|
12
|
-
|
13
|
+
def self.nonfatal(message)
|
14
|
+
warn "can: #{message}"
|
13
15
|
$exit = EXIT_FAILURE
|
14
16
|
end
|
15
17
|
|
16
18
|
# Exits without callbacks to at_exit
|
17
|
-
def self.fatal
|
18
|
-
|
19
|
+
def self.fatal(message)
|
20
|
+
warn "can: #{message}"
|
19
21
|
exit!(EXIT_FAILURE)
|
20
22
|
end
|
21
23
|
end
|
data/lib/info.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Can
|
2
4
|
# TODO: Parse the .trashinfo files to make them more human
|
3
5
|
# readable. Also, display the filename above the information
|
@@ -5,19 +7,19 @@ module Can
|
|
5
7
|
def self.info
|
6
8
|
# Fails with a fatal error even with --force, intended
|
7
9
|
# behavior.
|
8
|
-
if ARGV.
|
10
|
+
if ARGV.empty?
|
9
11
|
Error.fatal 'missing operand'
|
10
12
|
else
|
11
|
-
ARGV.each_with_index
|
12
|
-
trashinfo_filename = file
|
13
|
+
ARGV.each_with_index do |file, i|
|
14
|
+
trashinfo_filename = "#{file}.trashinfo"
|
13
15
|
trashinfo_path = File.join(HOME_TRASH_INFO_DIRECTORY, trashinfo_filename)
|
14
16
|
|
15
|
-
|
17
|
+
unless File.exist? trashinfo_path
|
16
18
|
Error.nonfatal "no such file in trashcan: '#{file}'"
|
17
19
|
next
|
18
20
|
end
|
19
21
|
|
20
|
-
trashinfo = Trashinfo.parse(File.read
|
22
|
+
trashinfo = Trashinfo.parse(File.read(trashinfo_path))
|
21
23
|
|
22
24
|
# TODO: Checking if i is not zero every single
|
23
25
|
# iteration is a little inefficient. Maybe there is a
|
@@ -28,7 +30,7 @@ module Can
|
|
28
30
|
Path: #{trashinfo[:path]}
|
29
31
|
Deletion Date: #{trashinfo[:deletion_date]}
|
30
32
|
INFO
|
31
|
-
|
33
|
+
end
|
32
34
|
end
|
33
35
|
end
|
34
36
|
end
|
data/lib/list.rb
CHANGED
@@ -1,21 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Can
|
2
4
|
def self.list
|
3
5
|
# Given no args, show every trashed file
|
4
|
-
if ARGV.
|
6
|
+
if ARGV.empty?
|
5
7
|
puts Dir.children(HOME_TRASH_FILES_DIRECTORY)
|
6
8
|
|
7
9
|
# Given a regex pattern as an arg, print trashed files
|
8
10
|
# that fit
|
9
11
|
elsif ARGV.length == 1
|
10
12
|
regex = Regexp.new(ARGV[0])
|
11
|
-
puts
|
12
|
-
|
13
|
-
|
13
|
+
puts(
|
14
|
+
Dir.children(HOME_TRASH_FILES_DIRECTORY).select do |file|
|
15
|
+
regex =~ file
|
16
|
+
end
|
17
|
+
)
|
14
18
|
|
15
19
|
else
|
16
|
-
raise StandardError.
|
17
|
-
"can: mode --list expects 0 to 1 arguments, given #{ARGV.length}"
|
18
|
-
)
|
20
|
+
raise StandardError, "can: mode --list expects 0 to 1 arguments, given #{ARGV.length}"
|
19
21
|
end
|
20
22
|
end
|
21
23
|
end
|
data/lib/trash.rb
CHANGED
@@ -1,18 +1,19 @@
|
|
1
|
+
# frozen_string_literaL: true
|
2
|
+
|
1
3
|
require 'highline'
|
2
4
|
|
3
5
|
# Returns filename with all trailing extensions removed
|
4
6
|
def strip_extensions(filename)
|
5
7
|
ext = File.extname filename
|
6
|
-
if ext.empty?
|
7
|
-
|
8
|
-
end
|
8
|
+
return filename if ext.empty?
|
9
|
+
|
9
10
|
strip_extensions(File.basename(filename, ext))
|
10
11
|
end
|
11
12
|
|
12
13
|
# Returns all extensions of a filename
|
13
14
|
def gather_extensions(filename)
|
14
15
|
exts = ''
|
15
|
-
|
16
|
+
until File.extname(filename).empty?
|
16
17
|
ext = File.extname(filename)
|
17
18
|
exts = ext + exts
|
18
19
|
filename = File.basename(filename, ext)
|
@@ -22,41 +23,30 @@ end
|
|
22
23
|
|
23
24
|
module Can
|
24
25
|
def self.trash
|
25
|
-
if ARGV.
|
26
|
-
Error.fatal 'missing operand'
|
27
|
-
end
|
26
|
+
Error.fatal 'missing operand' if ARGV.empty? && !@options.include?(:force)
|
28
27
|
|
29
28
|
ARGV.each do |path|
|
30
|
-
|
31
29
|
# TODO: If both `-f` and `-i` are used, can should
|
32
30
|
# prompt if `-i` is used last. If `-f` is used last,
|
33
31
|
# can should not prompt trashings. This follows the
|
34
32
|
# behavior of rm.
|
35
|
-
|
36
|
-
|
37
|
-
Error.nonfatal "cannot trash '#{path}': No such file or directory"
|
38
|
-
end
|
33
|
+
unless File.exist?(path)
|
34
|
+
Error.nonfatal "cannot trash '#{path}': No such file or directory" unless @options.include? :force
|
39
35
|
next
|
40
36
|
end
|
41
37
|
|
42
38
|
# If --recursive is not used and a directory is given as an
|
43
39
|
# argument, a non-zero error code should be returned
|
44
40
|
# regardless if --force is used.
|
45
|
-
if File.directory?
|
46
|
-
|
47
|
-
Error.nonfatal "cannot remove '#{path}': Is a directory"
|
48
|
-
end
|
41
|
+
if File.directory?(path) && !File.symlink?(path)
|
42
|
+
Error.nonfatal "cannot remove '#{path}': Is a directory" unless @options.include? :recursive
|
49
43
|
next
|
50
44
|
end
|
51
45
|
|
52
46
|
# TODO: Highline.agree prints to stdout, when it should
|
53
47
|
# print to stderr. It also uses `puts`, while this use
|
54
48
|
# case should use `print`.
|
55
|
-
if
|
56
|
-
unless HighLine.agree "can: remove file '#{path}'?"
|
57
|
-
next
|
58
|
-
end
|
59
|
-
end
|
49
|
+
next if @options.include?(:prompt) && !(HighLine.agree "can: remove file '#{path}'?")
|
60
50
|
|
61
51
|
filename = File.basename path
|
62
52
|
|
@@ -75,12 +65,12 @@ module Can
|
|
75
65
|
i = 0
|
76
66
|
while existing_trash_files.include?(filename)
|
77
67
|
i += 1
|
78
|
-
filename = basename
|
68
|
+
filename = "#{basename}.#{i}#{exts}"
|
79
69
|
end
|
80
70
|
|
81
71
|
FileUtils.mv(path, File.join(HOME_TRASH_FILES_DIRECTORY, filename))
|
82
72
|
|
83
|
-
trashinfo_filename = filename
|
73
|
+
trashinfo_filename = "#{filename}.trashinfo"
|
84
74
|
trashinfo_out_path = File.join(HOME_TRASH_INFO_DIRECTORY, trashinfo_filename)
|
85
75
|
File.new(trashinfo_out_path, 'w').syswrite(trashinfo_string)
|
86
76
|
end
|
data/lib/trashinfo.rb
CHANGED
@@ -1,22 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'cgi'
|
2
4
|
|
3
5
|
module Trashinfo
|
4
|
-
def self.new
|
5
|
-
|
6
|
+
def self.new(path)
|
7
|
+
<<~DESKTOP
|
6
8
|
[Trash Info]
|
7
|
-
Path=#{CGI.escape(File.expand_path
|
9
|
+
Path=#{CGI.escape(File.expand_path(path))}
|
8
10
|
DeletionDate=#{Time.now.strftime('%Y-%m-%dT%H:%M:%S')}
|
9
11
|
DESKTOP
|
10
12
|
end
|
11
13
|
|
12
|
-
def self.parse
|
14
|
+
def self.parse(trashinfo)
|
13
15
|
regex = /\A\[Trash Info\]\nPath=(?<path>\S+)\nDeletionDate=(?<deletion_date>\S+)/m
|
14
16
|
|
15
17
|
matches = regex.match trashinfo
|
16
18
|
|
17
|
-
|
18
|
-
:
|
19
|
-
:
|
19
|
+
{
|
20
|
+
path: CGI.unescape(matches[:path]),
|
21
|
+
deletion_date: matches[:deletion_date]
|
20
22
|
}
|
21
23
|
end
|
22
24
|
end
|
data/lib/untrash.rb
CHANGED
@@ -1,18 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Can
|
2
4
|
def self.untrash
|
3
5
|
ARGV.each do |filename|
|
4
6
|
file_path = File.join(HOME_TRASH_FILES_DIRECTORY, filename)
|
5
7
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
8
|
+
unless File.exist? file_path
|
9
|
+
unless @options.include? :force
|
10
|
+
Error.nonfatal "cannot untrash '#{filename}': No such file or directory in trash"
|
11
|
+
end
|
10
12
|
next
|
11
13
|
end
|
12
14
|
|
13
|
-
trashinfo_filename = filename
|
15
|
+
trashinfo_filename = "#{filename}.trashinfo"
|
14
16
|
trashinfo_path = File.join(HOME_TRASH_INFO_DIRECTORY, trashinfo_filename)
|
15
|
-
trashinfo = Trashinfo.parse(File.read
|
17
|
+
trashinfo = Trashinfo.parse(File.read(trashinfo_path))
|
16
18
|
|
17
19
|
original_path = trashinfo[:path]
|
18
20
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: can_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sawyer Shepherd
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|
@@ -32,7 +32,6 @@ executables:
|
|
32
32
|
extensions: []
|
33
33
|
extra_rdoc_files: []
|
34
34
|
files:
|
35
|
-
- ".gitignore"
|
36
35
|
- LICENSE
|
37
36
|
- README.md
|
38
37
|
- bin/can
|
@@ -51,7 +50,7 @@ homepage: https://github.com/sawshep/can
|
|
51
50
|
licenses:
|
52
51
|
- GPL-3.0
|
53
52
|
metadata: {}
|
54
|
-
post_install_message:
|
53
|
+
post_install_message:
|
55
54
|
rdoc_options: []
|
56
55
|
require_paths:
|
57
56
|
- lib
|
@@ -59,15 +58,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
59
58
|
requirements:
|
60
59
|
- - ">="
|
61
60
|
- !ruby/object:Gem::Version
|
62
|
-
version: '0'
|
61
|
+
version: '3.0'
|
63
62
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
63
|
requirements:
|
65
64
|
- - ">="
|
66
65
|
- !ruby/object:Gem::Version
|
67
66
|
version: '0'
|
68
67
|
requirements: []
|
69
|
-
rubygems_version: 3.3.
|
70
|
-
signing_key:
|
68
|
+
rubygems_version: 3.3.7
|
69
|
+
signing_key:
|
71
70
|
specification_version: 4
|
72
71
|
summary: Command-line trash manager
|
73
72
|
test_files: []
|
data/.gitignore
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
/.config
|
4
|
-
/coverage/
|
5
|
-
/InstalledFiles
|
6
|
-
/pkg/
|
7
|
-
/spec/reports/
|
8
|
-
/spec/examples.txt
|
9
|
-
/test/tmp/
|
10
|
-
/test/version_tmp/
|
11
|
-
/tmp/
|
12
|
-
|
13
|
-
# Used by dotenv library to load environment variables.
|
14
|
-
# .env
|
15
|
-
|
16
|
-
# Ignore Byebug command history file.
|
17
|
-
.byebug_history
|
18
|
-
|
19
|
-
## Specific to RubyMotion:
|
20
|
-
.dat*
|
21
|
-
.repl_history
|
22
|
-
build/
|
23
|
-
*.bridgesupport
|
24
|
-
build-iPhoneOS/
|
25
|
-
build-iPhoneSimulator/
|
26
|
-
|
27
|
-
## Specific to RubyMotion (use of CocoaPods):
|
28
|
-
#
|
29
|
-
# We recommend against adding the Pods directory to your .gitignore. However
|
30
|
-
# you should judge for yourself, the pros and cons are mentioned at:
|
31
|
-
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
32
|
-
#
|
33
|
-
# vendor/Pods/
|
34
|
-
|
35
|
-
## Documentation cache and generated files:
|
36
|
-
/.yardoc/
|
37
|
-
/_yardoc/
|
38
|
-
/doc/
|
39
|
-
/rdoc/
|
40
|
-
|
41
|
-
## Environment normalization:
|
42
|
-
/.bundle/
|
43
|
-
/vendor/bundle
|
44
|
-
/lib/bundler/man/
|
45
|
-
|
46
|
-
# for a library or gem, you might want to ignore these files since the code is
|
47
|
-
# intended to run in multiple environments; otherwise, check them in:
|
48
|
-
Gemfile.lock
|
49
|
-
# .ruby-version
|
50
|
-
# .ruby-gemset
|
51
|
-
|
52
|
-
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
53
|
-
.rvmrc
|
54
|
-
|
55
|
-
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
|
56
|
-
# .rubocop-https?--*
|