aro 0.2.6 → 0.2.7

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 (59) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +5 -2
  3. data/README.md +10 -54
  4. data/aro.gemspec +2 -1
  5. data/bin/oss_om +2 -0
  6. data/checksums/aro-0.2.7.gem.sha512 +1 -0
  7. data/listen.rb +1 -1
  8. data/locale/en.cor.yml +21 -32
  9. data/locale/en.yml +8 -60
  10. data/sys/aro/action.rb +153 -0
  11. data/sys/aro/d.rb +3 -1
  12. data/sys/aro/db/migrate/1793913747_create_data_bases.rb +2 -0
  13. data/sys/aro/db/migrate/1793913777_create_data_base_directories.rb +2 -0
  14. data/sys/aro/db/migrate/1793913796_create_data_base_files.rb +2 -0
  15. data/sys/aro/db/migrate/1793913841_create_menus.rb +2 -0
  16. data/sys/aro/db/migrate/1793913861_create_menu_items.rb +3 -2
  17. data/sys/aro/db.rb +19 -33
  18. data/sys/aro/designer.rb +166 -97
  19. data/sys/aro/locale.rb +4 -2
  20. data/sys/aro/mancy.rb +6 -39
  21. data/sys/aro/models/concerns/tar_go_for_root_sec.rb +37 -0
  22. data/sys/aro/models/concerns/uuid.rb +2 -0
  23. data/sys/aro/models/data_base.rb +33 -8
  24. data/sys/aro/models/directory.rb +2 -0
  25. data/sys/aro/models/file.rb +3 -1
  26. data/sys/aro/models/menu.rb +64 -0
  27. data/sys/aro/models/menu_item.rb +70 -4
  28. data/sys/aro/oss_open_menu.rb +331 -0
  29. data/sys/aro/p.rb +15 -9
  30. data/sys/aro/r.rb +2 -0
  31. data/sys/aro/{cor.rb → settings/cor.rb} +91 -215
  32. data/sys/aro/settings/git.rb +69 -0
  33. data/sys/aro/settings/ssh.rb +123 -0
  34. data/sys/aro/store.rb +87 -36
  35. data/sys/aro/v.rb +2 -0
  36. data/sys/aro.rb +2 -0
  37. data/sys/ma_ain.rb +202 -0
  38. data/sys/reiquire.rb +41 -54
  39. data/sys/shr/prompt.rb +6 -1
  40. data/sys/shr/version.rb +7 -8
  41. metadata +31 -23
  42. data/locale/en.cards.yml +0 -519
  43. data/locale/en.cmd.yml +0 -34
  44. data/locale/en.usage.yml +0 -142
  45. data/sys/aro/cmd.rb +0 -96
  46. data/sys/aro/db/migrate/1763374647_create_tecks.rb +0 -20
  47. data/sys/aro/db/migrate/1763432541_create_tlogs.rb +0 -20
  48. data/sys/aro/ma_ain.rb +0 -54
  49. data/sys/aro/models/teck.rb +0 -251
  50. data/sys/aro/models/tlog.rb +0 -21
  51. data/sys/aro/views/base.rb +0 -25
  52. data/sys/aro/views/teck.rb +0 -30
  53. data/sys/cli/constants.rb +0 -45
  54. data/sys/cli/create.rb +0 -23
  55. data/sys/cli/nterface.rb +0 -37
  56. data/sys/cli/teck.rb +0 -107
  57. data/sys/cli/usage.rb +0 -25
  58. data/sys/cli.rb +0 -23
  59. data/sys/shr/t.rb +0 -74
