Class: Storazzo::Main

Inherits:
Object
  • Object
show all
Extended by:
Colors
Defined in:
lib/storazzo/main.rb

Overview

This is the Main Class - an entrypoint to call the meravilles hidden therein.

Example:

>> Storazzo.hi("ciao bello")
=> Hello from Storazzo v0.1.1!

Arguments:

message: (String) - optional

Constant Summary

Constants included from Colors

Colors::PREPEND_ME

Class Method Summary collapse

Methods included from Colors

azure, blue, deb2, gray, green, orange, pgreen, pred, purple, pwhite, pyellow, red, white, yellow

Class Method Details

.all_mounts(opts = {}) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/storazzo/main.rb', line 40

def self.all_mounts(opts = {})
  opts_verbose = opts.fetch :verbose, true

  say_hi "Storazzo::Main.all_mounts(): BEGIN - RicDiskVersion is: #{Storazzo::RicDiskUgly::RICDISK_VERSION}"

  pwhite('1. First I load the config in verbose mode..')
  config = Storazzo::RicDiskConfig.instance
  config.load
  #        puts config.object_id
  #        puts Storazzo::RicDiskConfig.instance.object_id
  pwhite 'TODO(ricc): show a list of all RicDisk relevant mounts' if opts_verbose
  # d = Storazzo::RicDisk.new
  config.iterate_through_file_list_for_disks # analyze_local_system
  # sbrodola_ricdisk("/Volumes/")
  Storazzo::RicDisk.test
  Storazzo::RicDisk.find_active_dirs
  # Storazzo::RicDisk.sbrodola_ricdisk StorazzoMod::root + "./var/disks/"
  # sbrodola_ricdisk(StorazzoMod::root + "./var/disks/") rescue "[Storazzo::AllMount] SomeError: #{$!}"
  hi 'Storazzo::Main.all_mounts(): END'
end

.all_testsObject



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/storazzo/main.rb', line 61

def self.all_tests
  # include vs extend: https://stackoverflow.com/questions/15097929/ruby-module-require-and-include
  # => http://www.railstips.org/blog/archives/2009/05/15/include-vs-extend-in-ruby/
  # include Storazzo::Colors
  extend Storazzo::Colors

  pwhite 'All tests BEGIN - todo obsolete this now that I have proper Rake testing suite...'
  deb 'Maybe debug is enabled?'
  say_hi
  # This works with EXTEND..
  puts(yellow('Just YELLOW 0'))
  # This reqwuires a INCLUDE.
  # puts(Storazzo::Colors.yellow "Test YELLOW 1 self")
  # puts(Colors.yellow "Test YELLOW 1 self")
  # puts(Colors.green "Test YELLOW 2 ohne self")
  pwhite 'All tests END'
  # puts "All tests END"
end

.get_hi(message = nil) ⇒ Object

salutation



30
31
32
33
34
35
36
37
38
# File 'lib/storazzo/main.rb', line 30

def self.get_hi(message = nil)
  str = "Hello from Storazzo v#{begin
    white Storazzo.version
  rescue StandardError
    "Error: #{$ERROR_INFO}"
  end}!"
  str += " Message: '#{yellow message.to_s}'" if message
  str
end

.say_hi(message = nil) ⇒ Object

version 1.2



23
24
25
26
27
# File 'lib/storazzo/main.rb', line 23

def self.say_hi(message = nil)
  str = get_hi(message)
  puts str
  str
end