storazzo 0.4.2 → 0.5.0

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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -4
  3. data/Makefile +20 -1
  4. data/README.md +23 -0
  5. data/Rakefile +35 -8
  6. data/VERSION +1 -1
  7. data/bin/hello-storazzo +5 -0
  8. data/bin/ricdisk-magic +50 -57
  9. data/bin/stats-with-md5 +268 -297
  10. data/lib/storazzo/colors.rb +43 -45
  11. data/lib/storazzo/common.rb +80 -17
  12. data/lib/storazzo/debug.rb +5 -8
  13. data/lib/storazzo/hashify.rb +44 -43
  14. data/lib/storazzo/main.rb +44 -40
  15. data/lib/storazzo/media/abstract_ric_disk.rb +163 -104
  16. data/lib/storazzo/media/gcs_bucket.rb +51 -15
  17. data/lib/storazzo/media/local_folder.rb +43 -46
  18. data/lib/storazzo/media/mount_point.rb +12 -2
  19. data/lib/storazzo/ric_disk.rb +223 -251
  20. data/lib/storazzo/ric_disk_config.rb +230 -193
  21. data/lib/storazzo/ric_disk_sample_config.rb +12 -16
  22. data/lib/storazzo/ric_disk_statsfile.rb +17 -16
  23. data/lib/storazzo/ric_disk_ugly.rb +35 -38
  24. data/lib/storazzo/version.rb +7 -7
  25. data/lib/storazzo.rb +34 -29
  26. data/storazzo.gemspec +22 -20
  27. data/test/media/test_abstract_ric_disk.rb +19 -0
  28. data/test/media/test_gcs_bucket.rb +58 -0
  29. data/test/media/test_local_folder.rb +145 -0
  30. data/test/media/test_mount_point.rb +25 -0
  31. data/test/test_ric_disk.rb +16 -0
  32. data/test/test_ric_disk_config.rb +20 -29
  33. data/test/test_ric_disk_stats_file.rb +13 -14
  34. data/test/test_storazzo.rb +26 -26
  35. data/var/dumps/file_stat.linux.yaml +15 -0
  36. data/var/dumps/file_stat.macosx.yaml +15 -0
  37. data/var/test/disks/disk02-full/Rakefile +13 -0
  38. data/var/test/disks/ricdisk_stats_v11.rds +11 -0
  39. metadata +38 -10
  40. data/test/test_gcs_bucket.rb +0 -70
  41. data/test/test_local_folder.rb +0 -121
@@ -1,210 +1,247 @@
1
1
  require 'singleton'
2
2
  require 'yaml'
3
3
 
4
+ # require 'storazzo/media/abstract_ric_disk'
5
+ Dir[File.dirname(__FILE__) + '/../lib/*.rb'].each do |file|
6
+ require File.basename(file, File.extname(file))
7
+ end
8
+ # require_all 'media/directory'
9
+
4
10
  =begin
5
11
  This is a singleton class. You call me this way..
6
12
  You call me with:
7
13
 
8
14
  Storazzo::RicDiskConfig.instance()
9
15
 
16
+ or better
17
+
18
+ Storazzo::RicDiskConfig.safe_instance()
19
+
10
20
  Note that being a Singleton, in Unit Tests it's hard to use the /etc/storazzo_config.sample.yaml instead
11
21
  of the real one - yiikes. How do I fix it? Do I unsingleton it? :) Or do I create TWO singletons? :)
12
22
  =end
13
23
 
14
24
  module Storazzo
