aro 0.2.8 → 0.2.9
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +7 -2
- data/README.md +8 -7
- data/aro.gemspec +1 -0
- data/bin/oss_om +14 -1
- data/checksums/aro-0.2.9.gem.sha512 +1 -0
- data/craft_docker-compose.template +59 -0
- data/locale/en.yml +9 -0
- data/sys/aro/action.rb +2 -2
- data/sys/aro/db/migrate/1793913841_create_menus.rb +1 -0
- data/sys/aro/db/migrate/1793913861_create_menu_items.rb +1 -0
- data/sys/aro/designer.rb +2 -2
- data/sys/aro/imports.rb +2 -2
- data/sys/aro/library.rb +1 -1
- data/sys/aro/locale.rb +3 -3
- data/sys/aro/mancy.rb +2 -2
- data/sys/aro/models/cubicus.rb +39 -0
- data/sys/aro/models/data_base.rb +13 -3
- data/sys/aro/models/file.rb +1 -1
- data/sys/aro/models/glyph.rb +69 -0
- data/sys/aro/models/menu.rb +40 -11
- data/sys/aro/models/menu_item.rb +3 -5
- data/sys/aro/models/objecticus.rb +28 -0
- data/sys/aro/models/perspecticus.rb +28 -0
- data/sys/aro/open_system/projector.rb +103 -0
- data/sys/aro/oss_open_menu.rb +8 -3
- data/sys/aro/oss_open_system.rb +117 -0
- data/sys/aro/p.rb +0 -11
- data/sys/aro/plugins.rb +7 -5
- data/sys/aro/settings/cor.rb +0 -24
- data/sys/aro/store.rb +1 -5
- data/sys/ma_ain.rb +25 -15
- data/sys/reiquire.rb +1 -0
- data/sys/shr/prompt.rb +14 -3
- data/sys/shr/version.rb +1 -5
- metadata +31 -5
- data/sys/aro/r.rb +0 -22
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e01261ca4ed5bbcd2cc2201a4c6848d189edd299b71cb3bcd19680e6f7587714
|
|
4
|
+
data.tar.gz: 32e93c9a8c4e1104ce378c9eb59f96e042345332246f5572a30c7bbd1d085ece
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3ac9214dbb4d14810eb5770be3329bee6d36e328196c108875e5a3b25715659f6953add8196201ac4164f37e2f7a51fcda4f048ef953051133fcd92b3c11ff8f
|
|
7
|
+
data.tar.gz: f87cdd3ce23098cece61484954e2fff0538c9f847f9e751d22d5b8aa8f0e5a27ca3b2f9857e05067a5bc795f09e22ad17e348fcf399796741e8ba023dc78caf5
|
data/Gemfile.lock
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
aro (0.2.
|
|
4
|
+
aro (0.2.9)
|
|
5
5
|
activerecord (~> 8.1, >= 8.1.4.1)
|
|
6
|
+
f_dot (~> 0.0.2, >= 0.0.2)
|
|
6
7
|
i18n (~> 1.15, >= 1.15.2)
|
|
7
8
|
sqlite3 (~> 2.10, >= 2.10.2)
|
|
8
9
|
tty-font (~> 0.5, >= 0.5.0)
|
|
@@ -36,6 +37,9 @@ GEM
|
|
|
36
37
|
connection_pool (3.0.2)
|
|
37
38
|
diff-lcs (1.6.2)
|
|
38
39
|
drb (2.2.3)
|
|
40
|
+
f_dot (0.0.2)
|
|
41
|
+
tty-font (~> 0.5, >= 0.5.0)
|
|
42
|
+
tty-prompt (~> 0.23, >= 0.23.1)
|
|
39
43
|
ffi (1.17.4-aarch64-linux-gnu)
|
|
40
44
|
ffi (1.17.4-aarch64-linux-musl)
|
|
41
45
|
ffi (1.17.4-arm-linux-gnu)
|
|
@@ -136,7 +140,7 @@ CHECKSUMS
|
|
|
136
140
|
activemodel (8.1.4.1) sha256=063caf105372fbc98b2d789e4be23de63ac5c043f7d9330f04e2caddb7012805
|
|
137
141
|
activerecord (8.1.4.1) sha256=bd65599ca0b5d210937f835d42c7aff69d271741c75aab022730be6cbce67e87
|
|
138
142
|
activesupport (8.1.4.1) sha256=16ac4f341ca65c85a1fcdb8ac73f68891aae9e3c4a6f9c3a27daed8b00017ed7
|
|
139
|
-
aro (0.2.
|
|
143
|
+
aro (0.2.9)
|
|
140
144
|
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
|
|
141
145
|
bigdecimal (4.1.3) sha256=61ebe1e5e559bdc3cc6f2c0ee7f427321fc838f59611c294356eb04d6e21cf66
|
|
142
146
|
bundler (4.0.24) sha256=16ca64e20816a0cf151a948fb141d788602996d2b4d73577b74388fe84fa98bc
|
|
@@ -144,6 +148,7 @@ CHECKSUMS
|
|
|
144
148
|
connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
|
|
145
149
|
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
|
|
146
150
|
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
|
|
151
|
+
f_dot (0.0.2)
|
|
147
152
|
ffi (1.17.4-aarch64-linux-gnu) sha256=b208f06f91ffd8f5e1193da3cae3d2ccfc27fc36fba577baf698d26d91c080df
|
|
148
153
|
ffi (1.17.4-aarch64-linux-musl) sha256=9286b7a615f2676245283aef0a0a3b475ae3aae2bb5448baace630bb77b91f39
|
|
149
154
|
ffi (1.17.4-arm-linux-gnu) sha256=d6dbddf7cb77bf955411af5f187a65b8cd378cb003c15c05697f5feee1cb1564
|
data/README.md
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
> __a oss_om unix utility__
|
|
1
|
+
# [aro(rubygems)](https://rubygems.org/gems/aro)
|
|
2
|
+
# [aro(github)](https://github.com/f-oss-om-foundation/aro)
|
|
5
3
|
|
|
6
4
|
##### __current version:__
|
|
7
5
|
[](https://badge.fury.io/rb/aro)
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
```json
|
|
9
|
+
{"tldr": "aro is a unix utility for designing and creating linux applications."}
|
|
10
|
+
```
|
|
10
11
|
|
|
11
12
|
### installation
|
|
12
13
|
|
|
@@ -21,6 +22,6 @@ $ oss_om
|
|
|
21
22
|
```
|
|
22
23
|
[license](http://opensource.org/licenses/MIT)
|
|
23
24
|
|
|
24
|
-
[issues](https://github.com/
|
|
25
|
+
[issues](https://github.com/f-oss-om-foundation/aro/issues)
|
|
25
26
|
|
|
26
|
-
##### aro (v0.2.
|
|
27
|
+
##### aro (v0.2.9) by scot reichman is copyright (2026)
|
data/aro.gemspec
CHANGED
|
@@ -39,4 +39,5 @@ Gem::Specification.new do |spec|
|
|
|
39
39
|
spec.add_runtime_dependency "sqlite3", "~> 2.10", ">= 2.10.2"
|
|
40
40
|
spec.add_runtime_dependency "tty-prompt", "~> 0.23", ">= 0.23.1"
|
|
41
41
|
spec.add_runtime_dependency "tty-font", "~> 0.5", ">= 0.5.0"
|
|
42
|
+
spec.add_runtime_dependency "f_dot", "~> 0.0.2", ">= 0.0.2"
|
|
42
43
|
end
|
data/bin/oss_om
CHANGED
|
@@ -14,4 +14,17 @@
|
|
|
14
14
|
|
|
15
15
|
require :aro.to_s
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
begin
|
|
18
|
+
if ARGV[0]&.strip&.to_sym == :cubicus
|
|
19
|
+
# start in FDot::DISPLAY_MODES[:websockets] display_mode
|
|
20
|
+
# start websocket thread
|
|
21
|
+
FDot::Based::Processor.instance.f_dot_space_override_path = Aro::Mancy.root_dir
|
|
22
|
+
FDot::Based::Cubicus.instance.start_ws_thread
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
Aro::Dom::Ma_ain.instance.reign!
|
|
26
|
+
rescue StandardError => e
|
|
27
|
+
puts "rescued in aro bin for #{e}"
|
|
28
|
+
puts Thread.current.backtrace
|
|
29
|
+
raise e
|
|
30
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
59c1276f49f9d1dc48f518df845f786e45a262dad963bb0e5ceda66dd88e7baa3f602e9da0605499d0bc987f78d0360e3929e20a3d904c081f91e910b44c5b65
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# this configuration is built explicitly for websocket
|
|
2
|
+
# controls such that a/any unix host system can
|
|
3
|
+
# run aro's oss_om via websockets and a minimal
|
|
4
|
+
# implementation of a single instance of mozilla firefox
|
|
5
|
+
# running in kiosk mode within a docker container.
|
|
6
|
+
# the host system starts the oss_om process in cubicus mode:
|
|
7
|
+
# $ oss_om cubicus
|
|
8
|
+
# this starts oss_om in websocket display_mode
|
|
9
|
+
# lightweight golang websocket server process
|
|
10
|
+
# starts and begins processing communication
|
|
11
|
+
# between the host process (oss_om) and the
|
|
12
|
+
# display (a regular browser tab can also be used)
|
|
13
|
+
# for controls processing and rendering display to
|
|
14
|
+
# the display (firefox docker container)
|
|
15
|
+
# oss_om has three components within a project
|
|
16
|
+
# 1) display:
|
|
17
|
+
# a) a browser tab visiting the same url as the display docker container.
|
|
18
|
+
# b) the display docker container
|
|
19
|
+
# 2) controls:
|
|
20
|
+
# this is the host system that runs docker compose and starts oss_om cubicus
|
|
21
|
+
# 3) history:
|
|
22
|
+
# this is a gitea instance for oss_om encrypted storage
|
|
23
|
+
# note: this is not implemented yet
|
|
24
|
+
#
|
|
25
|
+
|
|
26
|
+
services:
|
|
27
|
+
display:
|
|
28
|
+
image: lscr.io/linuxserver/firefox:latest
|
|
29
|
+
container_name: display
|
|
30
|
+
environment:
|
|
31
|
+
- PUID=1000
|
|
32
|
+
- PGID=1000
|
|
33
|
+
- TZ=Etc/UTC
|
|
34
|
+
- FIREFOX_CLI=--kiosk http://host.docker.internal:8080/
|
|
35
|
+
- SELKIES_UI_SHOW_SIDEBAR=false
|
|
36
|
+
- HARDEN_DESKTOP=true
|
|
37
|
+
- HARDEN_OPENBOX=true
|
|
38
|
+
- RESTART_APP=true
|
|
39
|
+
volumes:
|
|
40
|
+
- ./.oss_om/open_system/display:/config
|
|
41
|
+
ports:
|
|
42
|
+
- "3001:3001"
|
|
43
|
+
- "3000:3000"
|
|
44
|
+
shm_size: "1gb"
|
|
45
|
+
restart: unless-stopped
|
|
46
|
+
extra_hosts:
|
|
47
|
+
- "host.docker.internal:host-gateway"
|
|
48
|
+
history:
|
|
49
|
+
image: gitea/gitea:latest
|
|
50
|
+
container_name: history
|
|
51
|
+
environment:
|
|
52
|
+
- USER_UID=1000
|
|
53
|
+
- USER_GID=1000
|
|
54
|
+
restart: unless-stopped
|
|
55
|
+
volumes:
|
|
56
|
+
- ./.oss_om/open_system/history:/data
|
|
57
|
+
ports:
|
|
58
|
+
- "2997:3000"
|
|
59
|
+
- "2222:22"
|
data/locale/en.yml
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
en:
|
|
2
|
+
open_system:
|
|
3
|
+
create_glyph_select: "choose glyph type"
|
|
2
4
|
open_menu:
|
|
3
5
|
base_db_password_prompt: "enter database password <%{sql_filepath}> (default %{aro_name}): "
|
|
4
6
|
edit_action_for_menu_item: "edit action '%{action_name}' for menu item '%{localized_name}'"
|
|
@@ -19,9 +21,16 @@ en:
|
|
|
19
21
|
confirm_import: "%{prompt_text} (selected: %{file_name}) confirm (y/n):"
|
|
20
22
|
user_cancelled: "user cancelled import."
|
|
21
23
|
plugins:
|
|
24
|
+
open_plugins_menu: "install :open_system or choose from the plugins/ directory."
|
|
22
25
|
confirm_plugin: "[selected %{file_name}] confirm (y/n):"
|
|
23
26
|
user_cancelled: "user cancelled import."
|
|
24
27
|
select_plugin: "select a plugin"
|
|
28
|
+
choose_plugin_description: "ruby classes are used as a way to interface other processes with oss_om."
|
|
29
|
+
choose_plugin_sample_info: "a sample_plugin.rb file is automatically generated in the plugins/ directory."
|
|
30
|
+
description: "chapter_plugins are installed in books"
|
|
31
|
+
location: "you can see them by navigating to the library"
|
|
32
|
+
new_book_prompt: "would you like to create a new book?"
|
|
33
|
+
new_book_menu: "create new book now?"
|
|
25
34
|
library:
|
|
26
35
|
get_book_param: "enter %{key}"
|
|
27
36
|
new_book_select: "creating a new book"
|
data/sys/aro/action.rb
CHANGED
|
@@ -65,7 +65,7 @@ module Aro
|
|
|
65
65
|
valid_param_keys!(action_key, params) && valid_param_values!(action_key, params)
|
|
66
66
|
end
|
|
67
67
|
|
|
68
|
-
def self.validate_data!(action_key, data)
|
|
68
|
+
def self.validate_data!(action_key, data = {})
|
|
69
69
|
Aro::P.say("validating #{action_key} action data")
|
|
70
70
|
|
|
71
71
|
raise "invalid data! (#{data})" unless data.kind_of?(Hash)
|
|
@@ -121,7 +121,7 @@ module Aro
|
|
|
121
121
|
oss_om_const.send(params[:aro_class_method])
|
|
122
122
|
end
|
|
123
123
|
rescue NoMethodError => e
|
|
124
|
-
|
|
124
|
+
puts Thread.main.backtrace
|
|
125
125
|
Aro::P.say("exec_oss_om error! #{e}")
|
|
126
126
|
end
|
|
127
127
|
end
|
data/sys/aro/designer.rb
CHANGED
|
@@ -35,7 +35,7 @@ module Aro
|
|
|
35
35
|
Aro::P.say("run the following commands to continue:")
|
|
36
36
|
Aro::P.say("$ cd #{Aro::Cor.ivar(:OSS_OM_HOME)} && oss_om")
|
|
37
37
|
Aro::P.say("exiting...")
|
|
38
|
-
|
|
38
|
+
Aro::Dom::Ma_ain.exec_quit!
|
|
39
39
|
else
|
|
40
40
|
Aro::Dom::Ma_ain.instance.reign!
|
|
41
41
|
end
|
|
@@ -432,7 +432,7 @@ module Aro
|
|
|
432
432
|
while new_val.nil? && !user_cancelled
|
|
433
433
|
Aro::P.say(ask_text)
|
|
434
434
|
puts "\n"
|
|
435
|
-
new_val = Aro::
|
|
435
|
+
new_val = Aro::Prompt.ask(prompt_text_override || I18n.t("open_menu.get_new_value_from_user"))
|
|
436
436
|
user_cancelled = new_val.nil? || new_val.empty?
|
|
437
437
|
new_val = nil if user_cancelled
|
|
438
438
|
end
|
data/sys/aro/imports.rb
CHANGED
|
@@ -67,9 +67,9 @@ module Aro
|
|
|
67
67
|
[".keep", ""],
|
|
68
68
|
["sample.txt", "sample text"]
|
|
69
69
|
].each{|a|
|
|
70
|
-
file_path = ::File.join(imports_dir, a[Aro::
|
|
70
|
+
file_path = ::File.join(imports_dir, a[Aro::Mancy::O])
|
|
71
71
|
::File.open(file_path, "w+") {|f|
|
|
72
|
-
f.write(a[Aro::
|
|
72
|
+
f.write(a[Aro::Mancy::S])
|
|
73
73
|
} unless ::File.exist?(file_path)
|
|
74
74
|
}
|
|
75
75
|
end
|
data/sys/aro/library.rb
CHANGED
|
@@ -115,7 +115,7 @@ module Aro
|
|
|
115
115
|
private
|
|
116
116
|
|
|
117
117
|
def self.generate_new_book!(book_params)
|
|
118
|
-
new_book_title_key = book_params[:title].downcase.gsub(" ", "_").to_sym
|
|
118
|
+
new_book_title_key = "#{book_params[:title].downcase}".gsub(" ", "_").to_sym
|
|
119
119
|
|
|
120
120
|
book_menu = open_book(
|
|
121
121
|
new_book_title_key,
|
data/sys/aro/locale.rb
CHANGED
|
@@ -15,7 +15,7 @@ module Aro
|
|
|
15
15
|
class Locale
|
|
16
16
|
|
|
17
17
|
def self.add_i18n_key(user_input_text, library_name: :menus, new_i18n_display_key: nil)
|
|
18
|
-
Aro::
|
|
18
|
+
Aro::D.say(__method__)
|
|
19
19
|
library_yaml = load_library(library_name: library_name)
|
|
20
20
|
new_i18n_display_key = i18n_keyify_text(user_input_text) if new_i18n_display_key.nil?
|
|
21
21
|
|
|
@@ -70,7 +70,7 @@ module Aro
|
|
|
70
70
|
|
|
71
71
|
def self.i18n_keyify_text(text)
|
|
72
72
|
# downcase'd, gsub non-word characters with "_"
|
|
73
|
-
text.downcase.gsub(/[\W]/, "_")
|
|
73
|
+
"#{text.downcase}".gsub(/[\W]/, "_")
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
def self.i18n_valuify_text(text)
|
|
@@ -94,7 +94,7 @@ module Aro
|
|
|
94
94
|
Reiquire.configure_i18n
|
|
95
95
|
return false
|
|
96
96
|
end
|
|
97
|
-
|
|
97
|
+
Aro::V.say(library_yaml.inspect)
|
|
98
98
|
|
|
99
99
|
default_locale = library_yaml[
|
|
100
100
|
I18n.default_locale.to_s
|
data/sys/aro/mancy.rb
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
module Aro
|
|
16
16
|
class Mancy
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
A = :"@"
|
|
19
19
|
O = 0
|
|
20
20
|
S = 1
|
|
@@ -96,7 +96,7 @@ module Aro
|
|
|
96
96
|
end
|
|
97
97
|
|
|
98
98
|
def self.domain
|
|
99
|
-
is_initialized? ? "#{Aro::Mancy.aro_mancy_name}#{Aro::Mancy::A}#{Aro::Mancy}" : `whoami`.strip
|
|
99
|
+
is_initialized? ? "#{Aro::Mancy.aro_mancy_name}#{Aro::Mancy::A}#{Aro::Mancy.name}" : `whoami`.strip
|
|
100
100
|
end
|
|
101
101
|
|
|
102
102
|
def self.aro_mancy_name
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
=begin
|
|
4
|
+
|
|
5
|
+
cubicus.rb
|
|
6
|
+
|
|
7
|
+
aro dom cubicus menu.
|
|
8
|
+
|
|
9
|
+
by i2097i
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require_relative "./menu"
|
|
14
|
+
|
|
15
|
+
class Aro::Dom::Cubicus < Aro::Dom::Menu
|
|
16
|
+
|
|
17
|
+
EXEC_METHODS = [
|
|
18
|
+
# ...
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
def generate_open_system!
|
|
22
|
+
return unless is_menu_named?(:open_system) &&
|
|
23
|
+
menu_items.empty?
|
|
24
|
+
|
|
25
|
+
[:create_glyph].each{|k|
|
|
26
|
+
i = generate_new_item(k, for_type: :system)
|
|
27
|
+
|
|
28
|
+
i.aro_file.write!(
|
|
29
|
+
Aro::Dom::Store.build_exec_oss_om_params!(
|
|
30
|
+
k,
|
|
31
|
+
Aro::Dom::Glyph,
|
|
32
|
+
"#{k}!",
|
|
33
|
+
[i.uuid],
|
|
34
|
+
{}
|
|
35
|
+
)
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
end
|
data/sys/aro/models/data_base.rb
CHANGED
|
@@ -27,7 +27,10 @@ class Aro::Dom::DataBase < ActiveRecord::Base
|
|
|
27
27
|
menu = Aro::Dom::Menu.find_by(uuid: @@data_base_directory.uuid)
|
|
28
28
|
if menu.nil?
|
|
29
29
|
# find or create the new menu
|
|
30
|
-
|
|
30
|
+
menu_const = Aro::Dom::Menu
|
|
31
|
+
menu_const = Aro::Dom::Cubicus if menu_sym == :open_system
|
|
32
|
+
|
|
33
|
+
menu = menu_const.create(uuid: @@data_base_directory.uuid)
|
|
31
34
|
Aro::Dom::Locale.add_i18n_key(
|
|
32
35
|
menu_sym.to_s,
|
|
33
36
|
new_i18n_display_key: menu.uuid
|
|
@@ -112,10 +115,17 @@ class Aro::Dom::DataBase < ActiveRecord::Base
|
|
|
112
115
|
case @@data_base_directory.unix_path.to_sym
|
|
113
116
|
when :ma_ain
|
|
114
117
|
menu.generate_ma_ain!
|
|
115
|
-
when :
|
|
116
|
-
menu.
|
|
118
|
+
when :configuration
|
|
119
|
+
menu.generate_configuration!
|
|
117
120
|
when :library
|
|
118
121
|
generate_items!(menu, Aro::Dom::Library)
|
|
122
|
+
when :open_system
|
|
123
|
+
unless menu.kind_of?(Aro::Dom::Cubicus)
|
|
124
|
+
raise "expected Aro::Dom::Cubicus open_system menu type! #{menu.inspect}"
|
|
125
|
+
end
|
|
126
|
+
menu.generate_open_system!
|
|
127
|
+
when :cor
|
|
128
|
+
generate_items!(menu, Aro::Cor)
|
|
119
129
|
when :git
|
|
120
130
|
generate_items!(menu, Aro::Dom::Git)
|
|
121
131
|
when :ssh
|
data/sys/aro/models/file.rb
CHANGED
|
@@ -16,7 +16,7 @@ class Aro::Dom::DataBase::File < ActiveRecord::Base
|
|
|
16
16
|
belongs_to :data_base_directory, class_name: "Aro::Dom::DataBase::Directory"
|
|
17
17
|
|
|
18
18
|
def write!(updates)
|
|
19
|
-
Aro::Dom::Store.
|
|
19
|
+
Aro::Dom::Store.save_file!(self, updates)
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def aro_file_path
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
=begin
|
|
4
|
+
|
|
5
|
+
glyph.rb
|
|
6
|
+
|
|
7
|
+
aro dom glyph menu item.
|
|
8
|
+
|
|
9
|
+
by i2097i
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require_relative "./menu_item"
|
|
14
|
+
|
|
15
|
+
class Aro::Dom::Glyph < Aro::Dom::MenuItem
|
|
16
|
+
# belongs_to :menu
|
|
17
|
+
|
|
18
|
+
EXEC_METHODS = [
|
|
19
|
+
:create_glyph!
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
def self.create_glyph!(menu_item_uuid, action_data = {})
|
|
23
|
+
create_glyph_menu_item = Aro::Dom::MenuItem.find_by(uuid: menu_item_uuid)
|
|
24
|
+
|
|
25
|
+
raise "invalid menu_item_uuid! #{menu_item_uuid}" if create_glyph_menu_item.nil?
|
|
26
|
+
|
|
27
|
+
Aro::P.say("#{self.name} is the base essence within open_system")
|
|
28
|
+
|
|
29
|
+
options = [
|
|
30
|
+
{name: :back, value: :back},
|
|
31
|
+
{name: :objecticus, value: :objecticus},
|
|
32
|
+
{name: :perspecticus, value: :perspecticus}
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
selected_option = Aro::P.default_select(
|
|
36
|
+
I18n.t("open_system.create_glyph_select"),
|
|
37
|
+
options
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
return false if selected_option.kind_of?(Symbol) &&
|
|
41
|
+
selected_option == :back
|
|
42
|
+
|
|
43
|
+
selected_const = selected_option == :perspecticus ? Aro::Dom::Perspecticus : Aro::Dom::Objecticus
|
|
44
|
+
|
|
45
|
+
new_name = Aro::Dom::Designer.get_new_value_from_user(
|
|
46
|
+
"enter name for new #{selected_option}:"
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
i = create_glyph_menu_item.menu.generate_new_item(
|
|
50
|
+
new_name,
|
|
51
|
+
for_type: :system,
|
|
52
|
+
open_system_class: selected_const.name
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
i.aro_file.write!(
|
|
56
|
+
Aro::Dom::Store.build_exec_oss_om_params!(
|
|
57
|
+
new_name,
|
|
58
|
+
selected_const,
|
|
59
|
+
"open!",
|
|
60
|
+
[i.uuid],
|
|
61
|
+
{}
|
|
62
|
+
)
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
Aro::P.say("new #{self.name} '#{i.localized_name}' created successfully!")
|
|
66
|
+
|
|
67
|
+
Aro::Dom::Ma_ain.navigate_to!(create_glyph_menu_item.menu)
|
|
68
|
+
end
|
|
69
|
+
end
|
data/sys/aro/models/menu.rb
CHANGED
|
@@ -13,6 +13,15 @@
|
|
|
13
13
|
class Aro::Dom::Menu < ActiveRecord::Base
|
|
14
14
|
include Aro::Dom::Uuid
|
|
15
15
|
|
|
16
|
+
self.inheritance_column = :open_system_class
|
|
17
|
+
|
|
18
|
+
OPEN_SYSTEM_CLASSES = [
|
|
19
|
+
"Aro::Dom::Cubicus",
|
|
20
|
+
"Aro::Dom::Glyph",
|
|
21
|
+
"Aro::Dom::Objecticus",
|
|
22
|
+
"Aro::Dom::Perspecticus",
|
|
23
|
+
]
|
|
24
|
+
|
|
16
25
|
has_many :menu_items, class_name: "Aro::Dom::MenuItem"
|
|
17
26
|
|
|
18
27
|
def localized_name
|
|
@@ -27,9 +36,17 @@ class Aro::Dom::Menu < ActiveRecord::Base
|
|
|
27
36
|
@directory ||= Aro::Dom::DataBase::Directory.find_by(uuid: uuid)
|
|
28
37
|
end
|
|
29
38
|
|
|
30
|
-
def generate_new_item(localized_name, for_type: :user)
|
|
31
|
-
|
|
39
|
+
def generate_new_item(localized_name, for_type: :user, open_system_class: nil)
|
|
40
|
+
localized_name = localized_name&.to_s
|
|
32
41
|
new_menu_item = menu_items.create(type_flag: for_type)
|
|
42
|
+
if !open_system_class.nil? &&
|
|
43
|
+
Aro::Dom::Menu::OPEN_SYSTEM_CLASSES.include?(open_system_class&.to_s)
|
|
44
|
+
new_menu_item.update(open_system_class: open_system_class)
|
|
45
|
+
|
|
46
|
+
# load from constant
|
|
47
|
+
new_menu_item = new_menu_item.open_system_class.constantize.find_by(uuid: new_menu_item.uuid)
|
|
48
|
+
|
|
49
|
+
end
|
|
33
50
|
Aro::Dom::DataBase.sync_menu_item!(new_menu_item, localized_name)
|
|
34
51
|
new_menu_item
|
|
35
52
|
end
|
|
@@ -45,21 +62,33 @@ class Aro::Dom::Menu < ActiveRecord::Base
|
|
|
45
62
|
return unless is_menu_named?(:ma_ain) &&
|
|
46
63
|
menu_items.empty?
|
|
47
64
|
|
|
48
|
-
[:library, :
|
|
65
|
+
[:library, :open_system, :configuration, :quit].each{|k|
|
|
49
66
|
i = generate_new_item(k, for_type: :system)
|
|
50
67
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
68
|
+
if k == :open_system
|
|
69
|
+
i.aro_file.write!(
|
|
70
|
+
Aro::Dom::Store.build_exec_oss_om_params!(
|
|
71
|
+
k,
|
|
72
|
+
Aro::Dom::Oss_OpenSystem,
|
|
73
|
+
"start!",
|
|
74
|
+
[i.uuid],
|
|
75
|
+
{}
|
|
76
|
+
)
|
|
56
77
|
)
|
|
57
|
-
|
|
78
|
+
else
|
|
79
|
+
i.aro_file.write!(
|
|
80
|
+
Aro::Dom::Store.build_exec_oss_om_params!(
|
|
81
|
+
k,
|
|
82
|
+
Aro::Dom::Ma_ain,
|
|
83
|
+
"exec_#{k}!"
|
|
84
|
+
)
|
|
85
|
+
)
|
|
86
|
+
end
|
|
58
87
|
}
|
|
59
88
|
end
|
|
60
89
|
|
|
61
|
-
def
|
|
62
|
-
return unless is_menu_named?(:
|
|
90
|
+
def generate_configuration!
|
|
91
|
+
return unless is_menu_named?(:configuration) &&
|
|
63
92
|
menu_items.empty?
|
|
64
93
|
|
|
65
94
|
[:cor, :git, :ssh].each{|k|
|
data/sys/aro/models/menu_item.rb
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
=begin
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
menu_item.rb
|
|
6
6
|
|
|
7
7
|
aro dom menu item.
|
|
8
8
|
|
|
@@ -14,6 +14,8 @@ class Aro::Dom::MenuItem < ActiveRecord::Base
|
|
|
14
14
|
include Aro::Dom::TarGoForRootSec
|
|
15
15
|
include Aro::Dom::Uuid
|
|
16
16
|
|
|
17
|
+
self.inheritance_column = :open_system_class
|
|
18
|
+
|
|
17
19
|
belongs_to :menu, class_name: "Aro::Dom::Menu"
|
|
18
20
|
|
|
19
21
|
enum :type_flag, [
|
|
@@ -21,10 +23,6 @@ class Aro::Dom::MenuItem < ActiveRecord::Base
|
|
|
21
23
|
:user
|
|
22
24
|
]
|
|
23
25
|
|
|
24
|
-
def as_tty
|
|
25
|
-
{name: localized_name, value: uuid}
|
|
26
|
-
end
|
|
27
|
-
|
|
28
26
|
def localized_name
|
|
29
27
|
I18n.t(full_i18n_path)
|
|
30
28
|
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
=begin
|
|
4
|
+
|
|
5
|
+
objecticus.rb
|
|
6
|
+
|
|
7
|
+
aro dom objecticus menu item.
|
|
8
|
+
|
|
9
|
+
by i2097i
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Aro::Dom::Objecticus < Aro::Dom::Glyph
|
|
15
|
+
# belongs_to :menu
|
|
16
|
+
|
|
17
|
+
EXEC_METHODS = [
|
|
18
|
+
:open!
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
def self.open!(objecticus_uuid, action_data = {})
|
|
22
|
+
objecticus_menu_item = Aro::Dom::Objecticus.find_by(uuid: objecticus_uuid)
|
|
23
|
+
raise "invalid objecticus_uuid #{objecticus_uuid}" if objecticus_menu_item.nil?
|
|
24
|
+
|
|
25
|
+
Aro::Dom::Oss_OpenSystem.open_projector!(objecticus_menu_item)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
=begin
|
|
4
|
+
|
|
5
|
+
perspecticus.rb
|
|
6
|
+
|
|
7
|
+
aro dom perspecticus menu item.
|
|
8
|
+
|
|
9
|
+
by i2097i
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Aro::Dom::Perspecticus < Aro::Dom::Glyph
|
|
15
|
+
# belongs_to :menu
|
|
16
|
+
|
|
17
|
+
EXEC_METHODS = [
|
|
18
|
+
:open!
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
def self.open!(perspecticus_uuid, action_data = {})
|
|
22
|
+
perspecticus_menu_item = Aro::Dom::Perspecticus.find_by(uuid: perspecticus_uuid)
|
|
23
|
+
raise "invalid perspecticus_uuid #{perspecticus_uuid}" if perspecticus_menu_item.nil?
|
|
24
|
+
|
|
25
|
+
Aro::Dom::Oss_OpenSystem.open_projector!(perspecticus_menu_item)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
end
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
=begin
|
|
4
|
+
|
|
5
|
+
projector.rb
|
|
6
|
+
|
|
7
|
+
aro dom projector.
|
|
8
|
+
|
|
9
|
+
by i2097i
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
# this is a set of classes that run in-memory with data from:
|
|
14
|
+
# the ma_ain open_system menu item's action_data (open_system_space)
|
|
15
|
+
# the glyph's (is kind_of menu item) action_data (glyph_action_data)
|
|
16
|
+
#
|
|
17
|
+
#
|
|
18
|
+
module Aro
|
|
19
|
+
module Dom
|
|
20
|
+
class Projector
|
|
21
|
+
|
|
22
|
+
DIRECTIONS = {
|
|
23
|
+
north: 0,
|
|
24
|
+
south: 1,
|
|
25
|
+
east: 2,
|
|
26
|
+
west: 3
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
DEFAULT_GLYPH = {
|
|
30
|
+
"direction": 0,
|
|
31
|
+
"position": {"x": 0, "y": 0, "z": 0}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
DEFAULT_SPACE = []
|
|
35
|
+
attr_accessor :is_projecting
|
|
36
|
+
attr_accessor :cubicus_uuid
|
|
37
|
+
attr_accessor :glyph_uuid
|
|
38
|
+
attr_accessor :open_system_space
|
|
39
|
+
attr_accessor :glyph_action_data
|
|
40
|
+
|
|
41
|
+
# a projector generates and manages open_system space
|
|
42
|
+
# a projector projects a glyph onto a display
|
|
43
|
+
# a projector receives user input on behalf of the glyph
|
|
44
|
+
# a projector modifies the attributes of a glyph in accordance with user input
|
|
45
|
+
|
|
46
|
+
def initialize(cubicus, glyph, glyph_action_data)
|
|
47
|
+
self.glyph_action_data = {} # initialize
|
|
48
|
+
self.open_system_space = {} # initialize
|
|
49
|
+
self.is_projecting = false
|
|
50
|
+
self.cubicus_uuid = cubicus.uuid
|
|
51
|
+
self.glyph_uuid = glyph.uuid
|
|
52
|
+
|
|
53
|
+
self.glyph_action_data = glyph_action_data.empty? ? Aro::Dom::Projector::DEFAULT_GLYPH : glyph_action_data
|
|
54
|
+
|
|
55
|
+
# get open_system_data
|
|
56
|
+
open_system_item = Aro::Dom::Oss_OpenSystem.instance.get_menu_item
|
|
57
|
+
open_system_data = open_system_item.store.safe_get_key("action_data") || {}
|
|
58
|
+
raise "missing action data for #{open_system_item}!" if open_system_data.nil? ||
|
|
59
|
+
!open_system_data.kind_of?(Hash)
|
|
60
|
+
|
|
61
|
+
# load projector with open_system_space
|
|
62
|
+
self.open_system_space = open_system_data["open_system_space"] || Aro::Dom::Projector::DEFAULT_SPACE
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def project!
|
|
66
|
+
self.is_projecting = true
|
|
67
|
+
|
|
68
|
+
self.is_projecting = false
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def glyph
|
|
72
|
+
Aro::Dom::Glyph.find_by(uuid: self.glyph_uuid)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def direction_name
|
|
76
|
+
Aro::Dom::Projector::DIRECTIONS.select{|k, v| v == self.glyph_action_data["direction"]}.first[0]
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# FDot::Based::Cubicus delegate
|
|
80
|
+
def current_display
|
|
81
|
+
(TTY::Font.new(:standard).write(
|
|
82
|
+
glyph.localized_name,
|
|
83
|
+
letter_spacing: 1
|
|
84
|
+
).split("\n") + [
|
|
85
|
+
"the glyph is facing #{direction_name}.",
|
|
86
|
+
"the glyph's position is #{self.glyph_action_data["position"]}.",
|
|
87
|
+
]).join("\n")
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# FDot::Based::Cubicus delegate
|
|
91
|
+
def current_controls
|
|
92
|
+
[] # empty controls asserts keyboard movement in cubicus
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# FDot::Based::Cubicus delegate
|
|
96
|
+
def respond_to_control(keyboard_event)
|
|
97
|
+
Aro::P.say("received #{keyboard_event} in #{__method__}")
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
end
|
|
103
|
+
end
|
data/sys/aro/oss_open_menu.rb
CHANGED
|
@@ -17,11 +17,16 @@ module Aro
|
|
|
17
17
|
EXEC_CLASSES = [
|
|
18
18
|
"Aro::Cor",
|
|
19
19
|
"Aro::Dom::Oss_OpenMenu",
|
|
20
|
+
"Aro::Dom::Oss_OpenSystem",
|
|
20
21
|
"Aro::Dom::Ma_ain",
|
|
21
22
|
"Aro::Dom::Library",
|
|
22
23
|
"Aro::Dom::Book",
|
|
23
24
|
"Aro::Dom::Git",
|
|
24
|
-
"Aro::Dom::Ssh"
|
|
25
|
+
"Aro::Dom::Ssh",
|
|
26
|
+
"Aro::Dom::Cubicus",
|
|
27
|
+
"Aro::Dom::Glyph",
|
|
28
|
+
"Aro::Dom::Perspecticus",
|
|
29
|
+
"Aro::Dom::Objecticus"
|
|
25
30
|
]
|
|
26
31
|
|
|
27
32
|
EXEC_METHODS = [
|
|
@@ -204,8 +209,8 @@ module Aro
|
|
|
204
209
|
|
|
205
210
|
unless allow_exec_unsecure_oss_om_entries || Aro::Dom::Ma_ain.is_encrypted?
|
|
206
211
|
Aro::P.say(__method__)
|
|
207
|
-
Aro::P.say("redirecting to
|
|
208
|
-
Aro::Dom::Ma_ain.
|
|
212
|
+
Aro::P.say("redirecting to configuration until Aro::Dom::Ma_ain.is_encrypted!")
|
|
213
|
+
Aro::Dom::Ma_ain.exec_configuration!
|
|
209
214
|
return
|
|
210
215
|
end
|
|
211
216
|
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
=begin
|
|
4
|
+
|
|
5
|
+
oss_open_system.rb
|
|
6
|
+
|
|
7
|
+
aro dom oss_open_system.
|
|
8
|
+
|
|
9
|
+
by i2097i
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
module Aro
|
|
14
|
+
module Dom
|
|
15
|
+
class Oss_OpenSystem
|
|
16
|
+
include Singleton
|
|
17
|
+
|
|
18
|
+
attr_accessor :menu_item_uuid
|
|
19
|
+
attr_accessor :runtime_data
|
|
20
|
+
attr_accessor :access_validated
|
|
21
|
+
attr_accessor :f_dot_mutex
|
|
22
|
+
|
|
23
|
+
EXEC_METHODS = [
|
|
24
|
+
:start!
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
DEFAULT_RUNTIME = {
|
|
28
|
+
f_dot_action_data: nil
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
def initialize
|
|
32
|
+
self.menu_item_uuid = nil
|
|
33
|
+
self.runtime_data = Aro::Dom::Oss_OpenSystem::DEFAULT_RUNTIME.dup.stringify_keys
|
|
34
|
+
self.f_dot_mutex = Mutex.new
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def self.start!(menu_item_uuid = nil, action_data = {})
|
|
38
|
+
self.instance.access_validated = false
|
|
39
|
+
self.instance.menu_item_uuid = menu_item_uuid
|
|
40
|
+
menu_item = self.instance.get_menu_item
|
|
41
|
+
|
|
42
|
+
raise "invalid menu_item! #{self.instance.menu_item_uuid}" if menu_item.nil?
|
|
43
|
+
|
|
44
|
+
self.instance.runtime_data = action_data.dup
|
|
45
|
+
|
|
46
|
+
puts TTY::Font.new(:standard).write(
|
|
47
|
+
:open_system.to_s,
|
|
48
|
+
letter_spacing: 1
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
raise "invalid action data for #{menu_item.inspect}!" if action_data.nil? ||
|
|
52
|
+
!action_data.kind_of?(Hash)
|
|
53
|
+
|
|
54
|
+
run_f_dot_authentication!
|
|
55
|
+
|
|
56
|
+
Aro::P.say("#{self.name} f_dot access validated: #{self.instance.access_validated}")
|
|
57
|
+
return unless self.instance.access_validated
|
|
58
|
+
|
|
59
|
+
Aro::Dom::Ma_ain.open!(:open_system)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def write_runtime!
|
|
63
|
+
get_menu_item.aro_file.write!({
|
|
64
|
+
action_data: self.runtime_data
|
|
65
|
+
})
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def self.run_f_dot_authentication!
|
|
69
|
+
write_state_callback = Proc.new{|incoming_data, validated = false|
|
|
70
|
+
Aro::Dom::Oss_OpenSystem.instance.f_dot_mutex.synchronize do
|
|
71
|
+
Aro::Dom::Oss_OpenSystem.instance.access_validated = true if validated
|
|
72
|
+
Aro::Dom::Oss_OpenSystem.instance.update_runtime_f_dot(incoming_data)
|
|
73
|
+
end
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
FDot::Based::Processor.initialize_with_data(
|
|
77
|
+
Aro::Mancy.root_dir,
|
|
78
|
+
write_state_callback,
|
|
79
|
+
self.instance.runtime_data["f_dot_action_data"],
|
|
80
|
+
true # one_move_mode
|
|
81
|
+
)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def update_runtime_f_dot(action_data)
|
|
85
|
+
if action_data.nil? ||
|
|
86
|
+
!action_data.kind_of?(Hash)
|
|
87
|
+
|
|
88
|
+
raise "invalid action data for #{action_data.inspect} in #{__method__}!"
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
self.runtime_data["f_dot_action_data"] = action_data
|
|
92
|
+
|
|
93
|
+
self.write_runtime!
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def get_menu_item
|
|
97
|
+
Aro::Dom::MenuItem.find_by(uuid: self.menu_item_uuid)
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
def self.open_projector!(glyph)
|
|
101
|
+
cubicus_menu = glyph.menu
|
|
102
|
+
raise "invalid cubicus for glyph!: #{glyph}" if cubicus_menu.nil? ||
|
|
103
|
+
!cubicus_menu.kind_of?(Aro::Dom::Cubicus)
|
|
104
|
+
|
|
105
|
+
action_data = glyph.store.safe_get_key("action_data") || {}
|
|
106
|
+
|
|
107
|
+
raise "invalid action data! #{action_data}" unless action_data.kind_of?(Hash)
|
|
108
|
+
|
|
109
|
+
projector = Aro::Dom::Projector.new(cubicus_menu, glyph, action_data)
|
|
110
|
+
projector.project!
|
|
111
|
+
|
|
112
|
+
Aro::P.less(projector.inspect)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
end
|
data/sys/aro/p.rb
CHANGED
|
@@ -18,17 +18,6 @@ module Aro
|
|
|
18
18
|
def self.say(message)
|
|
19
19
|
super("#{Aro::Dom::Ma_ain.ps1_display || Aro::Mancy.ps1_display}#{normalize_message(message)}")
|
|
20
20
|
end
|
|
21
|
-
|
|
22
|
-
def self.default_select(display_text, options)
|
|
23
|
-
Aro::P.p.select(
|
|
24
|
-
Aro::Dom::Ma_ain.mini_hud_for(display_text),
|
|
25
|
-
options,
|
|
26
|
-
show_help: :always,
|
|
27
|
-
cycle: true,
|
|
28
|
-
per_page: 11
|
|
29
|
-
)
|
|
30
|
-
end
|
|
31
|
-
|
|
32
21
|
end
|
|
33
22
|
end
|
|
34
23
|
|
data/sys/aro/plugins.rb
CHANGED
|
@@ -16,6 +16,8 @@ module Aro
|
|
|
16
16
|
|
|
17
17
|
def self.choose_plugin
|
|
18
18
|
ensure_plugins_dir_exists!
|
|
19
|
+
Aro::P.say(I18n.t("open_menu.plugins.choose_plugin_description"))
|
|
20
|
+
Aro::P.say(I18n.t("open_menu.plugins.choose_plugin_sample_info"))
|
|
19
21
|
|
|
20
22
|
options = [
|
|
21
23
|
{name: :back, value: :back}
|
|
@@ -75,9 +77,9 @@ module Aro
|
|
|
75
77
|
" module Dom",
|
|
76
78
|
" class SamplePlugin",
|
|
77
79
|
" def self.oss_om_start!(plugin_data = {})",
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
80
|
+
" Aro::P.say(self.name)",
|
|
81
|
+
" Aro::P.say(__method__)",
|
|
82
|
+
" Aro::P.say(\"running oss_om sample plugin...\")",
|
|
81
83
|
" plugin_data[\"sample_plugin_key\"] = \"hello_from_oss_om_plugin\"",
|
|
82
84
|
" plugin_data",
|
|
83
85
|
" end",
|
|
@@ -93,9 +95,9 @@ module Aro
|
|
|
93
95
|
[".keep", ""],
|
|
94
96
|
["sample_plugin.rb", sample_plugin_raw]
|
|
95
97
|
].each{|a|
|
|
96
|
-
file_path = ::File.join(plugins_dir, a[Aro::
|
|
98
|
+
file_path = ::File.join(plugins_dir, a[Aro::Mancy::O])
|
|
97
99
|
::File.open(file_path, "w+") {|f|
|
|
98
|
-
f.write(a[Aro::
|
|
100
|
+
f.write(a[Aro::Mancy::S])
|
|
99
101
|
} unless ::File.exist?(file_path)
|
|
100
102
|
}
|
|
101
103
|
end
|
data/sys/aro/settings/cor.rb
CHANGED
|
@@ -333,8 +333,6 @@ module Aro
|
|
|
333
333
|
}
|
|
334
334
|
|
|
335
335
|
def self.open!
|
|
336
|
-
cor_menu = Aro::Dom::DataBase.open_menu(:cor)
|
|
337
|
-
generate_cor_menu_items! if Aro::Mancy::S == cor_menu.menu_items.count
|
|
338
336
|
Aro::Dom::Ma_ain.open!(:cor)
|
|
339
337
|
end
|
|
340
338
|
|
|
@@ -547,28 +545,6 @@ module Aro
|
|
|
547
545
|
|
|
548
546
|
private
|
|
549
547
|
|
|
550
|
-
def self.generate_cor_menu_items!
|
|
551
|
-
cor_menu = Aro::Dom::DataBase.open_menu(:cor)
|
|
552
|
-
return unless Aro::Mancy::S == cor_menu.menu_items.count
|
|
553
|
-
|
|
554
|
-
existing_item = cor_menu.menu_items.first
|
|
555
|
-
raise "missing existing item in #{self.name}.#{__method__}!" if existing_item.nil?
|
|
556
|
-
EXEC_METHODS.each{|method_name|
|
|
557
|
-
menu_item = existing_item || cor_menu.generate_new_item(method_name, for_type: :system)
|
|
558
|
-
|
|
559
|
-
cor_menu.rename_item(menu_item, method_name) unless existing_item.nil?
|
|
560
|
-
menu_item.aro_file.write!(
|
|
561
|
-
Aro::Dom::Store.build_exec_oss_om_params!(
|
|
562
|
-
"#{:cor} #{method_name}",
|
|
563
|
-
self,
|
|
564
|
-
method_name
|
|
565
|
-
)
|
|
566
|
-
)
|
|
567
|
-
# clear existing item var
|
|
568
|
-
existing_item = nil unless existing_item.nil?
|
|
569
|
-
}
|
|
570
|
-
end
|
|
571
|
-
|
|
572
548
|
def write_config(lines)
|
|
573
549
|
File.open(Aro::Cor.cor_filepath, "w+") do |file|
|
|
574
550
|
file.write(lines.join("\n"))
|
data/sys/aro/store.rb
CHANGED
|
@@ -29,16 +29,12 @@ class Aro::Dom::Store
|
|
|
29
29
|
@cache = {} # clear'd
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
-
def self.
|
|
32
|
+
def self.save_file!(aro_file, updates)
|
|
33
33
|
return if aro_file.nil?
|
|
34
34
|
unless ::File.exist?(aro_file.aro_file_path)
|
|
35
35
|
::File.write(aro_file.aro_file_path, {}.to_json)
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
Aro::Dom::Ma_ain.sane_backtrace!
|
|
39
|
-
puts :todo_validate_updates_or_depricate
|
|
40
|
-
puts __method__
|
|
41
|
-
|
|
42
38
|
store_instance = Aro::Dom::Ma_ain.instance.get_store_for(aro_file)
|
|
43
39
|
updates.each{|k, v|
|
|
44
40
|
store_instance.save_key_value_pair(k, v)
|
data/sys/ma_ain.rb
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
module Aro
|
|
14
14
|
module Dom
|
|
15
15
|
class Ma_ain < Aro::Mancy
|
|
16
|
-
|
|
16
|
+
include Singleton
|
|
17
17
|
|
|
18
18
|
# evolution planning
|
|
19
19
|
#
|
|
@@ -32,7 +32,7 @@ module Aro
|
|
|
32
32
|
|
|
33
33
|
EXEC_METHODS = [
|
|
34
34
|
:exec_library!,
|
|
35
|
-
:
|
|
35
|
+
:exec_configuration!,
|
|
36
36
|
:exec_quit!
|
|
37
37
|
]
|
|
38
38
|
|
|
@@ -61,17 +61,16 @@ module Aro
|
|
|
61
61
|
def reign!
|
|
62
62
|
begin
|
|
63
63
|
# default mode is :run
|
|
64
|
-
self.run_mode =
|
|
64
|
+
self.run_mode = 1
|
|
65
65
|
Aro::P.say("Aro::Dom::Oss_OpenMenu.install!")
|
|
66
66
|
if Aro::Dom::Oss_OpenMenu.install!
|
|
67
67
|
Aro::P.say("Aro::Dom::Oss_OpenMenu.boot!")
|
|
68
68
|
Aro::Dom::Oss_OpenMenu.boot!
|
|
69
69
|
else
|
|
70
70
|
Aro::P.say("installation failed. exiting now...")
|
|
71
|
-
|
|
71
|
+
self.class.exec_quit!
|
|
72
72
|
end
|
|
73
73
|
|
|
74
|
-
self.run_mode = !Aro::Cor.is_production? ? Aro::Dom::Ma_ain::O : Aro::Dom::Ma_ain::S
|
|
75
74
|
Aro::P.say("Aro::Dom::Designer.design")
|
|
76
75
|
Aro::Dom::Designer.design
|
|
77
76
|
rescue RuntimeError => e
|
|
@@ -128,7 +127,7 @@ module Aro
|
|
|
128
127
|
cryption_text = "#{UNICODE_KEYS[:unsecure]}#{UNICODE_KEYS[:bang]}"
|
|
129
128
|
end
|
|
130
129
|
|
|
131
|
-
mode_text = Aro::Dom::Ma_ain::RUN_MODES[self.instance.run_mode
|
|
130
|
+
mode_text = Aro::Dom::Ma_ain::RUN_MODES[self.instance.run_mode]
|
|
132
131
|
[
|
|
133
132
|
"(#{cryption_text})[#{mode_text}: ",
|
|
134
133
|
display_text
|
|
@@ -146,7 +145,7 @@ module Aro
|
|
|
146
145
|
data_base = menu.directory.data_base
|
|
147
146
|
raise "invalid data_base!" if data_base.nil?
|
|
148
147
|
|
|
149
|
-
open_menu(menu)
|
|
148
|
+
self.open_menu(menu)
|
|
150
149
|
end
|
|
151
150
|
|
|
152
151
|
def self.open!(data_base = :ma_ain)
|
|
@@ -162,7 +161,7 @@ module Aro
|
|
|
162
161
|
self.instance.valid_security = staged_menu.uuid
|
|
163
162
|
end
|
|
164
163
|
|
|
165
|
-
open_menu(staged_menu)
|
|
164
|
+
self.open_menu(staged_menu)
|
|
166
165
|
end
|
|
167
166
|
|
|
168
167
|
def self.toggle_run_mode
|
|
@@ -170,7 +169,7 @@ module Aro
|
|
|
170
169
|
end
|
|
171
170
|
|
|
172
171
|
def self.running?
|
|
173
|
-
Aro::Dom::Ma_ain::RUN_MODES[self.instance.run_mode
|
|
172
|
+
Aro::Dom::Ma_ain::RUN_MODES[self.instance.run_mode] == :run
|
|
174
173
|
end
|
|
175
174
|
|
|
176
175
|
def self.get_current_options
|
|
@@ -178,12 +177,22 @@ module Aro
|
|
|
178
177
|
|
|
179
178
|
options << {back: :back, value: :back} unless self.instance.current_menu.uuid == self.instance.valid_security
|
|
180
179
|
|
|
181
|
-
|
|
180
|
+
# show open_menu if not running or Aro::Cor ivar is set to false
|
|
181
|
+
hide_preference = Aro::Cor.ivar(:HIDE_F_OSS_OM_MENU).to_s == "true"
|
|
182
|
+
|
|
183
|
+
Aro::D.say("self.running?: #{self.running?}")
|
|
184
|
+
Aro::D.say("will show open_menu: #{hide_preference && !self.running?}")
|
|
185
|
+
|
|
186
|
+
if !hide_preference || !self.running?
|
|
182
187
|
options << {name: "#{UNICODE_KEYS[:integral]}(#{Aro::Mancy::ARO_DIRECTORY})", value: :open_menu}
|
|
183
188
|
end
|
|
184
189
|
|
|
185
|
-
options += self.instance.current_menu.menu_items.select{|mi| mi.user?}.map{|
|
|
186
|
-
|
|
190
|
+
options += self.instance.current_menu.menu_items.select{|mi| mi.user?}.map{|menu_item|
|
|
191
|
+
{name: menu_item.localized_name, value: menu_item.uuid}
|
|
192
|
+
}
|
|
193
|
+
options += self.instance.current_menu.menu_items.select{|mi| mi.system?}.map{|menu_item|
|
|
194
|
+
{name: menu_item.localized_name, value: menu_item.uuid}
|
|
195
|
+
}
|
|
187
196
|
|
|
188
197
|
options
|
|
189
198
|
end
|
|
@@ -192,11 +201,12 @@ module Aro
|
|
|
192
201
|
Aro::Dom::Ma_ain.open!(:library)
|
|
193
202
|
end
|
|
194
203
|
|
|
195
|
-
def self.
|
|
196
|
-
Aro::Dom::Ma_ain.open!(:
|
|
204
|
+
def self.exec_configuration!
|
|
205
|
+
Aro::Dom::Ma_ain.open!(:configuration)
|
|
197
206
|
end
|
|
198
207
|
|
|
199
208
|
def self.exec_quit!
|
|
209
|
+
FDot::Based::Processor.user_exited!
|
|
200
210
|
exit
|
|
201
211
|
end
|
|
202
212
|
|
|
@@ -240,7 +250,7 @@ module Aro
|
|
|
240
250
|
::File.basename(
|
|
241
251
|
action_data[:plugin_file_path.to_s]
|
|
242
252
|
).to_s.downcase.split(".")[
|
|
243
|
-
Aro::
|
|
253
|
+
Aro::Mancy::O
|
|
244
254
|
].split("_").map{|w| w.capitalize}.join("")
|
|
245
255
|
}".constantize
|
|
246
256
|
|
data/sys/reiquire.rb
CHANGED
data/sys/shr/prompt.rb
CHANGED
|
@@ -29,15 +29,26 @@ module Aro
|
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def self.ask(message)
|
|
32
|
-
|
|
32
|
+
FDot::Based.ask(message) {|new_value|
|
|
33
|
+
return new_value
|
|
34
|
+
}
|
|
33
35
|
end
|
|
34
36
|
|
|
35
37
|
def self.say(message)
|
|
36
|
-
|
|
38
|
+
puts normalize_message(message)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def self.default_select(display_text, options)
|
|
42
|
+
FDot::Based.tty_prompt_select(
|
|
43
|
+
Aro::Dom::Ma_ain.mini_hud_for(display_text),
|
|
44
|
+
options
|
|
45
|
+
) {|selected_option|
|
|
46
|
+
return selected_option
|
|
47
|
+
}
|
|
37
48
|
end
|
|
38
49
|
|
|
39
50
|
def self.less(message)
|
|
40
|
-
|
|
51
|
+
FDot::Based.less(message)
|
|
41
52
|
end
|
|
42
53
|
|
|
43
54
|
def self.normalize_message(message)
|
data/sys/shr/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: aro
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- i2097i
|
|
@@ -189,9 +189,28 @@ dependencies:
|
|
|
189
189
|
- - ">="
|
|
190
190
|
- !ruby/object:Gem::Version
|
|
191
191
|
version: 0.5.0
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
192
|
+
- !ruby/object:Gem::Dependency
|
|
193
|
+
name: f_dot
|
|
194
|
+
requirement: !ruby/object:Gem::Requirement
|
|
195
|
+
requirements:
|
|
196
|
+
- - "~>"
|
|
197
|
+
- !ruby/object:Gem::Version
|
|
198
|
+
version: 0.0.2
|
|
199
|
+
- - ">="
|
|
200
|
+
- !ruby/object:Gem::Version
|
|
201
|
+
version: 0.0.2
|
|
202
|
+
type: :runtime
|
|
203
|
+
prerelease: false
|
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
205
|
+
requirements:
|
|
206
|
+
- - "~>"
|
|
207
|
+
- !ruby/object:Gem::Version
|
|
208
|
+
version: 0.0.2
|
|
209
|
+
- - ">="
|
|
210
|
+
- !ruby/object:Gem::Version
|
|
211
|
+
version: 0.0.2
|
|
212
|
+
description: "aro is a unix utility for designing and creating linux applications.\n0.2.9
|
|
213
|
+
release notes: "
|
|
195
214
|
email:
|
|
196
215
|
- i2097i@hotmail.com
|
|
197
216
|
executables:
|
|
@@ -223,6 +242,8 @@ files:
|
|
|
223
242
|
- checksums/aro-0.2.6.gem.sha512
|
|
224
243
|
- checksums/aro-0.2.7.gem.sha512
|
|
225
244
|
- checksums/aro-0.2.8.gem.sha512
|
|
245
|
+
- checksums/aro-0.2.9.gem.sha512
|
|
246
|
+
- craft_docker-compose.template
|
|
226
247
|
- listen.rb
|
|
227
248
|
- locale/en.cor.yml
|
|
228
249
|
- locale/en.menu_items.yml
|
|
@@ -247,15 +268,20 @@ files:
|
|
|
247
268
|
- sys/aro/models/concerns/.keep
|
|
248
269
|
- sys/aro/models/concerns/tar_go_for_root_sec.rb
|
|
249
270
|
- sys/aro/models/concerns/uuid.rb
|
|
271
|
+
- sys/aro/models/cubicus.rb
|
|
250
272
|
- sys/aro/models/data_base.rb
|
|
251
273
|
- sys/aro/models/directory.rb
|
|
252
274
|
- sys/aro/models/file.rb
|
|
275
|
+
- sys/aro/models/glyph.rb
|
|
253
276
|
- sys/aro/models/menu.rb
|
|
254
277
|
- sys/aro/models/menu_item.rb
|
|
278
|
+
- sys/aro/models/objecticus.rb
|
|
279
|
+
- sys/aro/models/perspecticus.rb
|
|
280
|
+
- sys/aro/open_system/projector.rb
|
|
255
281
|
- sys/aro/oss_open_menu.rb
|
|
282
|
+
- sys/aro/oss_open_system.rb
|
|
256
283
|
- sys/aro/p.rb
|
|
257
284
|
- sys/aro/plugins.rb
|
|
258
|
-
- sys/aro/r.rb
|
|
259
285
|
- sys/aro/settings/cor.rb
|
|
260
286
|
- sys/aro/settings/git.rb
|
|
261
287
|
- sys/aro/settings/ssh.rb
|
data/sys/aro/r.rb
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
=begin
|
|
4
|
-
|
|
5
|
-
r.rb
|
|
6
|
-
|
|
7
|
-
r logger for i2097i.
|
|
8
|
-
|
|
9
|
-
by i2097i
|
|
10
|
-
|
|
11
|
-
=end
|
|
12
|
-
|
|
13
|
-
require_relative :"../shr/prompt".to_s
|
|
14
|
-
|
|
15
|
-
module Aro
|
|
16
|
-
class R < Aro::Prompt
|
|
17
|
-
def self.say(message)
|
|
18
|
-
super("#{Aro::Mancy.ps1_display(Aro::R.name)} #{normalize_message(message)}")
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
|