storazzo 0.1.1 → 0.1.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/Makefile +6 -2
- data/README.md +11 -2
- data/VERSION +1 -1
- data/bin/ricdisk-magic +1 -1
- data/lib/storazzo/main.rb +18 -4
- data/lib/storazzo/ric_disk.rb +10 -1
- data/lib/storazzo.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f27732afb2b636a54136fdd1db2270c163addc37dc85d35585cee8c4c946b090
|
4
|
+
data.tar.gz: a7fe6fbc15aedbef4578662418f1b8d67073d45865d7485efa6816ae14421611
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cb68f6675345a08f6a619b3ff0ef0dadc2455c5bc10aecc9f9e8b245f2d271b72a0b0531f4c6149f41cde81bfeb154345a7bc2388d1beca7ac41db25018dd7b
|
7
|
+
data.tar.gz: 610059ea7c57e7d303c945104a106935310b141e5322f9096683bc6bbf2dd7f4ec4257ed02c6ebfa1acf24fdb891a6eceb886d6225565424a43fb7087e90a955
|
data/Makefile
CHANGED
@@ -23,14 +23,18 @@ list:
|
|
23
23
|
|
24
24
|
test:
|
25
25
|
echo 1. Testing the library end to end by requiring it..
|
26
|
-
echo "Storazzo::Main.all_tests "
|
27
|
-
|
26
|
+
echo "Storazzo::Main.all_tests " | irb -Ilib -rstorazzo
|
27
|
+
make mounts
|
28
28
|
#echo 2. Testing ricdisk-magic
|
29
29
|
#bin/ricdisk-magic Ciao-da-Makefile
|
30
30
|
echo 3. run rake test.. ont configured yet just a memo for the future.
|
31
31
|
RUBYOPT="-W0" rake test
|
32
32
|
@echo 'OK: ALL TESTS PASSED. #STIKA'
|
33
33
|
|
34
|
+
mounts:
|
35
|
+
echo "Storazzo::Main.all_mounts " | irb -Ilib -rstorazzo
|
36
|
+
|
37
|
+
|
34
38
|
irb:
|
35
39
|
irb -Ilib -rstorazzo
|
36
40
|
|
data/README.md
CHANGED
@@ -1,10 +1,19 @@
|
|
1
1
|
|
2
2
|
# storazzo Gem
|
3
3
|
|
4
|
-
Storazzo 💎 gem - a Gem to automatically parse your FS for mounts and compute MD5 of all files therein and then collect in central DB through StorazzoApp (TM).
|
4
|
+
📦 Storazzo 💎 gem - a Gem to automatically parse your FS for mounts (💽 💾 💿 ) and compute MD5 (🤐) of all files therein and then collect in central DB 🔋 through 📦 StorazzoApp📦 (TM).
|
5
5
|
|
6
6
|
# INSTALL
|
7
7
|
|
8
8
|
`gem install storazzo`
|
9
9
|
|
10
|
-
(Latest version is hosted in https://rubygems.org/gems/storazzo)
|
10
|
+
(Latest version is hosted in https://rubygems.org/gems/storazzo)
|
11
|
+
|
12
|
+
# Thanks
|
13
|
+
|
14
|
+
Inspiration from:
|
15
|
+
|
16
|
+
* hola gem awesome guide: https://guides.rubygems.org/make-your-own-gem/
|
17
|
+
* RubyGem from DHH: https://github.com/rails/strong_parameters/tree/master/lib for how to trustucre lib/ and gemspec.
|
18
|
+
* Stackoverflow and Google for the rest.
|
19
|
+
* Elio e le Storie Tese: _Sai chi ti scandisce il disco un casino? Storazzo!_
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/bin/ricdisk-magic
CHANGED
@@ -88,7 +88,7 @@ $myconf = {
|
|
88
88
|
Il tutto condito con un bel protobuf e un'entita che metto in Lib.
|
89
89
|
".strip.gsub(/^\s+/, "").gsub(/\s+$/, ""),
|
90
90
|
# TODO move to some class default
|
91
|
-
:media_dirs => %w{ /media/riccardo/ /Volumes/ /mnt/ ~/git/storazzo/test/ /sobenme/giusto/per/imparare/ad/ammutolire/gli/errori/ },
|
91
|
+
:media_dirs => %w{ /media/riccardo/ /Volumes/ /mnt/ ~/git/storazzo/var/test/ /sobenme/giusto/per/imparare/ad/ammutolire/gli/errori/ },
|
92
92
|
:mount_types => %w{ vfat ntfs },
|
93
93
|
}
|
94
94
|
$stats_file = "ricdisk_stats_v11.rds"
|
data/lib/storazzo/main.rb
CHANGED
@@ -3,6 +3,17 @@
|
|
3
3
|
# eg from RicDisk.
|
4
4
|
|
5
5
|
module Storazzo
|
6
|
+
|
7
|
+
# This is the Main Class - an entrypoint to call the meravilles hidden therein.
|
8
|
+
#
|
9
|
+
# Example:
|
10
|
+
# >> Storazzo.hi("ciao bello")
|
11
|
+
# => Hello from Storazzo v0.1.1!
|
12
|
+
#
|
13
|
+
# Arguments:
|
14
|
+
# message: (String) - optional
|
15
|
+
|
16
|
+
|
6
17
|
class Storazzo::Main # Can be same name as Module: https://stackoverflow.com/questions/13261474/ruby-modules-and-classes-same-name-in-structure
|
7
18
|
require 'storazzo/colors'
|
8
19
|
extend Storazzo::Colors
|
@@ -16,12 +27,16 @@ module Storazzo
|
|
16
27
|
end
|
17
28
|
|
18
29
|
def self.all_mounts(opts={})
|
19
|
-
extend Storazzo::RicDisk
|
20
30
|
opts_verbose = opts.fetch :verbose, true
|
21
31
|
|
32
|
+
self.hi "Storazzo::Main.all_mounts(): BEGIN - RicDiskVersion is: #{Storazzo::RicDisk::RICDISK_VERSION}"
|
33
|
+
|
22
34
|
pwhite "TODO(ricc): show a list of all RicDisk relevant mounts" if opts_verbose
|
23
35
|
#sbrodola_ricdisk("/Volumes/")
|
24
|
-
|
36
|
+
Storazzo::RicDisk.find_active_dirs
|
37
|
+
#Storazzo::RicDisk.sbrodola_ricdisk StorazzoMod::root + "./var/disks/"
|
38
|
+
#sbrodola_ricdisk(StorazzoMod::root + "./var/disks/") rescue "[Storazzo::AllMount] SomeError: #{$!}"
|
39
|
+
self.hi 'Storazzo::Main.all_mounts(): END'
|
25
40
|
end
|
26
41
|
|
27
42
|
def self.all_tests
|
@@ -30,9 +45,8 @@ module Storazzo
|
|
30
45
|
#include Storazzo::Colors
|
31
46
|
extend Storazzo::Colors
|
32
47
|
|
33
|
-
pwhite "All tests BEGIN"
|
48
|
+
pwhite "All tests BEGIN - todo obsolete this now that I have proper Rake testing suite..."
|
34
49
|
deb "Maybe debug is enabled?"
|
35
|
-
#puts "This is Storazzo v#{StorazzoMod::VERSION}"
|
36
50
|
hi
|
37
51
|
# This works with EXTEND..
|
38
52
|
puts(yellow "Just YELLOW 0")
|
data/lib/storazzo/ric_disk.rb
CHANGED
@@ -3,6 +3,15 @@
|
|
3
3
|
module Storazzo
|
4
4
|
class Storazzo::RicDisk
|
5
5
|
RICDISK_VERSION = "1.0"
|
6
|
+
DEFAULT_MEDIA_DIRS = %w{
|
7
|
+
/media/riccardo/
|
8
|
+
/Volumes/
|
9
|
+
/mnt/
|
10
|
+
~/git/storazzo/var/test/disks/
|
11
|
+
/wrong/on/purpose/
|
12
|
+
}.append(Storazzo.root + "/var/test/disks/")
|
13
|
+
|
14
|
+
|
6
15
|
include Hashify
|
7
16
|
extend Storazzo::Colors
|
8
17
|
|
@@ -168,7 +177,7 @@ module Storazzo
|
|
168
177
|
end
|
169
178
|
|
170
179
|
def self.find_active_dirs(base_dirs=nil, also_mountpoints=true)
|
171
|
-
base_dirs =
|
180
|
+
base_dirs = DEFAULT_MEDIA_DIRS if base_dirs.nil?
|
172
181
|
active_dirs = []
|
173
182
|
base_dirs.each do |ugly_dir|
|
174
183
|
# https://stackoverflow.com/questions/1899072/getting-a-list-of-folders-in-a-directory#:~:text=Dir.chdir(%27/destination_directory%27)%0ADir.glob(%27*%27).select%20%7B%7Cf%7C%20File.directory%3F%20f%7D
|
data/lib/storazzo.rb
CHANGED