15
- # class Storazzo::Blah
16
- # end
17
-
18
- class Storazzo::RicDiskConfig
19
- include Singleton
20
- include Storazzo::Common
21
- include Storazzo::Colors
22
-
23
- #@@default_config_location = "~/.storazzo.yaml"
24
- DefaultConfigLocation = File.expand_path "~/.storazzo.yaml"
25
- # @@default_config_locations = [
26
- # "~/.storazzo.yaml" , # HOME
27
- # "./.storazzo.yaml" , # LOCAL DIR
28
- # ]
29
- DefaultConfigLocations = [
30
- File.expand_path("~/.storazzo.yaml") , # HOME
31
- File.expand_path("./.storazzo.yaml") , # LOCAL DIR
32
- ]
33
- #@@default_gem_location_for_tests
34
- DefaultGemLocationForTests = File.expand_path('../../../', __FILE__) + "/etc/storazzo_config.sample.yaml"
35
-
36
- attr_accessor :config, :config_file, :load_called
37
-
38
- public
39
- # Load from the first valid config.
40
- def load(config_path=nil, opts={})
41
- verbose = opts.fetch :verbose, false
42
-
43
- if already_loaded? # and not self.config.nil?
44
- puts "[#{self.class}] VERBOSE load: already loaded" if verbose
45
- return self.config
46
- end
47
-
48
- puts "[VERBOSE] Storazzo::RicDiskConfig.load(): BEGIN " if verbose
49
- # trying default location
50
- raise "DefaultConfigLocation is not a string" unless DefaultConfigLocation.is_a?(String)
51
- possible_locations = DefaultConfigLocations # [ @@default_config_location , "./.storazzo.yaml"]
52
- puts "DEB possible_locations: #{possible_locations}"
53
- if config_path.is_a?(String)
54
- #possible_locations = [config_path] + possible_locations # .append()
55
- possible_locations = possible_locations.unshift(config_path) # append to front
56
- #OR: possible_locations.instert(0, config_path)
57
- puts "[LOAD] possible_locations: #{possible_locations}" if verbose
58
- end
59
- puts "[VERBOSE] Searching these paths in order: #{possible_locations}" if verbose
60
- bug "This is not always an array of sTRINGS."
61
- raise "possible_locations is not an array" unless possible_locations.is_a?(Array)
62
- possible_locations.each do |possible_path|
63
- # ASSERT is a string
64
- raise "possible_path is not a string" unless possible_path.is_a?(String)
65
- deb "before buggy expand_path paz: '#{possible_path}''"
66
- paz = File.expand_path(possible_path) rescue possible_path
67
- raise "Not a string: #{paz}" unless paz.is_a?(String)
68
- if File.exists?(paz)
69
- @config_file = paz
70
- @config = YAML.load(File.read paz) # YAML.load(File.read("file_path"))
71
-
72
- unless (@config["kind"] == 'StorazzoConfig' rescue false)
73
- puts white "RicDiskConfig.load(): Sorry this is wrong Config File. Kind=#{@config["kind"] rescue $!}"
74
- next
75
- end
76
- #
77
- #pp @config if verbose
78
- config_ver = @config["apiVersion"]
79
- #puts @config[:ConfigVersion]
80
- deb("OK. Storazzo::RicDiskConfig v'#{config_ver}' parsed correctly")
81
- #puts "[VERBOSE] RicDiskConfig.to_s: #{self}" if verbose
82
- @load_called = true
83
- return self.config
84
- end
85
- end
86
- @load_called = true
87
- # only get here if nothing is found
88
- raise "No config found across these locations: #{possible_locations}. Consider copying and editing: #{RicDiskConfig.gem_default_config_path}"
89
- end
90
-
91
- # Obsolete, call another class instead.
92
- def load_sample_version
93
- # puts("Warning! We're destroying the world here. We're taking a Singletong and changing the way it behaves by moving the config file by under her feet. Don't be mad at me if this misbehaves. You saw it coming, my friends. This is why I would NEVER hire you as a Software Developer in my Company.")
94
- raise "DEPRECATED! USE SampleRicDiskConfig.load() instead!"
95
- # load(DefaultGemLocationForTests, :verbose => true )
96
- end
97
-
98
- def config_ver
99
- raise "I cant compute Version since I cant compute @config. Are you sure you didnt instance this Singleton without calling load?" if @config.nil?
100
- @config['apiVersion'] # rescue :StillUnknown
101
- #config['ConfigVersion']
102
- end
103
- def config_default_folder
104
- #self.
105
- @config['Config']['DefaultFolder'] #rescue "Unknown config_default_folder: #{$!}"
106
- end
107
- def already_loaded?
108
- #return
109
- load_called == true
110
- end
111
-
112
- def to_s
113
- size = File.size(@config_file) rescue -1
114
- #puts yellow "DEB: #{@config["apiVersion"]}"
115
- #"RicDiskConfig(ver=#{config_ver}, file=#{config_file}), #{white(size)} bytes" # - config_default_folder=#{self.config_default_folder}"
116
- "POLY_#{self.class}_(ver=#{config_ver}, file=#{config_file}), #{white(size)} bytes" # - config_default_folder=#{self.config_default_folder}"
117
- end
118
-
119
- def to_verbose_s
120
- h = {}
121
- h[:description] = "This is a Verbose Hash describing a RicDiskConfig or its child RicDiskSampleConfig to understand why it keeps failing.."
122
- h[:to_s] = self.to_s
123
- h[:class] = self.class
124
- h[:file] = __FILE__
125
- h[:id] = self.object_id
126
- h[:get_bucket_paths] = self.get_bucket_paths()
127
- h[:get_local_folders] = self.get_local_folders()
128
- return h
25
+ # class Storazzo::Blah
26
+ # end
27
+
28
+ class Storazzo::RicDiskConfig
29
+ include Singleton
30
+ include Storazzo::Common
31
+ include Storazzo::Colors
32
+
33
+ DefaultConfigLocation = File.expand_path "~/.storazzo.yaml"
34
+
35
+ DefaultConfigLocations = [
36
+ File.expand_path("~/.storazzo.yaml"), # HOME
37
+ File.expand_path("./.storazzo.yaml"), # LOCAL DIR
38
+ ]
39
+
40
+ DefaultGemLocationForTests =
41
+ File.expand_path('../../../', __FILE__) +
42
+ "/etc/storazzo_config.sample.yaml"
43
+
44
+ attr_accessor :config, :config_file, :load_called
45
+
46
+ public
47
+
48
+ # Load from the first valid config.
49
+ def load(config_path = nil, opts = {})
50
+ verbose = opts.fetch :verbose, false
51
+
52
+ if already_loaded? # and not self.config.nil?
53
+ pverbose verbose, "[#{self.class}] VERBOSE load: already loaded"
54
+ return self.config
55
+ end
56
+ pverbose verbose, "Storazzo::RicDiskConfig.load(): BEGIN"
57
+ # trying default location
58
+ raise "DefaultConfigLocation is not a string" unless DefaultConfigLocation.is_a?(String)
59
+
60
+ possible_locations = DefaultConfigLocations # [ default_config_locations .. , "./.storazzo.yaml"]
61
+ deb "[Config.load] Possible Locations: #{possible_locations}"
62
+ if config_path.is_a?(String)
63
+ # possible_locations = [config_path] + possible_locations # .append()
64
+ possible_locations = possible_locations.unshift(config_path) # append to front
65
+ # OR: possible_locations.instert(0, config_path)
66
+ pverbose verbose, "[LOAD] possible_locations: #{possible_locations}"
67
+ end
68
+ puts "[VERBOSE] Searching these paths in order: #{possible_locations}" if verbose
69
+ # bug "This is not always an array of sTRINGS."
70
+ raise "possible_locations is not an array" unless possible_locations.is_a?(Array)
71
+
72
+ possible_locations.each do |possible_path|
73
+ # ASSERT is a string
74
+ raise "possible_path is not a string" unless possible_path.is_a?(String)
75
+
76
+ deb "before buggy expand_path paz: '#{possible_path}''"
77
+ paz = File.expand_path(possible_path) rescue possible_path
78
+ raise "Not a string: #{paz}" unless paz.is_a?(String)
79
+
80
+ if File.exists?(paz)
81
+ @config_file = paz
82
+ @config = YAML.load(File.read paz) # YAML.load(File.read("file_path"))
83
+
84
+ unless (@config["kind"] == 'StorazzoConfig' rescue false)
85
+ puts white "RicDiskConfig.load(): Sorry this is wrong Config File. Kind=#{@config["kind"] rescue $!}"
86
+ next
87
+ end
88
+ #
89
+ # pp @config if verbose
90
+ config_ver = @config["apiVersion"]
91
+ # puts @config[:ConfigVersion]
92
+ deb("OK. Storazzo::RicDiskConfig v'#{config_ver}' parsed correctly")
93
+ # puts "[VERBOSE] RicDiskConfig.to_s: #{self}" if verbose
94
+ @load_called = true
95
+ return self.config
129
96
  end
