storazzo 0.5.7 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -5
  3. data/Makefile +8 -6
  4. data/Rakefile +15 -13
  5. data/VERSION +1 -1
  6. data/bin/hello-storazzo +1 -0
  7. data/bin/ricdisk-magic +33 -30
  8. data/bin/stats-with-md5 +182 -157
  9. data/bin/storazzo +112 -114
  10. data/bin/storazzo-symlink.rb +1 -0
  11. data/lib/storazzo/colors.rb +77 -36
  12. data/lib/storazzo/common.rb +72 -68
  13. data/lib/storazzo/debug.rb +2 -0
  14. data/lib/storazzo/hashify.rb +7 -5
  15. data/lib/storazzo/main.rb +59 -49
  16. data/lib/storazzo/media/abstract_ric_disk.rb +188 -179
  17. data/lib/storazzo/media/gcs_bucket.rb +76 -58
  18. data/lib/storazzo/media/local_folder.rb +56 -42
  19. data/lib/storazzo/media/mount_point.rb +20 -12
  20. data/lib/storazzo/ric_disk.rb +386 -383
  21. data/lib/storazzo/ric_disk_config.rb +227 -209
  22. data/lib/storazzo/ric_disk_sample_config.rb +26 -24
  23. data/lib/storazzo/ric_disk_statsfile.rb +19 -17
  24. data/lib/storazzo/ric_disk_ugly.rb +1 -0
  25. data/lib/storazzo/version.rb +3 -3
  26. data/lib/storazzo.rb +6 -7
  27. data/storazzo.gemspec +24 -16
  28. data/test/benchmark/for_future_use.rb +4 -2
  29. data/test/benchmark/test_hashing_functions-speed.rb +17 -0
  30. data/test/bin/new-idea.rb +17 -0
  31. data/test/bin/storazzo.rb +22 -25
  32. data/test/media/test_abstract_ric_disk.rb +5 -3
  33. data/test/media/test_gcs_bucket.rb +24 -23
  34. data/test/media/test_local_folder.rb +24 -23
  35. data/test/media/test_mount_point.rb +6 -5
  36. data/test/test_ric_disk.rb +6 -4
  37. data/test/test_ric_disk_config.rb +12 -11
  38. data/test/test_ric_disk_stats_file.rb +5 -3
  39. data/test/test_storazzo.rb +6 -4
  40. data/var/test/disks/disk02-full/Rakefile +7 -5
  41. data/var/test/disks/ricdisk_stats_v11.rds +11 -0
  42. metadata +13 -21
@@ -1,48 +1,62 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # require "storazzo/ric_disk/abstract_ric_disk"
2
4
  # require "abstract_ric_disk"
3
5
 
