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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 279f80459edf35682f8291e75dc65c1f92728f90febccc332b742a9b825b239b
4
- data.tar.gz: 4aa8aac39b11468c25e34f232846689e80af84dfa5924c3dad887d499c851e2e
3
+ metadata.gz: 49c45a57df78cbe2dd5a637afc2fc665e30f078f7168f20c0d082e51b57f524d
4
+ data.tar.gz: ec6c532357abe58d831550ded9341bf1878054555e4d8f9f3530218bab82ccd0
5
5
  SHA512:
6
- metadata.gz: 8c680184cff7f46e5627a10cc846a4723d3cfd3a80fb2f4206df0ea16e47aa5f1ee2dab9e5732c0ffc12ed42a3fce0392749068a8b0a332ea6a2c435340885c7
7
- data.tar.gz: 61354e41b939cf8d67f62c869306441e250aed60fe4872198f72eb7e4eefa1dd95ee4f6605503f47190ca4322f1ed573e30e8b9023139640adf8fded083b3802
6
+ metadata.gz: 694efc455ed4636bb9dd7dd37c60ec5b31f03b5fb272a71acebc805789e4c4368484802de729d5d9c584e48b54db7200554c65f58c56ee948ab2c5e7c21c19bd
7
+ data.tar.gz: a28f71863d7770caabf7938448635fd52f50e7f4a8724a7a05d41ec733d99a0e152e377261f66a74e815d887bd6fe53f7e72b8604d2930ce89681c6ac670b65a
data/Gemfile.lock CHANGED
@@ -1,10 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aro (0.2.6)
4
+ aro (0.2.7)
5
5
  activerecord (~> 8.1, >= 8.1.4.1)
6
6
  i18n (~> 1.15, >= 1.15.2)
7
7
  sqlite3 (~> 2.10, >= 2.10.2)
8
+ tty-font (~> 0.5, >= 0.5.0)
8
9
  tty-prompt (~> 0.23, >= 0.23.1)
9
10
 
10
11
  GEM
@@ -98,6 +99,7 @@ GEM
98
99
  timeout (0.6.1)
99
100
  tty-color (0.6.0)
100
101
  tty-cursor (0.7.1)
102
+ tty-font (0.5.0)
101
103
  tty-prompt (0.23.1)
102
104
  pastel (~> 0.8)
103
105
  tty-reader (~> 0.8)
@@ -134,7 +136,7 @@ CHECKSUMS
134
136
  activemodel (8.1.4.1) sha256=063caf105372fbc98b2d789e4be23de63ac5c043f7d9330f04e2caddb7012805
135
137
  activerecord (8.1.4.1) sha256=bd65599ca0b5d210937f835d42c7aff69d271741c75aab022730be6cbce67e87
136
138
  activesupport (8.1.4.1) sha256=16ac4f341ca65c85a1fcdb8ac73f68891aae9e3c4a6f9c3a27daed8b00017ed7
137
- aro (0.2.6)
139
+ aro (0.2.7)
138
140
  base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
139
141
  bigdecimal (4.1.3) sha256=61ebe1e5e559bdc3cc6f2c0ee7f427321fc838f59611c294356eb04d6e21cf66
140
142
  bundler (4.0.24) sha256=16ca64e20816a0cf151a948fb141d788602996d2b4d73577b74388fe84fa98bc
@@ -189,6 +191,7 @@ CHECKSUMS
189
191
  timeout (0.6.1) sha256=78f57368a7e7bbadec56971f78a3f5ecbcfb59b7fcbb0a3ed6ddc08a5094accb
190
192
  tty-color (0.6.0) sha256=6f9c37ca3a4e2367fb2e6d09722762647d6f455c111f05b59f35730eeb24332a
191
193
  tty-cursor (0.7.1) sha256=79534185e6a777888d88628b14b6a1fdf5154a603f285f80b1753e1908e0bf48