130
-
131
- def get_config(opts={})
132
- return load(opts) if @config.nil?
133
- @config
134
- end
135
-
136
- def self.gem_default_config_path
137
- Storazzo.root + "/etc/storazzo_config.sample.yaml"
138
- end
139
-
140
-
141
- # returns all folders from file which are Directories
142
- # This method is FLAKY! Sometimes gives error.
143
- # LocalFolderTest#test_show_all_shouldnt_fail_and_should_return_a_non_empty_array:
144
- # TypeError: no implicit conversion of Hash into String
145
- # /Users/ricc/git/storazzo/lib/storazzo/ric_disk_config.rb:38:in `expand_path'
146
- # /Users/ricc/git/storazzo/lib/storazzo/ric_disk_config.rb:38:in `block in load'
147
- # /Users/ricc/git/storazzo/lib/storazzo/ric_disk_config.rb:37:in `each'
148
- # /Users/ricc/git/storazzo/lib/storazzo/ric_disk_config.rb:37:in `load'
149
- # /Users/ricc/git/storazzo/lib/storazzo/ric_disk_config.rb:83:in `get_config'
150
- # /Users/ricc/git/storazzo/lib/storazzo/ric_disk_config.rb:95:in `get_local_folders'
151
- def get_local_folders
152
- config = get_config
153
- #puts config['Config']['AdditionalMountDirs']
154
- config['Config']['AdditionalMountDirs'].map{|folder|
155
- File.expand_path(folder) rescue folder # TypeError: no implicit conversion of Hash into String
156
- }.filter{|f| File.directory?(f)}
157
- end
158
-
159
- def get_bucket_paths
160
- get_config['Config']['Backends']['GoogleCloudStorage']['BucketPaths'].map{|complex_gcs_struct| complex_gcs_struct['path']}
97
+ end
98
+ @load_called = true
99
+ # only get here if nothing is found
100
+ raise "No config found across these locations: #{possible_locations}. Consider copying and editing: #{RicDiskConfig.gem_default_config_path}"
101
+ end
102
+
103
+ # Obsolete, call another class instead.
104
+ def load_sample_version
105
+ raise "DEPRECATED! USE SampleRicDiskConfig.load() instead!"
106
+ end
107
+
108
+ def config_ver
109
+ raise "I cant compute Version since I cant compute @config. Are you sure you didnt instance this Singleton without calling load?" if @config.nil?
110
+
111
+ @config['apiVersion'] # rescue :StillUnknown
112
+ # config['ConfigVersion']
113
+ end
114
+
115
+ def config_default_folder
116
+ # self.
117
+ @config['Config']['DefaultFolder'] # rescue "Unknown config_default_folder: #{$!}"
118
+ end
119
+
120
+ def config_project_id
121
+ @config['Config']['Backends']['GoogleCloudStorage']['ProjectId']
122
+ end
123
+
124
+ def already_loaded?
125
+ # return
126
+ load_called == true
127
+ end
128
+
129
+ def to_s
130
+ size = File.size(@config_file) rescue -1
131
+ # puts yellow "DEB: #{@config["apiVersion"]}"
132
+ # "RicDiskConfig(ver=#{config_ver}, file=#{config_file}), #{white(size)} bytes" # - config_default_folder=#{self.config_default_folder}"
133
+ "POLY_#{self.class}_(ver=#{config_ver}, file=#{config_file}), #{white(size)} bytes" # - config_default_folder=#{self.config_default_folder}"
134
+ end
135
+
136
+ def to_verbose_s
137
+ h = {}
138
+ h[:description] =
139
+ "This is a Verbose Hash describing a RicDiskConfig or its child RicDiskSampleConfig to understand why it keeps failing.."
140
+ h[:to_s] = self.to_s
141
+ h[:class] = self.class
142
+ h[:file] = __FILE__
143
+ h[:id] = self.object_id
144
+ h[:get_bucket_paths] = self.get_bucket_paths()
145
+ h[:get_local_folders] = self.get_local_folders()
146
+ h[:config_project_id] = self.config_project_id()
147
+ return h
148
+ end
149
+
150
+ def get_config(opts = {})
151
+ return load(opts) if @config.nil?
152
+
153
+ @config
154
+ end
155
+
156
+ def self.gem_default_config_path
157
+ Storazzo.root + "/etc/storazzo_config.sample.yaml"
158
+ end
159
+
160
+ # Storazzo::RicDiskConfig
161
+
162
+ # returns all folders from file which are Directories
163
+ # This method is FLAKY! Sometimes gives error.
164
+ # LocalFolderTest#test_show_all_shouldnt_fail_and_should_return_a_non_empty_array:
165
+ # TypeError: no implicit conversion of Hash into String
166
+ # /Users/ricc/git/storazzo/lib/storazzo/ric_disk_config.rb:38:in `expand_path'
167
+ # /Users/ricc/git/storazzo/lib/storazzo/ric_disk_config.rb:38:in `block in load'
168
+ # /Users/ricc/git/storazzo/lib/storazzo/ric_disk_config.rb:37:in `each'
169
+ # /Users/ricc/git/storazzo/lib/storazzo/ric_disk_config.rb:37:in `load'
170
+ # /Users/ricc/git/storazzo/lib/storazzo/ric_disk_config.rb:83:in `get_config'
171
+ # /Users/ricc/git/storazzo/lib/storazzo/ric_disk_config.rb:95:in `get_local_folders'
172
+ def get_local_folders
173
+ config = get_config
174
+ # puts config['Config']['AdditionalMountDirs']
175
+ config['Config']['AdditionalMountDirs'].map { |folder|
176
+ File.expand_path(folder) rescue folder # TypeError: no implicit conversion of Hash into String
177
+ }.filter { |f| File.directory?(f) }
178
+ end
179
+
180
+ def get_bucket_paths
181
+ get_config['Config']['Backends']['GoogleCloudStorage']['BucketPaths'].map { |complex_gcs_struct|
182
+ complex_gcs_struct['path']
183
+ }
184
+ end
185
+
186
+ # UGLY CODE, copipasted from binary for ARGV, ex autosbrodola
187
+ def iterate_through_file_list_for_disks(files_list = [], opts = {})
188
+ verbose = opts.fetch :verbose, false
189
+ raise "[iterate_through_file_list_for_disks] Wrong input, I need an array here: #{files_list} " unless files_list.is_a?(Array)
190
+
191
+ # I decided i wont accept an emopty list, this is not how you use the gem, you lazy XXX!
192
+ # if files_list == [] # or files_list.nil? # empty -> ALL
193
+ # deb "iterate_through_file_list_for_disks(): no args provided"
194
+ # dirs = RicDisk.find_active_dirs()
195
+ # puts "DEB find_active_dirs: #{green dirs}"
196
+ # dirs.each {|dir|
197
+ # RicDisk.write_config_yaml_to_disk(dir)
198
+ # RicDisk.calculate_stats_files(dir) # dir is inutile
199
+ # } # TODO refactor in option sbrodola_afterwards=true. :)
200
+ # else
201
+ puts "iterate_through_file_list_for_disks(): I consider files_list as a list of directories to parse :)" if verbose
202
+
203
+ # dirs = RicDisk.find_active_dirs()
204
+ files_list.each do |dir|
205
+ dir = File.expand_path(dir)
206
+ if File.directory?(dir)
207
+ # if dirs.include?(dir)
208
+ puts "iterate_through_file_list_for_disks() Legit dir: #{green dir}" if verbose
209
+ rd = RicDisk.new(Storazzo::Media::AbstractRicDisk.DirFactory(dir))
210
+ pverbose true, "RicDisk from Factory (woohoo): #{rd}"
211
+ rd.write_config_yaml_to_disk(dir)
212
+ # RicDisk.write_config_yaml_to_disk(dir)
213
+ # RicDisk.calculate_stats_files (CLASS) => will become OBJECT compute_stats_files
214
+ rd.compute_stats_files() # dir is inutile # TODO
215
+ else
216
+ raise("Doesnt seem a dir to me, quitting: #{dir}")
161
217
  end