data/sys/cli/constants.rb DELETED
@@ -1,45 +0,0 @@
1
- =begin
2
-
3
- constants.rb
4
-
5
- define constants for the aro cli.
6
-
7
- by i2097i
8
-
9
- =end
10
-
11
- module CLI
12
-
13
- FLAGS = {
14
- HELP: [:"-h", :"--help"],
15
- SHOW_COUNT: [:"-n", :"--count"],
16
- SHOW_ORDER: [:"-o", :"--order"],
17
- VERSION: [:"-v", :"--version"],
18
- }
19
-
20
- EXIT_CODES = {
21
- SUCCESS: Aro::Mancy::O,
22
- GENERAL_ERROR: Aro::Mancy::S,
23
- INVALID_ARG: Aro::Mancy::E,
24
- }
25
-
26
- CMDS = {
27
- ARO: {
28
- CONSOLE: :console,
29
- CREATE: :create,
30
- COR: :cor,
31
- TECK: :teck,
32
- INIT: :init,
33
- },
34
- TECK: {
35
- DRAW: :draw,
36
- EXPLORE: :explore,
37
- NEW: :new,
38
- REPLACE: :replace,
39
- RESET: :reset,
40
- SHOW: :show,
41
- SHUFFLE: :shuffle,
42
- },
43
- }
44
-
45
- end
data/sys/cli/create.rb DELETED
@@ -1,23 +0,0 @@
1
- =begin
2
-
3
- create.rb
4
-
5
- create aro space.
6
-
7
- by i2097i
8
-
9
- =end
10
-
11
- module CLI
12
- def self.create
13
- CLI::Nterface.exit_error_missing_args!(:var_aro_name) if CLI::ARGV1.nil?
14
-
15
- name = CLI::ARGV1&.to_s
16
- Aro::P.say(I18n.t("messages.creation_attempt", name: name))
17
- if Aro::Mancy.create(name)
18
- Aro::P.say(I18n.t("messages.creation_success", name: name))
19
- else
20
- Aro::P.say(I18n.t("messages.creation_failure", name: name))
21
- end
22
- end
23
- end
data/sys/cli/nterface.rb DELETED
@@ -1,37 +0,0 @@
1
- =begin
2
-
3
- nterface.rb
4
-
5
- cli nterface.
6
-
7
- by i2097i
8
-
9
- =end
10
-
11
- module CLI
12
- class Nterface
13
- def self.exit_error_not_found!(arg)
14
- Aro::P.say(I18n.t("errors.header", cmd: Aro::Mancy))
15
- Aro::P.say(I18n.t("errors.not_found", cmd: arg))
16
- exit(CLI::EXIT_CODES[:INVALID_ARG])
17
- end
18
-
19
- def self.exit_error_missing_args!(arg)
20
- Aro::P.say(I18n.t("errors.header", cmd: Aro::Mancy))
21
- Aro::P.say(I18n.t("errors.missing_args", cmd: arg))
22
- exit(CLI::EXIT_CODES[:INVALID_ARG])
23
- end
24
-
25
- def self.exit_error_invalid_usage!
26
- Aro::P.say(I18n.t("errors.header", cmd: Aro::Mancy))
27
- Aro::P.say(I18n.t("errors.invalid_usage", cmd: Aro::Mancy))
28
- exit(CLI::EXIT_CODES[:GENERAL_ERROR])
29
- end
30
-
31
- def self.exit_error_not_initialized!
32
- Aro::P.say(I18n.t("errors.header", cmd: Aro::Mancy))
33
- Aro::P.say(I18n.t("errors.not_initialized", cmd: Aro::Mancy))
34
- exit(CLI::EXIT_CODES[:GENERAL_ERROR])
35
- end
36
- end
37
- end
data/sys/cli/teck.rb DELETED
@@ -1,107 +0,0 @@
1
- =begin
2
-
3
- teck.rb
4
-
5
- process teck commands.
6
-
7
- by i2097i
8
-
9
- =end
10
-
11
- module CLI
12
- def self.teck
13
- Aro::Mancy.init(Aro::Mancy.root_dir)
14
- action = CLI::ARGV1&.to_sym
15
- if CLI::FLAGS[:HELP].include?(action)
16
- CLI.usage_teck
17
- exit(CLI::EXIT_CODES[:SUCCESS])
18
- elsif action.nil?
19
- # no args, open teck menu
20
- if Aro::Mancy.in_aro?
21
- Aro::Teck.display_selection_menu
22
- else
23
- Aro::P.say(I18n.t("errors.not_in_aro" , cmd: Aro::Mancy::I2097I))
24
- end
25
- elsif action == CLI::CMDS[:TECK][:NEW]
26
- CLI::Nterface.exit_error_missing_args!(:var_teck_name) if CLI::ARGV2.nil?
27
- if Aro::Mancy.in_aro?
28
- teck = Aro::Teck.make(CLI::ARGV2.to_s)
29
- Aro::P.say(I18n.t("messages.teck_created_sucessfully", name: teck.name))
30
- Aro::Teck.display_selection_menu
31
- else
32
- Aro::P.say(I18n.t("errors.not_in_aro" , cmd: Aro::Mancy::I2097I))
33
- end
34
- elsif CLI::CMDS[:TECK].values.include?(action)
35
- if Aro::Mancy.teck.nil?
36
- Aro::P.say(I18n.t("errors.missing_teck", cmd: Aro::Mancy::I2097I))
37
- exit(CLI::EXIT_CODES[:GENERAL_ERROR])
38
- end
39
-
40
- case action
41
- when CLI::CMDS[:TECK][:EXPLORE]
42
- Aro::Mancy.teck.explore
43
- exit(CLI::EXIT_CODES[:SUCCESS])
44
- when CLI::CMDS[:TECK][:SHUFFLE]
45
- Aro::P.say(I18n.t("messages.shuffling", name: Aro::Mancy.teck.name))
46
- Aro::Mancy.teck.shuffle
47
- when CLI::CMDS[:TECK][:DRAW]
48
- Aro::Cor.instance.load_env
49
- Aro::P.say(I18n.t("messages.drawing", name: Aro::Mancy.teck.name))
50
- Aro::P.say(I18n.t("messages.drawing_from_dimension", dimension: "#{Aro::Cor.ivar(:DIMENSION)}"))
51
- Aro::Mancy.teck.draw(
52
- z_max: Aro::Cor.ivar(:Z_MAX).to_i,
53
- z: Aro::Cor.ivar(:Z)
54
- )
55
- when CLI::CMDS[:TECK][:REPLACE]
56
- Aro::P.say(I18n.t("messages.replacing_drawn", name: Aro::Mancy.teck.name))
57
- Aro::Mancy.teck.replace
58
- when CLI::CMDS[:TECK][:RESET]
59
- Aro::P.say("#{I18n.t("messages.confirmation_prompt", name: Aro::Mancy.teck.name)}")
60
- if Aro::Mancy::YES.to_s != Aro::P.p.ask("\n#{Aro::Mancy.ps1_display}$")
61
- Aro::P.say(I18n.t("messages.understood", name: Aro::Mancy.teck.name))
62
- exit(CLI::EXIT_CODES[:SUCCESS])
63
- end
64
-
65
- Aro::P.say(I18n.t("messages.resetting", name: Aro::Mancy.teck.name))
66
- Aro::Mancy.teck.reset
67
- end
68
- Aro::Mancy.teck.show(**CLI::shoptions)
69
- else
70
- Aro::Teck.select_teck(
71
- Aro::Teck.find_by(name: action)
72
- )
73
- end
74
- end
75
-
76
- # parse show options
77
- # todo: better naming
78
- def self.shoptions
79
- show_options_count = Aro::Mancy::S
80
- show_options_order = Aro::Tlog::ORDERING[:DESC]
81
-
82
- # Aro::D.say("ARGV.map{|a| a.to_sym} => #{ARGV.map{|a| a.to_sym}}")
83
-
84
- count_option_flags = ARGV.map{|a| a.to_sym} & CLI::FLAGS[:SHOW_COUNT]
85
- # Aro::D.say("count_option_flags: #{count_option_flags}")
86
- if count_option_flags.any?
87
- # get the ARGV index element after flag index
88
- show_options_count = ARGV[ARGV.index(count_option_flags.first.to_s) + 1]
89
- show_options_count = show_options_count.to_i unless [0, nil].include?(show_options_count&.to_i)
90
- # Aro::D.say("show_options_count: #{show_options_count}")
91
- end
92
-
93
- order_option_flags = ARGV.map{|a| a.to_sym} & CLI::FLAGS[:SHOW_ORDER]
94
- # Aro::D.say("count_option_flags: #{order_option_flags}")
95
- if order_option_flags.any?
96
- # get the ARGV index element after flag index
97
- show_options_order = ARGV[ARGV.index(order_option_flags.first.to_s) + 1].to_sym
98
- # Aro::D.say("show_options_order: #{show_options_order}")
99
- end
100
-
101
- {
102
- count_n: show_options_count,
103
- order_o: show_options_order
104
- }
105
- end
106
-
107
- end
data/sys/cli/usage.rb DELETED
@@ -1,25 +0,0 @@
1
- =begin
2
-
3
- usage.rb
4
-
5
- display aro usage.
6
-
7
- by i2097i
8
-
9
- =end
10
-
11
- module CLI
12
-
13
- def self.usage_main
14
- Aro::P.less(I18n.t("usage.main"))
15
- end
16
-
17
- def self.usage_cor
18
- Aro::P.less(I18n.t("usage.cor"))
19
- end
20
-
21
- def self.usage_teck
22
- Aro::P.less(I18n.t("usage.teck"))
23
- end
24
-
25
- end
data/sys/cli.rb DELETED
@@ -1,23 +0,0 @@
1
- =begin
2
-
3
- cli
4
-
5
- aro cli module.
6
-
7
- by i2097i
8
-
9
- =end
10
-
11
- module CLI
12
- if CLI::CMDS[:TECK].values.filter{|k| ![:new].include?(k)}.include?(ARGV[0]&.to_sym)
13
- # enable teck shortcut (skip typing teck while in-game)
14
- ARGV0 = :teck
15
- ARGV1 = ARGV[0]&.to_sym
16
- ARGV2 = ARGV[1]&.to_sym
17
- else
18
- # default
19
- ARGV0 = ARGV[0]&.to_sym
20
- ARGV1 = ARGV[1]&.to_sym
21
- ARGV2 = ARGV[2]&.to_sym
22
- end
23
- end
data/sys/shr/t.rb DELETED
@@ -1,74 +0,0 @@
1
- =begin
2
-
3
- t.rb
4
-
5
- tarot.
6
-
7
- by i2097i
8
-
9
- =end
10
-
11
- module Aro
12
- module T
13
- DEV_TAROT_FILE = :"/dev/tarot"
14
- DEV_TAROT = :"Dev::Tarot".to_s
15
- RUBY_FACOT = :"Ruby::Facot".to_s
16
-
17
- def self.is_dev_tarot?
18
- user_setting_true = Aro::Cor.ivar(:DIMENSION)&.to_sym == Aro::Cor::DMS[:DEV_TAROT]
19
- Aro::T.is_dev_tarot_avail? && (user_setting_true || Aro::Cor.ivar(:DIMENSION).nil?)
20
- end
21
-
22
- def self.is_dev_tarot_avail?
23
- File.exist?(Aro::T::DEV_TAROT_FILE.to_s)
24
- end
25
-
26
- # read dev_tarot
27
- def self.read_dev_tarot(include_o = true)
28
- dt = nil
29
- if Aro::T.is_dev_tarot?
30
- # VERY IMPORTANT!
31
- File.open(Aro::T::DEV_TAROT_FILE.to_s, "r"){|dtf| dt = dtf.read(Aro::Mancy::N).strip}
32
- # VERY IMPORTANT!
33
- Aro::V.say(I18n.t("very_important", dev_tarot: dt))
34
- else
35
- Aro::D.say("error: #{Aro::T::DEV_TAROT_FILE.to_s} not installed.")
36
- end
37
-
38
- if dt.nil?
39
- # fallback on ruby_facot
40
- Aro::V.say("warning: summoning ruby_facot in #{__method__}")
41
- dt = Aro::T.summon_ruby_facot
42
- end
43
-
44
- return dt[(include_o ? Aro::Mancy::O : Aro::Mancy::S)..]
45
- end
46
-
47
- # summon ruby_facot
48
- def self.summon_ruby_facot(include_o = true)
49
- Aro::D.say(I18n.t("messages.ruby_facot_random"))
50
- ruby_facot = I18n.t("cards.index").map{|c| "+#{c}"}.sample.split("")
51
-
52
- # get orientation
53
- rf = ["+","-"].sample
54
-
55
- # get suit
56
- rf += ruby_facot[1]
57
-
58
- # calculate the sym
59
- symm = ruby_facot.select{|c|
60
- # loops through the characters in ruby_facot
61
- # return all characters not matching:
62
- # => character[0]: orientation
63
- # => character[1]: suit
64
-
65
- # the first two characters in the dev_tarot format designate the rf os
66
- !ruby_facot.first(Aro::Mancy::OS).include?(c)
67
- }.join("").to_sym
68
- rf += Aro::Mancy::NUMERALS[symm].to_s
69
-
70
- # return rf
71
- return rf[(include_o ? Aro::Mancy::O : Aro::Mancy::S)..]
72
- end
73
- end
74
- end