194
+ tty-font (0.5.0) sha256=495ee588701be4abaf03da8b14382794003cb2d836127b02c78cda18aaf451e2
192
195
  tty-prompt (0.23.1) sha256=fcdbce905238993f27eecfdf67597a636bc839d92192f6a0eef22b8166449ec8
193
196
  tty-reader (0.9.0) sha256=c62972c985c0b1566f0e56743b6a7882f979d3dc32ff491ed490a076f899c2b1
194
197
  tty-screen (0.8.2) sha256=c090652115beae764336c28802d633f204fb84da93c6a968aa5d8e319e819b50
data/README.md CHANGED
@@ -1,70 +1,26 @@
1
- # aro
2
- >__a cli for tarot__ - follow the way of the aro eht.
1
+ ## aro
2
+ ### oss_om*
3
+
4
+ > __a oss_om unix utility__
3
5
 
4
6
  ##### __current version:__
5
7
  [![Gem Version](https://badge.fury.io/rb/aro.svg)](https://badge.fury.io/rb/aro)
6
8
 
7
- aro is a command line interface that allows you to manage multiple tarot tecks.
8
-
9
+ aro is a unix utility for designing and creating linux applications.
9
10
 
10
- ### install
11
+ ### installation
11
12
 
12
13
  ```bash
13
14
  $ gem install aro
14
15
  ```
15
16
 
16
- ### use
17
-
18
- ```bash
19
- $ aro -h
20
- ```
21
-
22
- [usage documentation](https://raw.githubusercontent.com/i2097i/aro/refs/heads/master/locale/en.usage.yml)
23
-
24
-
25
- [card definitions](https://raw.githubusercontent.com/i2097i/aro/refs/heads/master/locale/en.cards.yml)
26
-
27
-
28
- ### develop
29
-
30
- [rubygems.org guides](https://guides.rubygems.org)
31
-
32
- ```ruby
33
- # the Rakefile contains bundler's gem_tasks,
34
- # which are used for gem development.
35
-
36
- # Rakefile
37
- require "bundler/gem_tasks"
38
- ```
39
-
40
- ```bash
41
- # list tasks
42
- $ rake --tasks
43
-
44
- # build gem
45
- $ rake build
46
-
47
- # build and install
48
- $ rake install
49
- ```
50
-
51
- ### test
17
+ ### usage
52
18
 
53
19
  ```bash
54
- $ rspec
20
+ $ oss_om
55
21
  ```
56
-
57
- #### pre-commit hook:
58
- ```bash
59
- : cat .git/hooks/pre-commit
60
- #!/bin/sh
61
-
62
- echo "running pre-commit hooks"
63
- echo "exec rspec -f d -o ./spec/spec.log"
64
- exec rspec -f d -o ./spec/spec.log
65
- ```
66
-
67
22
  [license](http://opensource.org/licenses/MIT)
23
+
68
24
  [issues](https://github.com/i2097i/aro/issues)
69
25
 
70
- >aro by i2097i is copyright (2026)
26
+ ##### aro (v0.2.7) by scot reichman is copyright (2026)
data/aro.gemspec CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
15
15
  spec.version = Aro::VERSION.to_s
16
16
  spec.authors = ["i2097i"]
17
17
  spec.email = ["i2097i@hotmail.com"]
18
- spec.description = "a cli for tarot."
18
+ spec.description = "aro is a unix utility for designing and creating linux applications."
19
19
  spec.summary = Aro::RELEASE_NOTES.to_s
20
20
  spec.homepage = "https://github.com/i2097i/aro"
21
21
  spec.license = "MIT"
@@ -36,4 +36,5 @@ Gem::Specification.new do |spec|
36
36
  spec.add_runtime_dependency "i18n", "~> 1.15", ">= 1.15.2"
37
37
  spec.add_runtime_dependency "sqlite3", "~> 2.10", ">= 2.10.2"
38
38
  spec.add_runtime_dependency "tty-prompt", "~> 0.23", ">= 0.23.1"
39
+ spec.add_runtime_dependency "tty-font", "~> 0.5", ">= 0.5.0"
39
40
  end
data/bin/oss_om CHANGED
@@ -1,5 +1,7 @@
1
1
  #! /usr/bin/env ruby
2
2
 
3
+ # frozen_string_literal: true
4
+
3
5
  =begin
4
6
 
5
7
  aro
@@ -0,0 +1 @@
1
+ 68d130e78710ebf7ce77cd530fa1e04bcdbd6c8253d8bbec3be68dc86b414e013a27368bb035836d776ee210c900b86157836089033d634d2bc96a2a7bf347f3
data/listen.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require :listen.to_s
2
2
 
3
- listener = Listen.to(*[:sys.to_s, :bin.to_s, :spec.to_s, :locale.to_s], only: /[\.rb\.yml]/) {|modified, added, removed|
3
+ listener = Listen.to(*[:sys.to_s, :bin.to_s, :locale.to_s], only: /[oss_om\.rb\.yml]/) {|modified, added, removed|
4
4
  # puts modified
5
5
  # puts added
6
6
  # puts removed
data/locale/en.cor.yml CHANGED
@@ -1,44 +1,33 @@
1
1
  en:
2
2
  cor:
3
+ env:
4
+ description: "oss_om run environment."
5
+ development_description: "add debugging verbosity to standard oss_om output."
6
+ production_description: "standard oss_om output."
7
+ test_description: "used for rspec."
3
8
  aro_env:
4
- O_description: "read-only env var for holding O."
5
- S_description: "read-only env var for holding S."
6
- OS_description: "read-only env var for holding OS."
7
- E_description: "read-only env var for holding E."
8
- N_description: "read-only env var for holding N"
9
- NAME_FILE_description: "read-only env var for name file."
10
- I2097I_description: "read-only env var for i2097i."
11
- YES_description: "read-only env var for 'aroyes'."
12
- ALL_description: "read-only env var for 'all'."
13
- dimension:
14
- description: "selected dimension of aro space."
15
- dev_tarot_description: "reads from /dev/tarot device if available."
16
- ruby_facot_description: "generated ruby_facot (facade randomness)."
9
+ O_description: "zero."
10
+ S_description: "one."
11
+ OS_description: "two."
12
+ E_description: "three."
13
+ N_description: "four."
14
+ V_description: "five."
15
+ OSS_OM_FILE_description: "generated oss_om project file."
17
16
  oss_om_home:
18
- description: "the directory where .oss_om lives."
19
- any_valid_path_description: "any valid path. if null $HOME is used."
20
- interface:
21
- description: "aro output interface."
22
- terminal_description: "render terminal output (default)."
23
- lanimret_description: "render flie web output."
24
- height_description: "display height. valid range: (%{min}-%{max})"
25
- width_description: "display width. valid range: (%{min}-%{max})"
26
- env:
27
- description: "aro run environment."
28
- development_description: "basic development logs and features."
29
- production_description: "game logging only."
30
- test_description: "logging and features tailored for tests."
31
- verbose_description: "enable verbose logging in development env."
17
+ description: "the directory where .oss_om/ lives."
18
+ path_description: "any valid path file path. defaults to $HOME"
19
+ oss_om_pkey_path:
20
+ description: "path to openssl public key. used to perform oss_om actions."
21
+ path_description: "path to openssl key (usually ~/.ssh/id_key_name.pub)"
22
+ verbose_description: "enable verbose logging in development."
32
23
  log_aro_db_description: "show aro database transactions"
33
24
  generate: "generating default cor file at %{name}."
34
25
  source: "installing ivars from %{name}..."
35
26
  maximum: "max"
36
27
  minimum: "min"
37
28
  possible_values: "possible values"
38
- type:
29
+ types:
39
30
  bool_description: "true or false."
40
31
  int_description: "a primitive decimal-less numeric."
41
- string_description: "a blank-space-terminated string of characters."
42
- values_description: "an enumerated type."
43
- z_description: "sleep time between attempts to read /dev/tarot. valid range (%{min}-%{max})"
44
- z_max_description: "max number of z long sleeps before giving up. valid range (%{min}-%{max})"
32
+ string_description: "string of characters."
33
+ values_description: "an enumerated type."
data/locale/en.yml CHANGED
@@ -1,68 +1,16 @@
1
1
  en:
2
2
  open_menu:
3
- welcome: "welcome to oss_om"
3
+ base_db_password_prompt: "enter database password <%{sql_filepath}> (default %{aro_name}): "
4
+ edit_action_for_menu_item: "edit action '%{action_name}' for menu item '%{localized_name}'"
4
5
  edit_menu_localized_name: "designing open menu '%{localized_name}'"
6
+ edit_menu_item_localized_name: "designing open menu item '%{localized_name}'"
7
+ design_action_for_menu_item: "designing open menu item action for '%{localized_name}'"
5
8
  get_new_value_from_user: "input new value (press enter to cancel): "
9
+ select_exec_oss_om_const: "which oss_om class will run this action?"
10
+ select_exec_oss_om_method: "%{class} method to run?"
11
+ default_user_item_text: "item 1 for %{localized_name} menu"
6
12
  designer:
7
13
  create_menu: "enter display text for the new menu"
8
14
  errors:
9
15
  invalid_i18n_path: "invalid_i18n_path"
10
- constants:
11
- commands: "COMMANDS"
12
- subcommands: "SUBCOMMANDS"
13
- # VERY IMPORTANT!
14
- very_important: "VERY IMPORTANT! %{dev_tarot}"
15
- # VERY IMPORTANT!
16
-
17
- errors:
18
- header: "%{cmd} says there was a problem."
19
- invalid_usage: "%{cmd} says you're not supposed to be here."
20
- missing_args: "%{cmd} says missing required argument(s)."
21
- missing_teck: "%{cmd} says no teck selected. use 'aro teck' to select one or 'aro teck new var_name' to create one."
22
- not_found: "%{cmd} not found."
23
- not_in_aro: "%{cmd} says you are not in aro space. that command will not work here."
24
- not_initialized: "%{cmd} says you need to initialize aro. run 'aro init' to do so"
25
- missing_base_migrations: "missing_base_migrations"
26
- locale_load_error: "locale_load_error: failed to load locale %{named} library"
27
- warnings:
28
- invalid_order: "the order specified for displaying tlogs in invalid. using default (desc)."
29
- messages:
30
- base_db_password_prompt: "enter main password for base sqlite3 database <%{sql_filepath}> (default %{aro_name}): "
31
- choose_card: "choose a card."
32
- choose_teck: "choose a teck."
33
- confirmation_prompt: "input 'aroyes' to reset %{name}, or enter to cancel (cancel): "
34
- creating: "creating %{name}..."
35
- creation_attempt: "attempting to create aro table named %{name}..."
36
- creation_failure: "%{name} creation failed!"
37
- creation_success: |
38
- %{name} created successfully!
39
-
40
- to get started navigate to the %{name} directory:
41
-
42
- $ cd %{name}
43
-
44
- see aro --help for usage.
45
- teck_created_sucessfully: "%{name} teck created successfully"
46
- teck_selected: "%{name} teck selected in the %{room} room."
47
- drawing: "drawing a card from %{name}"
48
- drawing_from_dimension: "in the the %{dimension} dimension..."
49
- ruby_facot_random: |
50
- unable to read from /dev/tarot - using facade randomness instead.
51
- for more information visit:
52
- https://github.com/arowmancy/dev_tarot
53
- history_drawn: "drawn cards"
54
- no_tecks: |
55
- no tecks created yet.
56
-
57
- use the following command to create one:
58
-
59
- $ aro teck new var_name
60
-
61
- see aro --help for usage.
62
- printing_card: "printing %{card}..."
63
- showing: "showing %{name} [count:%{count}, order:%{order}]..."
64
- shuffling: "shuffling %{name}'s cards..."
65
- replacing_drawn: "replacing all drawn cards to %{name}..."
66
- resetting: "resetting %{name}'s cards..."
67
- understood: "%{name} says: 'understood.'"
68
- welcome: "summoned %{name}"
16
+ locale_load_error: "locale_load_error: failed to load locale %{named} library"
data/sys/aro/action.rb ADDED
@@ -0,0 +1,153 @@
1
+ # frozen_string_literal: true
2
+
3
+ =begin
4
+
5
+ action.rb
6
+
7
+ aro dom action
8
+
9
+ by i2097i
10
+
11
+ =end
12
+
13
+ module Aro
14
+ module Dom
15
+ class Action
16
+
17
+ TYPES = {
18
+ OSS_OM: {
19
+ key: :exec_oss_om,
20
+ params: {
21
+ aro_class_name: {
22
+ default_value: Aro::Dom::Action.name,
23
+ required: true
24
+ },
25
+ aro_class_method: {
26
+ default_value: :inspect,
27
+ required: false
28
+ },
29
+ oss_om_ssh_key: {
30
+ default_value: nil,
31
+ required: true,
32
+ unique: true
33
+ }
34
+ }
35
+ },
36
+ SYSTEM: {
37
+ key: :exec_system,
38
+ params: {
39
+ command_string: {
40
+ default_value: nil,
41
+ required: true
42
+ },
43
+ oss_om_ssh_key: {
44
+ default_value: nil,
45
+ required: true,
46
+ unique: true
47
+ }
48
+ }
49
+ },
50
+ CREATE_DATA_BASE: {
51
+ key: :exec_data_base,
52
+ params: {
53
+ data_base_name: {
54
+ default_value: nil,
55
+ required: true,
56
+ unique: true
57
+ },
58
+ oss_om_ssh_key: {
59
+ default_value: nil,
60
+ required: true,
61
+ unique: true
62
+ }
63
+ },
64
+ }
65
+ }
66
+
67
+ def self.valid_param_values!(action_key, params)
68
+ params.keys.each{|k|
69
+ v = params[k]
70
+ params_action_def = Aro::Dom::Action::TYPES[action_key][:params][k.to_sym]
71
+ v = params_action_def[:default_value] if v.nil?
72
+ required = false
73
+ required = params_action_def[:required] unless params_action_def[:required].nil?
74
+
75
+ raise "required value missing! params[#{k}] = '#{v}'" if required && (v.nil? || v.empty?)
76
+ }
77
+ end
78
+
79
+ def self.valid_param_keys!(action_key, params)
80
+ (
81
+ Aro::Dom::Action::TYPES[action_key][:params].keys & # assert one ampersand(&) here!
82
+ params.keys.map{|k|
83
+ k.to_s&.strip.to_sym
84
+ }
85
+ ).count == params.keys.count
86
+ end
87
+
88
+ def self.validate_params!(action_key, params)
89
+ Aro::P.say("validating #{action_key} action")
90
+ Aro::V.say("params: #{JSON.pretty_generate(params)}")
91
+
92
+ raise "invalid params! (#{params})" unless params.kind_of?(Hash) &&
93
+ valid_param_keys!(action_key, params) && valid_param_values!(action_key, params)
94
+ end
95
+
96
+ def self.validate_action_key!(action_key)
97
+ action_key = action_key&.upcase.to_sym
98
+ raise "invalid action! (#{action_key})" unless Aro::Dom::Action::TYPES.keys.include?(action_key)
99
+ return action_key
100
+ end
101
+
102
+ def self.create(action_key, menu_item)
103
+ Aro::P.say(__method__)
104
+ action_key = validate_action_key!(action_key)
105
+
106
+ aro_action_type_def = Aro::Dom::Action::TYPES[action_key]
107
+ case aro_action_type_def[:key]
108
+ when :exec_oss_om
109
+ Aro::Dom::Oss_OpenMenu.create_exec_oss_om_entry_for(menu_item)
110
+ when :exec_system
111
+ Aro::Dom::Oss_OpenMenu.create_exec_system_entry_for(menu_item)
112
+ when :exec_data_base
113
+ Aro::Dom::Oss_OpenMenu.create_exec_data_base_entry_for(menu_item)
114
+ end
115
+ end
116
+
117
+ def self.perform(action_key, params = {})
118
+ Aro::P.say(__method__)
119
+ action_key = validate_action_key!(action_key)
120
+ validate_params!(action_key, params)
121
+
122
+ params = params.symbolize_keys
123
+ aro_action_type_def = Aro::Dom::Action::TYPES[action_key]
124
+ case aro_action_type_def[:key]
125
+ when :exec_oss_om
126
+ Aro::P.say("#{params[:aro_class_name]}.#{params[:aro_class_method]}")
127
+ begin
128
+ params[:aro_class_name].constantize.send(params[:aro_class_method])
129
+ rescue NoMethodError => e
130
+ Aro::P.say("exec_oss_om error! #{e}")
131
+ end
132
+ when :exec_system
133
+ Aro::P.say("todo: implement!")
134
+ Aro::P.say("when :exec_system")
135
+ Aro::Dom::Ma_ain.i2097i_bookmark
136
+ command_string = params[:command_string]
137
+ if command_string.nil?
138
+ raise "invalid command_string! #{command_string}"
139
+ end
140
+ Aro::P.say("#{self.name} performing #{action_key} action: [system(#{command_string})]")
141
+ result = system("#{command_string}")
142
+ Aro::P.say("=> #{result}")
143
+ Aro::P.say("\n")
144
+ when :exec_data_base
145
+ Aro::P.say("todo: implement!")
146
+ Aro::P.say("when :exec_data_base")
147
+ Aro::Dom::Ma_ain.i2097i_bookmark
148
+ end
149
+ end
150
+
151
+ end
152
+ end
153
+ end
data/sys/aro/d.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  =begin
2
4
 
3
5
  d.rb
@@ -21,7 +23,7 @@ module Aro
21
23
 
22
24
  def self.should_print?
23
25
  return false unless Aro::Cor.ivar(:ENV).present?
24
- Aro::Cor::DBG_MODES.include?(Aro::Cor.ivar(:ENV)&.to_sym)
26
+ Aro::Cor::DEBUG_MODES.include?(Aro::Cor.ivar(:ENV)&.to_sym)
25
27
  end
26
28
  end
27
29
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateDataBases < ActiveRecord::Migration[8.1]
2
4
  def change
3
5
  create_table :data_bases do |t|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateDataBaseDirectories < ActiveRecord::Migration[8.1]
2
4
  def change
3
5
  create_table :data_base_directories do |t|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateDataBaseFiles < ActiveRecord::Migration[8.1]
2
4
  def change
3
5
  create_table :data_base_files do |t|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateMenus < ActiveRecord::Migration[8.1]
2
4
  def change
3
5
  create_table :menus do |t|
@@ -1,14 +1,15 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateMenuItems < ActiveRecord::Migration[8.1]
2
4
  def change
3
5
  create_table :menu_items do |t|
4
6
  t.belongs_to :menu, null: false, foreign_key: true
5
7
  t.string :uuid, null: false
6
- t.string :tty_name
8
+ t.integer :type_flag, default: 1
7
9
 
8
10
  t.timestamps
9
11
  end
10
12
 
11
13
  add_index :menu_items, :uuid, unique: true
12
- add_index :menu_items, [:menu_id, :tty_name], unique: true
13
14
  end
14
15
  end
data/sys/aro/db.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  =begin
2
4
 
3
5
  db.rb
@@ -20,11 +22,8 @@ module Aro
20
22
 
21
23
  def self.ensure_connected!
22
24
  return if self.instance.connected?
23
-
24
25
  Aro::Db.configure_logger
25
- if Aro::Mancy.in_aro?
26
- self.instance.setup_local_aro
27
- end
26
+ self.instance.setup_local_aro if Aro::Mancy.in_aro?
28
27
  end
29
28
 
30
29
  def connected?
@@ -41,13 +40,7 @@ module Aro
41
40
  end
42
41
 
43
42
  def self.base_db_dir
44
- db_dir = File.join(Aro::Mancy.root_dir, :db.to_s)
45
- return "#{db_dir}_#{Aro::Cor::ENVS[:TEST]}" if Aro::Cor.is_test?
46
- db_dir
47
- end
48
-
49
- def self.migrate_dir
50
- File.join(Aro::Db.base_db_dir, :migrate.to_s)
43
+ File.join(Aro::Mancy.root_dir, :db.to_s)
51
44
  end
52
45
 
53
46
  def self.sql_filepath
@@ -70,7 +63,15 @@ module Aro
70
63
  end
71
64
 
72
65
  unless File.exist?(db_config_filepath)
73
- pw = Aro::P.p.ask(I18n.t("messages.base_db_password_prompt", aro_name: aro_name, sql_filepath: self.class.sql_filepath))
66
+ pw = Aro::P.p.ask(
67
+ I18n.t(
68
+ "open_menu.base_db_password_prompt",
69
+ sql_filepath: self.class.sql_filepath.gsub(
70
+ Aro::Mancy.root_dir, Aro::Mancy::ARO_DIRECTORY.to_s
71
+ ),
72
+ aro_name: aro_name
73
+ )
74
+ )
74
75
  pw = aro_name unless pw.present?
75
76
  # create database config yaml file
76
77
  c = {
@@ -98,36 +99,21 @@ module Aro
98
99
  Aro::D.say("#{self}#{__method__}#{self.active_record_connection_instance.inspect}")
99
100
  end
100
101
 
101
- def self.migrations_filepaths
102
- File.join(Aro::Db.migrate_dir, "*.rb")
102
+ def self.gem_migrations_filepaths
103
+ File.join(gem_migration_dir, "*.rb")
103
104
  end
104
105
 
105
- def self.gem_migrations_filepaths
106
- File.join(Reiquire.gem_migrations_path, :migrate.to_s, "*.rb")
106
+ def self.gem_migration_dir
107
+ File.join(Reiquire.gem_migrations_path, :migrate.to_s)
107
108
  end
108
109
 
109
110
  def migrate
110
- puts __method__
111
- migration_file_names = Dir[self.class.migrations_filepaths].map{|fp| File.basename(fp)}
112
- puts "migration_file_names: #{migration_file_names}"
113
111
  gem_migration_file_names = Dir[self.class.gem_migrations_filepaths].map{|fp| File.basename(fp)}
114
- puts "gem_migration_file_names: #{gem_migration_file_names}"
115
- mfs_all = gem_migration_file_names.all?{|gmf|
116
- migration_file_names.include?(gmf)
117
- }
118
- puts "mfs_all: #{mfs_all}"
119
-
120
- unless Dir.exist?(Aro::Db.migrate_dir) && mfs_all
121
- puts "Reiquire.copy_db_migrations_from_gem!"
122
- puts "ls #{Aro::Db.migrate_dir}"
123
- puts migration_file_names
124
- Reiquire.copy_db_migrations_from_gem!
125
- end
126
112
 
127
- migration_version = migration_file_names.map{|n|
113
+ migration_version = gem_migration_file_names.map{|n|
128
114
  n.to_s.split("_")[0].to_i
129
115
  }.max
130
- ActiveRecord::MigrationContext.new(Aro::Db.migrate_dir).migrate(migration_version)
116
+ ActiveRecord::MigrationContext.new(Aro::Db.gem_migration_dir).migrate(migration_version)
131
117
  dump_schema!
132
118
  end
133
119