storazzo 0.3.5 → 0.4.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.
@@ -12,7 +12,7 @@ require "storazzo/media/local_folder"
12
12
  #puts yellow("DISABLING FOR NOW TODO restore")
13
13
 
14
14
  class LocalFolderTest < Minitest::Test
15
- extend Storazzo::Colors
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
- #$config = Storazzo::RicDiskConfig.instance()
25
- #$vediamo_se_funge = 42
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
@@ -41,25 +44,78 @@ class LocalFolderTest < Minitest::Test
41
44
  end
42
45
  end
43
46
 
44
- def test_first_directory_parsing_actually_works()
47
+ # To only test this:
48
+ # $ ruby -I test test/test_local_folder.rb -n test_first_directory_parsing_actually_works
49
+ def TODO_test_1_first_directory_parsing_actually_works()
45
50
  # include module
46
51
 
47
52
  #p $vediamo_se_funge
48
53
  puts("(#{__FILE__}) WEIRD THING: This test is flaky. SKipping for now until I complete the LocalFolder.parse() code")
49
54
  folders = Storazzo::Media::LocalFolder.list_all
50
- config = Storazzo::RicDiskConfig.instance()
55
+ puts "Folders: #{folders}"
56
+ config = Storazzo::RicDiskSampleConfig.instance()
57
+ puts "config1: #{config}"
58
+ config.load
59
+ puts "config2: #{config.load}"
51
60
  test_dir = folders.first
52
- # puts "test_first_directory_parsing_actually_works() TestDir: #{test_dir}"
53
- # puts yellow "TEST S:M:LF methods: #{folders}" # methods
54
- # disk = Storazzo::Media::LocalFolder.new(test_dir)
55
- # stats_file = disk.stats_filename_default_fullpath
56
- # puts "stats_file: #{stats_file}"
57
- # disk.parse()
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()
58
68
  puts "[DEB] config: ''#{config}''"
59
- config.iterate_through_file_list_for_disks( [test_dir])
69
+ # config.iterate_through_file_list_for_disks([test_dir])
60
70
  # assert(
61
71
  # File.exists?(stats_file),
62
72
  # "parse on LocalFolder should create file '#{stats_file}'"
63
73
  # )
64
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
114
+ config.iterate_through_file_list_for_disks([test_dir])
115
+ assert(
116
+ not(File.exists?(stats_file)),
117
+ "parse on LocalFolder should NOT create file '#{stats_file}' but another in another TODO place"
118
+ )
119
+ # ...
120
+ end
65
121
  end
@@ -15,7 +15,6 @@ require "storazzo"
15
15
  #require "storazzo/ric_disk/gcs_bucket"
16
16
  #require "storazzo/media/local_folder"
17
17
 
18
- puts :TODO
19
18
 
20
19
  class RicDiskConfigTest < Minitest::Test
21
20
 
@@ -24,14 +23,13 @@ class RicDiskConfigTest < Minitest::Test
24
23
  #puts :sofar_so_good
25
24
  config_obj = Storazzo::RicDiskSampleConfig.instance()
26
25
  puts "config_obj.class: #{config_obj.class}"
27
- l = config_obj.load # _sample_version
28
- puts l
26
+ config = config_obj.load # _sample_version
27
+ puts "Config: #{config}"
29
28
  #puts '[RicDiskConfigTest] TODO lets make sure the gem being imported is actually in /etc/storazz-config.smaple blah blah'
30
29
  #puts "[RicDiskConfigTest] config_file: ", config_obj.config_file
31
30
  assert_equal(
32
31
  config_obj.config_file,
33
- # Rails.root +
34
- "etc/",
32
+ Storazzo.root + "/etc/storazzo_config.sample.yaml",
35
33
  "Config file expected to be here.."
36
34
  )
37
35
  end
@@ -1,11 +1,11 @@
1
- # require "minitest/autorun"
2
- # require "storazzo"
1
+ require "minitest/autorun"
2
+ require "storazzo"
3
3
 
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
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
- # # end
34
- # end
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.3.5
4
+ version: 0.4.1
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-28 00:00:00.000000000 Z
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
@@ -39,11 +41,9 @@ files:
39
41
  - lib/storazzo/parser/parser.rb
40
42
  - lib/storazzo/ric_disk.rb
41
43
  - lib/storazzo/ric_disk_config.rb
42
- - lib/storazzo/ric_disk_config_example.rb
43
44
  - lib/storazzo/ric_disk_sample_config.rb
44
45
  - lib/storazzo/ric_disk_statsfile.rb
45
46
  - lib/storazzo/ric_disk_ugly.rb
46
- - lib/storazzo/translator.rb
47
47
  - lib/storazzo/version.rb
48
48
  - storazzo.gemspec
49
49
  - test/test_gcs_bucket.rb
@@ -1,9 +0,0 @@
1
-
2
- module Storazzo
3
-
4
- class Storazzo::RicDiskConfigExample # < Storazzo::RicDiskConfig
5
-
6
- end
7
- end
8
-
9
- puts "[REMOVEME]2 Storazzo::RicDiskSampleConfig was read"
@@ -1,17 +0,0 @@
1
- # todo remove
2
- # class Storazzo::Translator
3
-
4
- # def initialize(language)
5
- # @language = language
6
- # end
7
-
8
- # def hi
9
- # case @language
10
- # when "spanish"
11
- # "hola mundo"
12
- # else
13
- # "hello world"
14
- # end
15
- # end
16
-
17
- # end