storazzo 0.3.7 → 0.4.2
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/Gemfile +1 -0
- data/VERSION +1 -1
- data/bin/stats-with-md5 +428 -0
- data/lib/storazzo/media/gcs_bucket.rb +4 -2
- data/lib/storazzo/ric_disk.rb +111 -47
- data/lib/storazzo/ric_disk_config.rb +32 -21
- data/lib/storazzo/ric_disk_sample_config.rb +1 -1
- data/lib/storazzo/ric_disk_ugly.rb +245 -245
- data/storazzo.gemspec +4 -1
- data/test/test_gcs_bucket.rb +26 -15
- data/test/test_local_folder.rb +67 -15
- data/test/test_storazzo.rb +9 -9
- metadata +4 -2
data/test/test_local_folder.rb
CHANGED
@@ -11,8 +11,8 @@ require "storazzo/media/local_folder"
|
|
11
11
|
|
12
12
|
#puts yellow("DISABLING FOR NOW TODO restore")
|
13
13
|
|
14
|
-
class LocalFolderTest
|
15
|
-
|
14
|
+
class LocalFolderTest < Minitest::Test
|
15
|
+
include Storazzo::Colors
|
16
16
|
# def test_fail_on_purpOSE # test_storazzo_hi_with_argument
|
17
17
|
# assert_match 42, 42 , "change me when it failes from makefile"
|
18
18
|
# #"Hello from Storazzo", Storazzo::Main.hi("ruby this should fail")
|
@@ -21,8 +21,11 @@ class LocalFolderTest # < Minitest::Test
|
|
21
21
|
def tear_up
|
22
22
|
include Storazzo::Colors
|
23
23
|
puts yellow("LocalFolderTest: tear up")
|
24
|
-
#$
|
25
|
-
|
24
|
+
#$config_useless = Storazzo::RicDiskConfig.instance()
|
25
|
+
$config = Storazzo::RicDiskSampleConfig.instance()
|
26
|
+
$config_load = $config.load()
|
27
|
+
puts $config.to_verbose_s
|
28
|
+
|
26
29
|
# my_class = Storazzo::RicDisk::LocalFolder
|
27
30
|
# my_obj = Storazzo::RicDisk::LocalFolder
|
28
31
|
end
|
@@ -43,27 +46,76 @@ class LocalFolderTest # < Minitest::Test
|
|
43
46
|
|
44
47
|
# To only test this:
|
45
48
|
# $ ruby -I test test/test_local_folder.rb -n test_first_directory_parsing_actually_works
|
46
|
-
def
|
49
|
+
def TODO_test_1_first_directory_parsing_actually_works()
|
47
50
|
# include module
|
48
51
|
|
49
52
|
#p $vediamo_se_funge
|
50
53
|
puts("(#{__FILE__}) WEIRD THING: This test is flaky. SKipping for now until I complete the LocalFolder.parse() code")
|
51
54
|
folders = Storazzo::Media::LocalFolder.list_all
|
52
55
|
puts "Folders: #{folders}"
|
53
|
-
config = Storazzo::
|
54
|
-
puts "
|
56
|
+
config = Storazzo::RicDiskSampleConfig.instance()
|
57
|
+
puts "config1: #{config}"
|
58
|
+
config.load
|
59
|
+
puts "config2: #{config.load}"
|
55
60
|
test_dir = folders.first
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
#
|
61
|
+
puts "test_first_directory_parsing_actually_works() TestDir: #{test_dir}"
|
62
|
+
puts yellow "TEST S:M:LF methods: #{folders}" # methods
|
63
|
+
|
64
|
+
disk = Storazzo::Media::LocalFolder.new(test_dir)
|
65
|
+
stats_file = disk.stats_filename_default_fullpath
|
66
|
+
puts "stats_file: #{stats_file}"
|
67
|
+
disk.parse()
|
62
68
|
puts "[DEB] config: ''#{config}''"
|
69
|
+
# config.iterate_through_file_list_for_disks([test_dir])
|
70
|
+
# assert(
|
71
|
+
# File.exists?(stats_file),
|
72
|
+
# "parse on LocalFolder should create file '#{stats_file}'"
|
73
|
+
# )
|
74
|
+
end
|
75
|
+
|
76
|
+
def test_vars_transporeted_across_teraup_and_tests
|
77
|
+
puts $config_load
|
78
|
+
puts $config
|
79
|
+
end
|
80
|
+
|
81
|
+
def TODO_test_2_iterate_through_file_list_for_disks
|
82
|
+
#p $vediamo_se_funge
|
83
|
+
puts("(#{__FILE__}) WEIRD THING: This test is flaky. SKipping for now until I complete the LocalFolder.parse() code")
|
84
|
+
folders = Storazzo::Media::LocalFolder.list_all
|
85
|
+
puts "Folders: #{folders}"
|
86
|
+
config = Storazzo::RicDiskSampleConfig.instance()
|
87
|
+
puts "config1: #{config}"
|
88
|
+
config.load
|
89
|
+
puts "config2: #{config.load}"
|
90
|
+
test_dir = folders.first
|
91
|
+
puts "test_first_directory_parsing_actually_works() TestDir: #{test_dir}"
|
92
|
+
puts "TEST S:M:LF methods: #{folders}" # methods
|
93
|
+
|
94
|
+
disk = Storazzo::Media::LocalFolder.new(test_dir)
|
95
|
+
stats_file = disk.stats_filename_default_fullpath
|
96
|
+
#puts "stats_file: #{stats_file}"
|
97
|
+
#disk.parse()
|
98
|
+
#puts "[DEB] config: ''#{config}''"
|
99
|
+
|
100
|
+
#TEST2: config + iterate
|
101
|
+
config.iterate_through_file_list_for_disks([test_dir])
|
102
|
+
assert(
|
103
|
+
File.exists?(stats_file),
|
104
|
+
"parse on LocalFolder should create file '#{stats_file}'"
|
105
|
+
)
|
106
|
+
end
|
107
|
+
|
108
|
+
def test_readonly_folder
|
109
|
+
test_dir = "/etc/"
|
110
|
+
disk = Storazzo::Media::LocalFolder.new(test_dir)
|
111
|
+
stats_file = disk.stats_filename_default_fullpath
|
112
|
+
config = Storazzo::RicDiskSampleConfig.instance()
|
113
|
+
config.load
|
63
114
|
config.iterate_through_file_list_for_disks([test_dir])
|
64
115
|
assert(
|
65
|
-
|
66
|
-
|
116
|
+
not(File.exists?(stats_file)),
|
117
|
+
"parse on LocalFolder should NOT create file '#{stats_file}' but another in another TODO place"
|
67
118
|
)
|
119
|
+
# ...
|
68
120
|
end
|
69
121
|
end
|
data/test/test_storazzo.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require "minitest/autorun"
|
2
|
+
require "storazzo"
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
class StorazzoTest < Minitest::Test
|
5
|
+
def test_storazzo_hi_with_argument
|
6
|
+
assert_match "Hello from Storazzo", Storazzo::Main.say_hi("ruby this should fail")
|
7
|
+
assert_match "ruby this should fail", Storazzo::Main.say_hi("ruby this should fail")
|
8
|
+
end
|
9
9
|
# def test_storazzo_hi_without_argument
|
10
10
|
# assert_match "Hello from Storazzo", Storazzo::Main.say_hi()
|
11
11
|
# end
|
@@ -30,5 +30,5 @@
|
|
30
30
|
# # def test_spanish_hello
|
31
31
|
# # assert_equal "hola mundo",
|
32
32
|
# # Hola.hi("spanish")
|
33
|
-
#
|
34
|
-
|
33
|
+
# end
|
34
|
+
end
|
metadata
CHANGED
@@ -1,20 +1,21 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: storazzo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Riccardo Carlesso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A simple gem to manage your external hard drives and extract MD5 and
|
14
14
|
common stuff from them.
|
15
15
|
email: name dot surname at popular Google-owned Mail
|
16
16
|
executables:
|
17
17
|
- ricdisk-magic
|
18
|
+
- stats-with-md5
|
18
19
|
extensions: []
|
19
20
|
extra_rdoc_files: []
|
20
21
|
files:
|
@@ -25,6 +26,7 @@ files:
|
|
25
26
|
- Rakefile
|
26
27
|
- VERSION
|
27
28
|
- bin/ricdisk-magic
|
29
|
+
- bin/stats-with-md5
|
28
30
|
- lib/storazzo.rb
|
29
31
|
- lib/storazzo/colors.rb
|
30
32
|
- lib/storazzo/common.rb
|