4
- module Storazzo::Media
5
- class Storazzo::Media::LocalFolder < Storazzo::Media::AbstractRicDisk
6
- # extend Storazzo::Common
7
- include Storazzo::Common
8
-
9
- attr_accessor :local_mountpoint, :wr
10
-
11
- def initialize(local_mount)
12
- deb "[Storazzo::Media::LocalFolder] initialize"
13
-
14
- @local_mountpoint = File.expand_path(local_mount)
15
- @description = "Local Folder originally in '#{local_mount}'"
16
- raise "Sorry local mount doesnt exist!" unless File.exist?(@local_mountpoint)
17
-
18
- @wr = writeable? # File.writable?(stats_filename_default_fullpath) # .writeable? stats_file_smart_fullpath
19
- # super.initialize(local_mount) rescue "SUPER_ERROR: #{$!}"
20
- super(local_mount) rescue "SUPER_ERROR(#{local_mount}): #{$!}"
21
- end
22
-
23
- def self.list_all() # WRONG: config = nil
24
- # get lists from Config singleton
25
- config = Storazzo::RicDiskConfig.instance # # ).get_config
26
- config.load
27
- config.get_local_folders
28
- end
29
-
30
- def parse(opts = {})
31
- puts "LF.parse(#{opts}): TODO Sbrodola inside the dir: #{local_mountpoint}"
32
- parse_block_storage_folder()
33
- end
34
-
35
- def path
36
- @local_mountpoint
37
- end
38
-
39
- def writeable?
40
- File.writable?(@local_mountpoint)
41
- end
42
-
43
- def default_stats_filename
44
- # '42'
45
- Storazzo::RicDiskStatsFile.default_name
6
+ require 'English'
7
+ module Storazzo
8
+ module Media
9
+ module Storazzo
10
+ module Media
11
+ class LocalFolder < Storazzo::Media::AbstractRicDisk
12
+ # extend Storazzo::Common
13
+ include Storazzo::Common
14
+
15
+ attr_accessor :local_mountpoint, :wr
16
+
17
+ def initialize(local_mount)
18
+ deb '[Storazzo::Media::LocalFolder] initialize'
19
+
20
+ @local_mountpoint = File.expand_path(local_mount)
21
+ @description = "Local Folder originally in '#{local_mount}'"
22
+ raise 'Sorry local mount doesnt exist!' unless File.exist?(@local_mountpoint)
23
+
24
+ @wr = writeable? # File.writable?(stats_filename_default_fullpath) # .writeable? stats_file_smart_fullpath
25
+ # super.initialize(local_mount) rescue "SUPER_ERROR: #{$!}"
26
+ begin
27
+ super(local_mount)
28
+ rescue StandardError
29
+ "SUPER_ERROR(#{local_mount}): #{$ERROR_INFO}"
30
+ end
31
+ end
32
+
33
+ # WRONG: config = nil
34
+ def self.list_all
35
+ # get lists from Config singleton
36
+ config = Storazzo::RicDiskConfig.instance # # ).get_config
37
+ config.load
38
+ config.get_local_folders
39
+ end
40
+
41
+ def parse(opts = {})
42
+ puts "LF.parse(#{opts}): TODO Sbrodola inside the dir: #{local_mountpoint}"
43
+ parse_block_storage_folder
44
+ end
45
+
46
+ def path
47
+ @local_mountpoint
48
+ end
49
+
50
+ def writeable?
51
+ File.writable?(@local_mountpoint)
52
+ end
53
+
54
+ def default_stats_filename
55
+ # '42'
56
+ Storazzo::RicDiskStatsFile.default_name
57
+ end
58
+ end
59
+ end
46
60
  end
47
61
  end
48
62
  end
@@ -1,19 +1,27 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # TODO
2
- module Storazzo::Media
3
- class Storazzo::Media::MountPoint < Storazzo::Media::AbstractRicDisk
4
- # puts "[REMOVEME] Storazzo::Media::MountPoint being read. REMOVEME when you see this :)"
4
+ module Storazzo
5
+ module Media
6
+ module Storazzo
7
+ module Media
8
+ class MountPoint < Storazzo::Media::AbstractRicDisk
9
+ # puts "[REMOVEME] Storazzo::Media::MountPoint being read. REMOVEME when you see this :)"
5
10
 
6
- def self.list_local_mount_points()
7
- deb "Maybe its abuot time you refactor that method here :)"
8
- RicDisk.interesting_mount_points()
9
- end
11
+ def self.list_local_mount_points
12
+ deb 'Maybe its abuot time you refactor that method here :)'
13
+ RicDisk.interesting_mount_points
14
+ end
10
15
 
11
- def self.list_all
12
- RicDisk.interesting_mount_points
13
- end
16
+ def self.list_all
17
+ RicDisk.interesting_mount_points
18
+ end
14
19
 
15
- def self.list_all_with_type()
16
- list_all.map{|x| [:mount_point_todo_less_generic, x] }
20
+ def self.list_all_with_type
21
+ list_all.map { |x| [:mount_point_todo_less_generic, x] }
22
+ end
23
+ end
24
+ end
17
25
  end
18
26
  end
19
27
  end