162
-
163
- # UGLY CODE, copipasted from binary for ARGV, ex autosbrodola
164
- def iterate_through_file_list_for_disks(files_list=[], opts={})
165
- verbose = opts.fetch :verbose, true
166
- # I decided i wont accept an emopty list, this is not how you use the gem, you lazy XXX!
167
- # if files_list == [] # or files_list.nil? # empty -> ALL
168
- # deb "iterate_through_file_list_for_disks(): no args provided"
169
- # dirs = RicDisk.find_active_dirs()
170
- # puts "DEB find_active_dirs: #{green dirs}"
171
- # dirs.each {|dir|
172
- # RicDisk.write_config_yaml_to_disk(dir)
173
- # RicDisk.calculate_stats_files(dir) # dir is inutile
174
- # } # TODO refactor in option sbrodola_afterwards=true. :)
175
- # else
176
- raise "Wrong input, I need an array here: #{files_list} " unless files_list.is_a?(Array)
177
- puts "iterate_through_file_list_for_disks(): I consider files_list as a list of directories to parse :)" if verbose
178
-
179
- #dirs = RicDisk.find_active_dirs()
180
- files_list.each do |dir|
181
- dir = File.expand_path(dir)
182
- if File.directory?(dir)
183
- #if dirs.include?(dir)
184
- puts "iterate_through_file_list_for_disks() Legit dir: #{green dir}" if verbose
185
- rd = RicDisk.new(dir)
186
- puts "RicDisk: #{rd}"
187
- rd.write_config_yaml_to_disk(dir)
188
- #RicDisk.write_config_yaml_to_disk(dir)
189
- #RicDisk.calculate_stats_files (CLASS) => will become OBJECT compute_stats_files
190
- rd.compute_stats_files() # dir is inutile # TODO
191
- else
192
- raise("Doesnt seem a dir to me, quitting: #{dir}")
193
- end
194
- end
195
- #end
196
- end #/iterate_through_file_list_for_disks
197
-
198
- def config_hash
199
- config['Config']
200
- end
201
-
202
-
203
- def self.get_config
204
- self.instance.load unless self.instance.load_called
205
- self.instance.get_config
206
- end
207
- end # class Storazzo::RicDiskConfig
208
-
218
+ end
219
+ # end
220
+ end # /iterate_through_file_list_for_disks
221
+
222
+ def config_hash
223
+ config['Config']
224
+ end
225
+
226
+ def self.safe_instance()
227
+ puts "This is a safe instance :)"
228
+ my_config = self.instance()
229
+ my_config.load
230
+ my_config
231
+ end
232
+
233
+ def self.get_config
234
+ self.instance.load unless self.instance.load_called
235
+ self.instance.get_config
236
+ end
237
+
238
+ # # gem 'after_do'
239
+ # require 'after_do'
240
+ # Storazzo::RicDiskConfig.extend AfterDo
241
+ # Storazzo::RicDiskConfig.after :instance do # |activity| #:pause, :finish, :resurrect, :do_today, :do_another_day
242
+ # puts yellow("after INSTANCE() has been called I call LOAD!!!")
243
+ # self.load
244
+ # #persistor.save activity
245
+ # end
246
+ end # class Storazzo::RicDiskConfig
209
247
  end # module Storazzo
