aro 0.2.3 → 0.2.5
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 +101 -42
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/aro.gemspec +10 -10
- data/bin/aro +8 -12
- data/bin/ino +22 -0
- data/checksums/aro-0.2.4.gem.sha512 +1 -0
- data/ino_rules_todo.txt +28 -0
- data/locale/en.abot.yml +15 -15
- data/locale/en.amg.yml +7 -7
- data/locale/en.aos.yml +7 -7
- data/locale/en.cards.yml +360 -313
- data/locale/en.data.yml +1 -1
- data/locale/en.dom.yml +3 -2
- data/locale/en.flie.yml +1 -1
- data/locale/en.ino.yml +9 -0
- data/locale/en.usage.yml +152 -69
- data/locale/en.yml +5 -3
- data/sys/aos/abot.rb +18 -20
- data/sys/aos/aos.rb +60 -48
- data/sys/aos/cor.rb +11 -14
- data/sys/aos/db.rb +1 -3
- data/sys/aos/models/agodo.rb +9 -2
- data/sys/aos/models/fpxy.rb +0 -2
- data/sys/aos/models/ilib.rb +0 -2
- data/sys/aos/models/ilog.rb +0 -2
- data/sys/aos/models/you.rb +46 -6
- data/sys/aos/vws/base.rb +13 -14
- data/sys/aos/vws/games/ino.rb +21 -0
- data/sys/aos/vws/games/teck.rb +19 -17
- data/sys/aos/vws/welcome.rb +1 -1
- data/sys/aro/db/migrate/1768856981_create_scrolls.rb +20 -0
- data/sys/aro/db/migrate/1768858841_create_legends.rb +16 -0
- data/sys/aro/db/migrate/1768858967_create_stories.rb +17 -0
- data/sys/aro/db/migrate/1768859060_create_chapters.rb +15 -0
- data/sys/aro/db/migrate/1768859126_create_statements.rb +22 -0
- data/sys/aro/db/migrate/1768859144_create_players.rb +18 -0
- data/sys/aro/db.rb +3 -5
- data/sys/aro/ino.rb +64 -0
- data/sys/aro/models/chapter.rb +18 -0
- data/sys/aro/models/legend.rb +28 -0
- data/sys/aro/models/player.rb +17 -0
- data/sys/aro/models/scroll.rb +46 -0
- data/sys/aro/models/statement.rb +14 -0
- data/sys/aro/models/story.rb +28 -0
- data/sys/aro/models/teck.rb +44 -13
- data/sys/cli/create.rb +1 -1
- data/sys/cli/dom.rb +2 -2
- data/sys/cli/nterface.rb +15 -9
- data/sys/cli/teck.rb +4 -6
- data/sys/cli/usage.rb +15 -1
- data/sys/dom/dom.rb +6 -2
- data/sys/fpx.rb +25 -37
- data/sys/shr/ilib/crs/crs.o +0 -0
- data/sys/shr/ilib/crs/libcrs.so +0 -0
- data/sys/shr/t.rb +2 -2
- data/sys/shr/version.rb +1 -1
- metadata +38 -22
- data/.ruby-version +0 -1
- data/sys/aos/models/base_model.rb +0 -13
- data/sys/aro/models/base_model.rb +0 -13
data/locale/en.data.yml
CHANGED
data/locale/en.dom.yml
CHANGED
|
@@ -38,9 +38,10 @@ en:
|
|
|
38
38
|
messages:
|
|
39
39
|
arodome_created: "%{name} arodome created. enter the following commands to begin: $ cd %{name}"
|
|
40
40
|
creating_arodome: "creating arodome named %{name}"
|
|
41
|
+
generating_agodo_home: "generating agodo home for %{name}..."
|
|
41
42
|
generating_wings: "generating wings..."
|
|
42
43
|
generating_wing: "generating the %{wing} wing..."
|
|
43
44
|
generating_room: "generating the %{room} room."
|
|
44
45
|
initialization_complete: "%{name} initialization complete! use aos to begin."
|
|
45
|
-
missing_root_username: "missing
|
|
46
|
-
missing_root_password: "missing
|
|
46
|
+
missing_root_username: "missing var_root_username argument."
|
|
47
|
+
missing_root_password: "missing var_root_password argument."
|
data/locale/en.flie.yml
CHANGED
data/locale/en.ino.yml
ADDED
data/locale/en.usage.yml
CHANGED
|
@@ -1,23 +1,115 @@
|
|
|
1
1
|
en:
|
|
2
2
|
usage:
|
|
3
|
+
dom: |
|
|
4
|
+
aro dom
|
|
5
|
+
aos arodome management.
|
|
6
|
+
|
|
7
|
+
$ aro dom var_command
|
|
8
|
+
|
|
9
|
+
quickstart or tldr;
|
|
10
|
+
|
|
11
|
+
$ aro dom new var_name && cd var_name && aro dom init var_root_username var_root_password
|
|
12
|
+
|
|
13
|
+
COMMANDS
|
|
14
|
+
init
|
|
15
|
+
initialize and generate the arodome.
|
|
16
|
+
run once from the dom base directory.
|
|
17
|
+
|
|
18
|
+
params:
|
|
19
|
+
var_root_username: root aos username.
|
|
20
|
+
var_root_password: root aos password.
|
|
21
|
+
|
|
22
|
+
usage:
|
|
23
|
+
|
|
24
|
+
$ aro dom init var_root_username var_root_password
|
|
25
|
+
|
|
26
|
+
new
|
|
27
|
+
create a new arodome with the specified name.
|
|
28
|
+
|
|
29
|
+
example:
|
|
30
|
+
|
|
31
|
+
$ aro dom new var_name
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
aro by i2097i is copyright (2026)
|
|
35
|
+
ino: |
|
|
36
|
+
SUMMARY
|
|
37
|
+
|
|
38
|
+
ino is a card game for tarot.
|
|
39
|
+
|
|
40
|
+
quickstart or tldr;
|
|
41
|
+
|
|
42
|
+
$ ino create var_name && ino
|
|
43
|
+
|
|
44
|
+
COMMANDS
|
|
45
|
+
create
|
|
46
|
+
create a new game of ino.
|
|
47
|
+
|
|
48
|
+
example:
|
|
49
|
+
|
|
50
|
+
$ ino create var_name
|
|
51
|
+
|
|
52
|
+
RULES
|
|
53
|
+
|
|
54
|
+
scoring
|
|
55
|
+
points description
|
|
56
|
+
|
|
57
|
+
1 total cards
|
|
58
|
+
1 total trumps
|
|
59
|
+
1 total swords
|
|
60
|
+
1 total wands
|
|
61
|
+
1 total face cards
|
|
62
|
+
1 10 of cups
|
|
63
|
+
1 10 of pentacles
|
|
64
|
+
4 aces
|
|
65
|
+
+___________________________
|
|
66
|
+
11 total points
|
|
67
|
+
|
|
68
|
+
terms
|
|
69
|
+
chapter
|
|
70
|
+
a component round of a story (2 player is 11 cards each).
|
|
71
|
+
statement
|
|
72
|
+
1 or more thought cards and a final word card.
|
|
73
|
+
word
|
|
74
|
+
a card that must be produced by a player to close a statement.
|
|
75
|
+
legend
|
|
76
|
+
a series of stories played in succession to an agreed upon score.
|
|
77
|
+
scroll
|
|
78
|
+
the open play arena where cards can be used to construct inos.
|
|
79
|
+
story
|
|
80
|
+
one full ino playthrough of the entire deck.
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
gameplay
|
|
84
|
+
todo:
|
|
85
|
+
|
|
86
|
+
aro by i2097i is copyright (2026)
|
|
3
87
|
main: |
|
|
4
|
-
|
|
88
|
+
SUMMARY
|
|
5
89
|
|
|
6
|
-
aro
|
|
90
|
+
aro is a cli for tarot. it includes three command-line executables.
|
|
91
|
+
|
|
92
|
+
1) aro
|
|
93
|
+
2) aos
|
|
94
|
+
3) ino
|
|
7
95
|
|
|
8
96
|
SYNOPSIS
|
|
9
97
|
|
|
10
|
-
aro [-v | --version] [-h | --help]
|
|
98
|
+
aro [-v | --version] [-h | --help] [(+|-)(T|C|S|P|W)(var_numeral)] var_command
|
|
11
99
|
|
|
12
|
-
|
|
100
|
+
quickstart or tldr; example:
|
|
101
|
+
|
|
102
|
+
$ aro create var_name && cd var_name && aro teck new var_teck_name && aro
|
|
103
|
+
|
|
104
|
+
card lookup example:
|
|
13
105
|
|
|
14
|
-
|
|
106
|
+
$ aro +TXXI
|
|
15
107
|
|
|
16
108
|
COMMANDS
|
|
17
109
|
create
|
|
18
|
-
create and init an aro space named
|
|
110
|
+
create and init an aro space named var_name:
|
|
19
111
|
|
|
20
|
-
$ aro create
|
|
112
|
+
$ aro create var_name
|
|
21
113
|
|
|
22
114
|
init
|
|
23
115
|
sets up the .aro directory that contains database and cor
|
|
@@ -28,109 +120,100 @@ en:
|
|
|
28
120
|
cor
|
|
29
121
|
aro cor management.
|
|
30
122
|
|
|
31
|
-
$ aro cor
|
|
123
|
+
$ aro cor var_name var_value
|
|
32
124
|
|
|
33
125
|
basic usage:
|
|
34
126
|
|
|
35
|
-
|
|
36
|
-
print the cor.
|
|
127
|
+
no params prints the cor.
|
|
37
128
|
|
|
38
129
|
$ aro cor
|
|
39
130
|
|
|
40
|
-
|
|
41
|
-
print the var named <var_name>.
|
|
131
|
+
param var_name prints the var named var_name.
|
|
42
132
|
|
|
43
|
-
$ aro cor
|
|
133
|
+
$ aro cor var_name
|
|
44
134
|
|
|
45
|
-
|
|
46
|
-
update a var named <var_name> with <var_value>.
|
|
135
|
+
param var_name & param var_value updates a var named var_name with var_value.
|
|
47
136
|
|
|
48
|
-
$ aro cor
|
|
137
|
+
$ aro cor var_name var_value
|
|
49
138
|
|
|
50
139
|
teck
|
|
51
|
-
|
|
140
|
+
aro teck commands.
|
|
52
141
|
|
|
53
|
-
$ aro teck
|
|
142
|
+
$ aro teck [-h | --help]
|
|
54
143
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
note:
|
|
58
|
-
|
|
59
|
-
teck subcommands do not require typing 'teck'. for example,
|
|
60
|
-
|
|
61
|
-
$ aro teck show
|
|
144
|
+
dom
|
|
145
|
+
aos arodome management.
|
|
62
146
|
|
|
63
|
-
|
|
147
|
+
$ aro dom [-h | --help]
|
|
64
148
|
|
|
65
|
-
$ aro show
|
|
66
149
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
150
|
+
aro by i2097i is copyright (2026)
|
|
151
|
+
teck: |
|
|
152
|
+
aro teck
|
|
153
|
+
manage tecks in the aro space.
|
|
70
154
|
|
|
71
|
-
|
|
72
|
-
allows user to browse each card in the current teck.
|
|
155
|
+
$ aro teck var_command
|
|
73
156
|
|
|
74
|
-
|
|
75
|
-
create a new teck with the specified name.
|
|
157
|
+
passing no params opens the selection menu.
|
|
76
158
|
|
|
77
|
-
|
|
159
|
+
note:
|
|
78
160
|
|
|
79
|
-
|
|
161
|
+
teck subcommands do not require typing 'teck'. for example,
|
|
80
162
|
|
|
81
|
-
|
|
82
|
-
replaces all drawn cards FIFO and puts them on the bottom of
|
|
83
|
-
the teck. this will preserve all card orientations.
|
|
163
|
+
$ aro teck show
|
|
84
164
|
|
|
85
|
-
|
|
86
|
-
completely reset the teck. replace all drawn and reset order.
|
|
87
|
-
all orientations will be set to upright. you must enter 'aroyes'
|
|
88
|
-
to continue.
|
|
165
|
+
is the same thing as:
|
|
89
166
|
|
|
90
|
-
|
|
91
|
-
displays the current teck's log record(s).
|
|
167
|
+
$ aro show
|
|
92
168
|
|
|
93
|
-
|
|
169
|
+
COMMANDS
|
|
170
|
+
draw
|
|
171
|
+
draw a random card from the current teck.
|
|
94
172
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
'less' is automatically used to view text output log count > 1
|
|
173
|
+
explore
|
|
174
|
+
allows user to browse each card in the current teck.
|
|
98
175
|
|
|
99
|
-
|
|
176
|
+
new
|
|
177
|
+
create a new teck with the specified name.
|
|
100
178
|
|
|
101
|
-
|
|
179
|
+
example:
|
|
102
180
|
|
|
103
|
-
|
|
181
|
+
$ aro teck new var_name
|
|
104
182
|
|
|
105
|
-
|
|
183
|
+
replace
|
|
184
|
+
replaces all drawn cards FIFO and puts them on the bottom of
|
|
185
|
+
the teck. this will preserve all card orientations.
|
|
106
186
|
|
|
107
|
-
|
|
187
|
+
reset
|
|
188
|
+
completely reset the teck. replace all drawn and reset order.
|
|
189
|
+
all orientations will be set to upright. you must enter 'aroyes'
|
|
190
|
+
to continue.
|
|
108
191
|
|
|
109
|
-
|
|
192
|
+
show
|
|
193
|
+
displays the current teck's log record(s).
|
|
110
194
|
|
|
111
|
-
|
|
195
|
+
the default behavior is to display only the most recent log record.
|
|
112
196
|
|
|
113
|
-
|
|
114
|
-
shuffles the current teck and generates a log record.
|
|
197
|
+
note:
|
|
115
198
|
|
|
116
|
-
|
|
117
|
-
aos arodome management.
|
|
199
|
+
'less' is automatically used to view text output log count > 1
|
|
118
200
|
|
|
119
|
-
|
|
201
|
+
OPTIONS
|
|
120
202
|
|
|
121
|
-
|
|
122
|
-
init <username> <password>
|
|
123
|
-
generate the arodome
|
|
124
|
-
new
|
|
125
|
-
create a new arodome with the specified name.
|
|
203
|
+
[-n | --count] specify number of teck tlogs to show.
|
|
126
204
|
|
|
127
|
-
|
|
205
|
+
default is 1 (latest/current state)
|
|
128
206
|
|
|
129
|
-
|
|
207
|
+
passing 'all' display all tlogs
|
|
130
208
|
|
|
209
|
+
[-o | --order] specify the output order of the log records.
|
|
131
210
|
|
|
211
|
+
default is 'desc'
|
|
132
212
|
|
|
213
|
+
possible values: ['asc', 'desc']
|
|
133
214
|
|
|
215
|
+
shuffle
|
|
216
|
+
shuffles the current teck and generates a log record.
|
|
134
217
|
|
|
135
218
|
|
|
136
|
-
aro by i2097i is copyright (
|
|
219
|
+
aro by i2097i is copyright (2026)
|
data/locale/en.yml
CHANGED
|
@@ -8,10 +8,11 @@ en:
|
|
|
8
8
|
header: "%{cmd} says there was a problem."
|
|
9
9
|
invalid_usage: "%{cmd} says you're not supposed to be here."
|
|
10
10
|
missing_args: "%{cmd} says missing required argument(s)."
|
|
11
|
-
missing_teck: "%{cmd} says no teck selected. use 'aro teck' to select one or 'aro teck new
|
|
11
|
+
missing_teck: "%{cmd} says no teck selected. use 'aro teck' to select one or 'aro teck new var_name' to create one."
|
|
12
|
+
not_found: "%{cmd} not found."
|
|
12
13
|
not_in_aro: "%{cmd} says you are not in aro space. that command will not work here."
|
|
13
14
|
not_in_aos: "%{cmd} says you are not in aos space. that command will not work here."
|
|
14
|
-
not_initialized_dom: "%{cmd} says you need to initialize dom. $ aro dom init
|
|
15
|
+
not_initialized_dom: "%{cmd} says you need to initialize dom. $ aro dom init var_root_username var_root_password"
|
|
15
16
|
not_initialized: "%{cmd} says you need to initialize aro. run 'aro init' to do so"
|
|
16
17
|
warnings:
|
|
17
18
|
invalid_order: "the order specified for displaying tlogs in invalid. using default (desc)."
|
|
@@ -44,9 +45,10 @@ en:
|
|
|
44
45
|
|
|
45
46
|
use the following command to create one:
|
|
46
47
|
|
|
47
|
-
$ aro teck new
|
|
48
|
+
$ aro teck new var_name
|
|
48
49
|
|
|
49
50
|
see aro --help for usage.
|
|
51
|
+
printing_card: "printing %{card}..."
|
|
50
52
|
showing: "showing %{name} [count:%{count}, order:%{order}]..."
|
|
51
53
|
shuffling: "shuffling %{name}'s cards..."
|
|
52
54
|
replacing_drawn: "replacing all drawn cards to %{name}..."
|
data/sys/aos/abot.rb
CHANGED
|
@@ -14,6 +14,8 @@ module Aos
|
|
|
14
14
|
|
|
15
15
|
attr_accessor :display_lines
|
|
16
16
|
|
|
17
|
+
AGODOS_DIR = :".agodos"
|
|
18
|
+
|
|
17
19
|
CMDS = {
|
|
18
20
|
AGODO: {
|
|
19
21
|
key: :agodo,
|
|
@@ -48,9 +50,8 @@ module Aos
|
|
|
48
50
|
end
|
|
49
51
|
|
|
50
52
|
def self.cron
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return if not_currently_enabled || File.exist?(Aos::Abot.cron_pid_file)
|
|
53
|
+
Aos::Os.say("here")
|
|
54
|
+
return if File.exist?(Aos::Abot.cron_pid_file)
|
|
54
55
|
|
|
55
56
|
abot_pid = fork {
|
|
56
57
|
log = File.open(File.join(Aro::Dom.dom_root, Aro::Dom.room_path(:abot), "abot.log"), "w+")
|
|
@@ -78,12 +79,11 @@ module Aos
|
|
|
78
79
|
end
|
|
79
80
|
|
|
80
81
|
def self.process_cmd(args)
|
|
81
|
-
|
|
82
|
+
args = Aos::Os.sanitize_you(args)
|
|
83
|
+
if args[Aro::Mancy::S].nil? ||
|
|
84
|
+
CLI::FLAGS[:HELP].include?(args[Aro::Mancy::S].to_sym)
|
|
82
85
|
Aos::Abot.abot
|
|
83
86
|
return true
|
|
84
|
-
elsif CLI::FLAGS[:HELP].include?(args[Aro::Mancy::S].to_sym)
|
|
85
|
-
self.instance.display_lines = [I18n.t("abot.usage")]
|
|
86
|
-
return true
|
|
87
87
|
end
|
|
88
88
|
|
|
89
89
|
processed = false
|
|
@@ -118,6 +118,7 @@ module Aos
|
|
|
118
118
|
|
|
119
119
|
# create and list agodos
|
|
120
120
|
def self.agodo(args)
|
|
121
|
+
args = Aos::Os.sanitize_you(args)
|
|
121
122
|
if args[Aro::Mancy::OS].nil?
|
|
122
123
|
# list agodos
|
|
123
124
|
self.instance.display_lines = Aos::Abot.agodo_lines
|
|
@@ -128,7 +129,7 @@ module Aos
|
|
|
128
129
|
!args[Aro::Mancy::E].nil? &&
|
|
129
130
|
!args[Aro::Mancy::N].nil?
|
|
130
131
|
# create mode
|
|
131
|
-
# abot agodo
|
|
132
|
+
# abot agodo var_go var_do var_rate
|
|
132
133
|
arg_go = args[Aro::Mancy::OS]
|
|
133
134
|
arg_do = args[Aro::Mancy::E]
|
|
134
135
|
arg_rate = args[Aro::Mancy::N]
|
|
@@ -138,10 +139,9 @@ module Aos
|
|
|
138
139
|
agodo_record.do = arg_do
|
|
139
140
|
agodo_record.rate = arg_rate
|
|
140
141
|
if agodo_record.save
|
|
141
|
-
self.instance.display_lines
|
|
142
|
-
self.instance.display_lines += Aos::Abot.agodo_lines
|
|
142
|
+
self.instance.display_lines = ["successfully created an agodo named #{agodo_record.you.name}."] + Aos::Abot.agodo_lines
|
|
143
143
|
else
|
|
144
|
-
self.instance.display_lines
|
|
144
|
+
self.instance.display_lines = agodo_record.errors.to_a.map(&:downcase)
|
|
145
145
|
end
|
|
146
146
|
else
|
|
147
147
|
self.instance.display_lines = [I18n.t("abot.messages.invalid_agodo_cmd")]
|
|
@@ -158,8 +158,7 @@ module Aos
|
|
|
158
158
|
Aos::Cor.int_valid?(args[Aro::Mancy::E]&.to_i)
|
|
159
159
|
agodo_record = agodo_you.agodo
|
|
160
160
|
agodo_record.update(rate: args[Aro::Mancy::E].to_i)
|
|
161
|
-
self.instance.display_lines
|
|
162
|
-
self.instance.display_lines += Aos::Abot.agodo_lines
|
|
161
|
+
self.instance.display_lines = ["#{agodo_record.you.name} rate updated."] + Aos::Abot.agodo_lines
|
|
163
162
|
else
|
|
164
163
|
self.instance.display_lines = [I18n.t("abot.messages.invalid_agodo_cmd")]
|
|
165
164
|
end
|
|
@@ -170,17 +169,18 @@ module Aos
|
|
|
170
169
|
n = agodo_name&.strip&.upcase
|
|
171
170
|
agodo_you = Aos::You.find_by(name: n)
|
|
172
171
|
unless agodo_you.nil?
|
|
173
|
-
|
|
172
|
+
lines = ["derezing #{agodo_you.name} agodo."]
|
|
174
173
|
agodo_record = agodo_you.agodo
|
|
175
174
|
agodo_record&.destroy
|
|
176
175
|
agodo_you.ilogs.destroy_all
|
|
177
176
|
agodo_you.destroy
|
|
178
177
|
requery = Aos::You.find_by(name: n)
|
|
179
178
|
if requery.nil? && requery&.agodo.nil?
|
|
180
|
-
|
|
179
|
+
lines << "successfully destroyed #{n} agodo."
|
|
181
180
|
else
|
|
182
|
-
|
|
181
|
+
lines << "unable to destroyed the #{n} agodo."
|
|
183
182
|
end
|
|
183
|
+
self.instance.display_lines = lines
|
|
184
184
|
else
|
|
185
185
|
self.instance.display_lines = [I18n.t("abot.messages.invalid_agodo_cmd")]
|
|
186
186
|
end
|
|
@@ -194,8 +194,7 @@ module Aos
|
|
|
194
194
|
unless agodo_you.nil?
|
|
195
195
|
agodo_record = agodo_you.agodo
|
|
196
196
|
agodo_record.update(power: :off)
|
|
197
|
-
self.instance.display_lines
|
|
198
|
-
self.instance.display_lines += Aos::Abot.agodo_lines
|
|
197
|
+
self.instance.display_lines = ["#{agodo_record.you.name} stopped."] + Aos::Abot.agodo_lines
|
|
199
198
|
else
|
|
200
199
|
self.instance.display_lines = [I18n.t("abot.messages.invalid_agodo_cmd")]
|
|
201
200
|
end
|
|
@@ -210,8 +209,7 @@ module Aos
|
|
|
210
209
|
agodo_record = agodo_you.agodo
|
|
211
210
|
agodo_record.update(power: :on)
|
|
212
211
|
|
|
213
|
-
self.instance.display_lines
|
|
214
|
-
self.instance.display_lines += Aos::Abot.agodo_lines
|
|
212
|
+
self.instance.display_lines = ["#{agodo_record.you.name} started."] + Aos::Abot.agodo_lines
|
|
215
213
|
else
|
|
216
214
|
self.instance.display_lines = [I18n.t("abot.messages.invalid_agodo_cmd")]
|
|
217
215
|
end
|
data/sys/aos/aos.rb
CHANGED
|
@@ -196,6 +196,17 @@ module Aos
|
|
|
196
196
|
Aro::V.say("you loaded:\n#{caller[Aro::Mancy::O..Aro::Mancy::N].join("\n")}")
|
|
197
197
|
Aro::V.say(self.you.name)
|
|
198
198
|
Aro::V.say(Aos::Os.osify(self.you.pwd))
|
|
199
|
+
self.you.history.each{|h| Readline::HISTORY.push(h)}
|
|
200
|
+
end
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
def self.configure_aro_cli
|
|
204
|
+
Aro::V.say(ARGV)
|
|
205
|
+
if ARGV.include?(Aos::Os::YOU_FLAG)
|
|
206
|
+
Aos::Db.load
|
|
207
|
+
yfi = ARGV.index(Aos::Os::YOU_FLAG)
|
|
208
|
+
Aos::Os.instance.you = Aos::You.find_by(name: ARGV[yfi + Aro::Mancy::S]&.strip)
|
|
209
|
+
Aos::Os.instance.you_flag = Aos::You.find_by(name: ARGV[yfi + Aro::Mancy::S]&.strip)
|
|
199
210
|
end
|
|
200
211
|
end
|
|
201
212
|
|
|
@@ -240,9 +251,9 @@ module Aos
|
|
|
240
251
|
return if @view.nil?
|
|
241
252
|
|
|
242
253
|
Dir.chdir(self.you.reload.pwd) do
|
|
243
|
-
if Aro::Mancy.in_aro?
|
|
244
|
-
Aro::Mancy.init
|
|
254
|
+
if Aro::Mancy.in_aro? && !Aos::Os.osify(self.you.pwd).include?(Aro::Dom.room_path(:abot))
|
|
245
255
|
if Aro::Mancy.is_initialized? && !Aro::Mancy.teck.nil?
|
|
256
|
+
Aro::Mancy.init
|
|
246
257
|
Aro::Mancy.teck.show
|
|
247
258
|
end
|
|
248
259
|
else
|
|
@@ -268,7 +279,7 @@ module Aos
|
|
|
268
279
|
if current_you.nil?
|
|
269
280
|
Aos::S.say(lines.join("\n"))
|
|
270
281
|
else
|
|
271
|
-
|
|
282
|
+
Mutex.new.synchronize do
|
|
272
283
|
Aos::Os.instance.q ||= {}
|
|
273
284
|
Aos::Os.q[current_you.name] ||= []
|
|
274
285
|
Aos::Os.q[current_you.name] += lines
|
|
@@ -284,7 +295,7 @@ module Aos
|
|
|
284
295
|
Aos::Os.q.delete(you_name)
|
|
285
296
|
)
|
|
286
297
|
}
|
|
287
|
-
|
|
298
|
+
end
|
|
288
299
|
end
|
|
289
300
|
end
|
|
290
301
|
end
|
|
@@ -359,7 +370,8 @@ module Aos
|
|
|
359
370
|
# end
|
|
360
371
|
|
|
361
372
|
def handle_aro_override(args)
|
|
362
|
-
return nil unless args[
|
|
373
|
+
return nil unless !args[Aro::Mancy::O].nil? &&
|
|
374
|
+
[:aro, :ino].include?(args[Aro::Mancy::O].to_sym)
|
|
363
375
|
# !self.you_flag.nil?
|
|
364
376
|
yfi = args.index(Aos::Os::YOU_FLAG)
|
|
365
377
|
if yfi.nil?
|
|
@@ -371,49 +383,45 @@ module Aos
|
|
|
371
383
|
`#{args.join(" ")}`
|
|
372
384
|
end
|
|
373
385
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
386
|
+
Mutex.new.synchronize do
|
|
387
|
+
def process_cmd(cmd)
|
|
388
|
+
Aos::Cor.instance.cor_path = nil
|
|
389
|
+
Aos::Cor.instance.load
|
|
390
|
+
Dir.chdir(self.you.reload.pwd) do
|
|
391
|
+
self.you.add_history(cmd) unless cmd.nil?
|
|
392
|
+
send_to_system_call = main(cmd)
|
|
393
|
+
nothing = nil
|
|
394
|
+
unless cmd.nil? || cmd.empty?
|
|
395
|
+
nothing = handle_aro_override(cmd.split(" "))
|
|
396
|
+
self.you.generate_ilog(cmd)
|
|
397
|
+
end
|
|
398
|
+
if send_to_system_call && nothing.nil?
|
|
399
|
+
begin
|
|
400
|
+
Aos::Os.say(`#{cmd}`)
|
|
401
|
+
rescue => e
|
|
402
|
+
Aos::Os.say(e)
|
|
403
|
+
end
|
|
404
|
+
elsif !nothing.nil?
|
|
405
|
+
Aos::Os.say(nothing)
|
|
406
|
+
end
|
|
388
407
|
|
|
389
|
-
|
|
390
|
-
Aos::Os.say(nothing)
|
|
391
|
-
else
|
|
392
|
-
render
|
|
408
|
+
render unless send_to_system_call
|
|
393
409
|
end
|
|
410
|
+
|
|
411
|
+
CLI::EXIT_CODES[:SUCCESS]
|
|
394
412
|
end
|
|
413
|
+
end
|
|
395
414
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
# Aro::V.say(dir_matcher)
|
|
407
|
-
dir_listing = Dir.glob(dir_matcher, File::FNM_DOTMATCH).map{|d| Aos::Os.osify(d).split("/").reject{|p| pwd.include?(p)}.join("/")}
|
|
408
|
-
# Aro::V.say(dir_listing)
|
|
409
|
-
dir_listing.grep(/^#{Regexp.escape(str)}/)
|
|
410
|
-
}
|
|
411
|
-
# when :aos
|
|
412
|
-
# Readline.completion_append_character = "/"
|
|
413
|
-
# Readline.completion_proc = Proc.new{|str|
|
|
414
|
-
# Aro::Dom::D.reserved_words.grep(/^#{Regexp.escape(str)}/)
|
|
415
|
-
# }
|
|
416
|
-
# end
|
|
415
|
+
def configure_readline
|
|
416
|
+
Readline.completion_append_character = "/"
|
|
417
|
+
Readline.completion_proc = Proc.new{|str|
|
|
418
|
+
pwd = self.you_flag&.reload&.pwd || self.you&.reload&.pwd || ""
|
|
419
|
+
dir_matcher = File.join(pwd, str + Aos::Os::STAR.to_s)
|
|
420
|
+
# Aro::V.say(dir_matcher)
|
|
421
|
+
dir_listing = Dir.glob(dir_matcher, File::FNM_DOTMATCH).map{|d| Aos::Os.osify(d).split("/").reject{|p| pwd.include?(p)}.join("/")}
|
|
422
|
+
# Aro::V.say(dir_listing)
|
|
423
|
+
dir_listing.grep(/^#{Regexp.escape(str)}/)
|
|
424
|
+
}
|
|
417
425
|
end
|
|
418
426
|
|
|
419
427
|
Mutex.new.synchronize do
|
|
@@ -429,14 +437,15 @@ module Aos
|
|
|
429
437
|
cmd = nil
|
|
430
438
|
|
|
431
439
|
loop do
|
|
432
|
-
configure_readline :aos
|
|
433
|
-
break unless self.running && cmd = Readline.readline(calc_ps1)
|
|
434
|
-
IO.console.erase_screen(Aro::Mancy::S)
|
|
435
440
|
height, width = IO.console.winsize
|
|
436
441
|
IO.console.goto(height, Aro::Mancy::O)
|
|
437
442
|
process_cmd(cmd)
|
|
443
|
+
break unless self.running && cmd = Readline.readline(calc_ps1, true)
|
|
444
|
+
IO.console.erase_screen(Aro::Mancy::S)
|
|
445
|
+
configure_readline
|
|
438
446
|
end
|
|
439
447
|
|
|
448
|
+
|
|
440
449
|
out
|
|
441
450
|
end
|
|
442
451
|
|
|
@@ -546,12 +555,15 @@ module Aos
|
|
|
546
555
|
self.you.home!
|
|
547
556
|
else
|
|
548
557
|
room_path = Aro::Dom.room_path(arg)
|
|
558
|
+
Aro::D.say("#{__method__}#{Aos::Os::A}room_path: #{room_path}")
|
|
549
559
|
if !self.you.root? &&
|
|
550
560
|
room_path.include?(Aro::Dom::ROOT.to_s)
|
|
561
|
+
Aro::D.say("#{__method__}#{Aos::Os::A}invalid")
|
|
551
562
|
self.display_lines = ["invalid access to #{room_path}. doing nothing."]
|
|
552
563
|
elsif !room_path.empty?
|
|
553
564
|
handled = true
|
|
554
565
|
if room_path == Aro::Dom::HOME.to_s
|
|
566
|
+
Aro::D.say("#{__method__}#{Aos::Os::A}home!")
|
|
555
567
|
self.you.home!
|
|
556
568
|
else
|
|
557
569
|
Aro::D.say("#{__method__}#{Aos::Os::A}#{room_path}")
|
|
@@ -601,7 +613,7 @@ module Aos
|
|
|
601
613
|
Aos::Os.say(["#{Aos::Os} is exiting..."])
|
|
602
614
|
begin
|
|
603
615
|
Aos::Abot.terminate
|
|
604
|
-
Aos::Os.terminateq
|
|
616
|
+
# Aos::Os.terminateq
|
|
605
617
|
rescue StandardError => e
|
|
606
618
|
Aro::D.say(e)
|
|
607
619
|
end
|