210
-
@@ -13,23 +13,19 @@ require_relative "./ric_disk_config"
13
13
  =end
14
14
 
15
15
  module Storazzo
16
+ class Storazzo::RicDiskSampleConfig < Storazzo::RicDiskConfig
17
+ # include Storazzo::Common
16
18
 
17
- class Storazzo::RicDiskSampleConfig < Storazzo::RicDiskConfig
18
- #include Storazzo::Common
19
+ public
19
20
 
20
- #include Singleton
21
-
22
- public
23
- def load # _sample_version
24
- deb("[RicDiskSampleConfig] Wheew 1! We're NOT destroying the world here. We're actually instancing a second Singleton which is a child of the mother, and this time doing things nicely and Rubily.")
25
- # super.load DefaultGemLocationForTests #super.load(DefaultGemLocationForTests, :verbose => true )
26
- super(DefaultGemLocationForTests, :verbose => false )
27
- end
28
- def load_sample_version
29
- puts white("[RicDiskSampleConfig] Wheew 2! We're NOT destroying the world here. We're actually instancing a second Singleton which is a child of the mother, and this time doing things nicely and Rubily.")
30
- super(DefaultGemLocationForTests, :verbose => false )
31
- end
32
- end
21
+ def load # _sample_version
22
+ deb("[RicDiskSampleConfig] Wheew 1! We're NOT destroying the world here. We're actually instancing a second Singleton which is a child of the mother, and this time doing things nicely and Rubily.")
23
+ super(DefaultGemLocationForTests, :verbose => false)
24
+ end
33
25
 
26
+ def load_sample_version
27
+ deb white("[RicDiskSampleConfig] Wheew 2! We're NOT destroying the world here. We're actually instancing a second Singleton which is a child of the mother, and this time doing things nicely and Rubily.")
28
+ super(DefaultGemLocationForTests, :verbose => false)
29
+ end
30
+ end
34
31
  end # module Storazzo
35
-
@@ -1,23 +1,24 @@
1
1
  # This class wraps the RDS file: we're going to write this RDS file
2
2
  # directly in the disk: /mount/
3
3
  module Storazzo
4
- class Storazzo::RicDiskStatsFile
5
- # Please keep these two in sync, until you fix them and DRY the behaviour.
6
- #@@default_name
7
- DefaultName = "ricdisk_stats_v11.rds" # => RicDiskStatsFile
8
- Version = "1.1" # @@version
4
+ class Storazzo::RicDiskStatsFile
5
+ # Please keep these two in sync, until you fix them and DRY the behaviour.
6
+ DefaultName = "ricdisk_stats_v11.rds" # => RicDiskStatsFile
7
+ Version = "1.1" # @@version
9
8
 
10
- # AttrAccessor for class - thanks StackOverflow from Android since Im in roaming :)
11
- class << self
12
- attr_accessor :default_name, :version
13
- end
9
+ # AttrAccessor for class - thanks StackOverflow from Android since Im in roaming :)
10
+ class << self
11
+ attr_accessor :default_name, :version
12
+ end
14
13
 
15
14
  public
16
- def self.default_name
17
- DefaultName
18
- end
19
- def self.version
20
- Version
21
- end
15
+
16
+ def self.default_name
17
+ DefaultName
18
+ end
19
+
20
+ def self.version
21
+ Version
22
22
  end
23
- end
23
+ end
24
+ end