aro 0.2.0 → 0.2.2
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/.gitignore +1 -0
- data/Gemfile.lock +3 -2
- data/README.md +1 -1
- data/aro.gemspec +1 -0
- data/bin/aos +2 -2
- data/bin/aro +4 -4
- data/checksums/aro-0.2.1.gem.sha512 +1 -0
- data/checksums/aro-0.2.2.gem.sha512 +1 -0
- data/listen.rb +1 -1
- data/locale/en.amg.yml +44 -0
- data/locale/en.aos.yml +13 -8
- data/locale/en.data.yml +30 -0
- data/locale/en.dom.yml +10 -8
- data/locale/en.usage.yml +22 -22
- data/locale/en.yml +16 -11
- data/sys/aos/amg.rb +184 -0
- data/sys/aos/aos.rb +203 -89
- data/sys/aos/data.rb +117 -0
- data/{db → sys/aos/db}/migrate/1765148774_create_yous.rb +1 -0
- data/sys/aos/db/migrate/1765762724_create_ilibs.rb +22 -0
- data/sys/aos/db/migrate/1765907766_create_ilogs.rb +18 -0
- data/sys/aos/db.rb +44 -25
- data/sys/aos/models/ilib.rb +46 -0
- data/sys/aos/models/ilog.rb +27 -0
- data/sys/aos/models/you.rb +50 -0
- data/sys/aos/vws/base.rb +120 -0
- data/sys/aos/{views → vws}/dom.rb +6 -10
- data/sys/aos/vws/games/abpps.rb +19 -0
- data/sys/aos/{views → vws}/games/game.rb +26 -25
- data/sys/aos/vws/games/hbpps.rb +19 -0
- data/sys/aos/vws/games/shpps.rb +19 -0
- data/sys/aos/vws/games/vipps.rb +19 -0
- data/sys/aos/{views → vws}/games.rb +3 -3
- data/sys/aos/vws/know/body.rb +19 -0
- data/sys/aos/vws/know/mind.rb +19 -0
- data/sys/aos/vws/know/spirit.rb +19 -0
- data/sys/aos/{views → vws}/know.rb +3 -3
- data/sys/aos/vws/root/amg.rb +21 -0
- data/sys/aos/vws/root/config.rb +21 -0
- data/sys/aos/vws/root/data.rb +21 -0
- data/sys/aos/{views/setup.rb → vws/root.rb} +4 -4
- data/sys/aos/vws/welcome/waite.rb +31 -0
- data/sys/aos/{views → vws}/welcome/winner.rb +3 -3
- data/sys/aos/vws/welcome.rb +30 -0
- data/{db/migrate/1763374647_create_decks.rb → sys/aro/db/migrate/1763374647_create_tecks.rb} +5 -5
- data/sys/aro/db/migrate/1763432541_create_tlogs.rb +20 -0
- data/sys/aro/db.rb +16 -15
- data/sys/aro/mancy.rb +4 -3
- data/sys/{models/deck.rb → aro/models/teck.rb} +56 -62
- data/sys/aro/models/tlog.rb +20 -0
- data/sys/aro/v.rb +1 -1
- data/sys/cli/constants.rb +1 -1
- data/sys/cli/dom.rb +1 -1
- data/sys/cli/{deck.rb → teck.rb} +20 -15
- data/sys/cli.rb +12 -12
- data/sys/dom/config.rb +718 -0
- data/sys/dom/d.rb +36 -18
- data/sys/dom/dom.rb +24 -14
- data/sys/reiquire.rb +8 -8
- data/sys/shr/ilib/crs/CMakeLists.txt +12 -0
- data/sys/shr/ilib/crs/compile.sh +5 -0
- data/sys/shr/ilib/crs/crs.c +24 -0
- data/sys/shr/ilib/crs/crs.o +0 -0
- data/sys/shr/ilib/crs/libcrs.so +0 -0
- data/sys/shr/prompt.rb +1 -5
- data/sys/shr/t.rb +14 -8
- data/sys/shr/version.rb +1 -1
- metadata +63 -26
- data/db/migrate/1763432541_create_logs.rb +0 -20
- data/locale/en.cngelog.yml +0 -5
- data/sys/aos/views/base.rb +0 -166
- data/sys/aos/views/games/abpps.rb +0 -21
- data/sys/aos/views/games/hbpps.rb +0 -21
- data/sys/aos/views/games/shpps.rb +0 -21
- data/sys/aos/views/games/vipps.rb +0 -21
- data/sys/aos/views/know/library.rb +0 -19
- data/sys/aos/views/know/temple.rb +0 -19
- data/sys/aos/views/setup/settings.rb +0 -37
- data/sys/aos/views/welcome/waite.rb +0 -19
- data/sys/aos/views/welcome.rb +0 -19
- data/sys/aos/you.rb +0 -19
- data/sys/cli/config.rb +0 -669
- data/sys/models/log.rb +0 -20
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f91a54d4e715e8e4d60abdc8995af38490ef59c8ce1a1e96cd705c719048a7fe
|
|
4
|
+
data.tar.gz: e511fd595d93feb729dd2d1a24d9d8fbffb2695a048c4beb1f7ca3879b082ba0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d78726504c8cea384672e6168ffbd28e1a49344534f18305ded0b6ba0c273444b65cc86f0d48c21e8b2890d1d37d220de792f95ab64ded12f495fb055d379327
|
|
7
|
+
data.tar.gz: 03dbf7645004603275e2d69ac2c5fbcf0fc22f7c02281e196d49533181d03db341e2087778132241b4281744019fbd68337f7582530cdb7849f442697eb10ef9
|
data/Gemfile.lock
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
aro (0.1
|
|
4
|
+
aro (0.2.1)
|
|
5
5
|
activerecord (~> 8.1, >= 8.1.1)
|
|
6
|
+
ffi (~> 1.17, >= 1.17.2)
|
|
6
7
|
i18n (~> 1.14, >= 1.14.7)
|
|
7
|
-
listen (~> 3.9, >= 3.9.0)
|
|
8
8
|
sqlite3 (~> 2.8, >= 2.8.0)
|
|
9
9
|
tty-prompt (~> 0.23.1, >= 0.23.1)
|
|
10
10
|
|
|
@@ -116,6 +116,7 @@ PLATFORMS
|
|
|
116
116
|
DEPENDENCIES
|
|
117
117
|
aro!
|
|
118
118
|
bundler (~> 2.7, >= 2.7.2)
|
|
119
|
+
listen (~> 3.9, >= 3.9.0)
|
|
119
120
|
rake (~> 13.3, >= 13.3.1)
|
|
120
121
|
rspec (~> 3.13, >= 3.13.2)
|
|
121
122
|
|
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
##### __current version:__
|
|
5
5
|
[](https://badge.fury.io/rb/aro)
|
|
6
6
|
|
|
7
|
-
aro is a command line interface that allows you to manage multiple tarot
|
|
7
|
+
aro is a command line interface that allows you to manage multiple tarot tecks.
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
### install
|
data/aro.gemspec
CHANGED
|
@@ -36,4 +36,5 @@ Gem::Specification.new do |spec|
|
|
|
36
36
|
spec.add_runtime_dependency "activerecord", "~> 8.1", ">= 8.1.1"
|
|
37
37
|
spec.add_runtime_dependency "sqlite3", "~> 2.8", ">= 2.8.0"
|
|
38
38
|
spec.add_runtime_dependency "tty-prompt", "~> 0.23.1", ">= 0.23.1"
|
|
39
|
+
spec.add_runtime_dependency "ffi", "~> 1.17", ">= 1.17.2"
|
|
39
40
|
end
|
data/bin/aos
CHANGED
|
@@ -17,8 +17,8 @@ unless Aro::Dom.in_arodom?
|
|
|
17
17
|
exit(CLI::EXIT_CODES[:GENERAL_ERROR])
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
if CLI::ARGV0.nil?
|
|
20
|
+
if CLI::ARGV0.nil? || CLI::ARGV0 == Aos::Os::YOU_FLAG.to_sym
|
|
21
21
|
exit(Aos::run)
|
|
22
|
-
else
|
|
22
|
+
else
|
|
23
23
|
exit(Aos::process)
|
|
24
24
|
end
|
data/bin/aro
CHANGED
|
@@ -23,21 +23,21 @@ end
|
|
|
23
23
|
# cli parser
|
|
24
24
|
case CLI::ARGV0
|
|
25
25
|
when CLI::CMDS[:ARO][:CONFIG]
|
|
26
|
-
|
|
26
|
+
Aro::config
|
|
27
27
|
when CLI::CMDS[:ARO][:CREATE]
|
|
28
28
|
CLI::create
|
|
29
29
|
when CLI::CMDS[:ARO][:DECK]
|
|
30
|
-
CLI::
|
|
30
|
+
CLI::teck
|
|
31
31
|
when CLI::CMDS[:ARO][:DOM]
|
|
32
32
|
CLI::dom
|
|
33
33
|
when CLI::CMDS[:ARO][:INIT]
|
|
34
34
|
Aro::Mancy.init
|
|
35
35
|
else
|
|
36
36
|
unless Aro::Mancy.game.nil? || CLI::FLAGS[:HELP].include?(CLI::ARGV0)
|
|
37
|
-
|
|
37
|
+
unless ARGV.include?(:aos.to_s)
|
|
38
38
|
Aro::P.say(I18n.t("cli.messages.welcome", name: "#{Aro::Mancy.name}.game"))
|
|
39
39
|
Aro::Mancy.game.show
|
|
40
|
-
|
|
40
|
+
end
|
|
41
41
|
|
|
42
42
|
exit(CLI::EXIT_CODES[:SUCCESS])
|
|
43
43
|
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
98e520a4e76c2a04f79f7b7207759dae278b366625735757c7612b75fddf5acdd0d0942fb613a0c8ecc5cb8304814a09fd0336f775df46c164a7a13397400a5f
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
580e42a13fb83232b8282a3d2888ced1fc36790739ebc8b5c3bf99b9d7c5664f10d117d967a2d75896c7a2cabfbe84e628b3359d7f4d6771a2cad4784cd178e5
|
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
|
|
3
|
+
listener = Listen.to(*[:sys.to_s, :bin.to_s, :spec.to_s, :locale.to_s], only: /[\.rb\.yml]/) {|modified, added, removed|
|
|
4
4
|
# puts modified
|
|
5
5
|
# puts added
|
|
6
6
|
# puts removed
|
data/locale/en.amg.yml
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
en:
|
|
2
|
+
amg:
|
|
3
|
+
commands:
|
|
4
|
+
description:
|
|
5
|
+
inst: "show installed ilibs or install a lib."
|
|
6
|
+
instun: "show uninstalled ilibs or uninstall a lib."
|
|
7
|
+
usage:
|
|
8
|
+
inst: "$ amg inst <lib>"
|
|
9
|
+
instun: "$ amg instun <lib>"
|
|
10
|
+
messages:
|
|
11
|
+
already_installed: "%{name} lib is already installed."
|
|
12
|
+
cannot_locate: "could not find %{name} lib."
|
|
13
|
+
ilib_name: "name: %{name}"
|
|
14
|
+
ilib_path: "path: %{path}"
|
|
15
|
+
ilib_usage: "usage: %{usage}"
|
|
16
|
+
install_success: "%{name} installed successfully."
|
|
17
|
+
install_failure: "failed to install %{name}."
|
|
18
|
+
listing_available: "listing available ilibs..."
|
|
19
|
+
listing_installed: "listing installed ilibs..."
|
|
20
|
+
none_available: "no ilibs available for install."
|
|
21
|
+
none_installed: "no ilibs installed."
|
|
22
|
+
not_installed: "%{name} lib is not installed."
|
|
23
|
+
uninstall_success: "%{name} uninstalled successfully."
|
|
24
|
+
uninstall_failure: "failed to uninstall %{name}."
|
|
25
|
+
usage: |
|
|
26
|
+
|
|
27
|
+
amg [-h | --help] <command>
|
|
28
|
+
aos system management.
|
|
29
|
+
|
|
30
|
+
COMMANDS
|
|
31
|
+
|
|
32
|
+
inst
|
|
33
|
+
show installed ilibs.
|
|
34
|
+
|
|
35
|
+
install a lib named <lib>.
|
|
36
|
+
|
|
37
|
+
$ amg inst <lib>
|
|
38
|
+
|
|
39
|
+
instun
|
|
40
|
+
show uninstalled ilibs.
|
|
41
|
+
|
|
42
|
+
uninstall a lib named <lib>.
|
|
43
|
+
|
|
44
|
+
$ amg instun <lib>
|
data/locale/en.aos.yml
CHANGED
|
@@ -2,30 +2,35 @@ en:
|
|
|
2
2
|
aos:
|
|
3
3
|
commands:
|
|
4
4
|
description:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
amg: "manage aos. a tool for package installation/management."
|
|
6
|
+
cd: "change directory. no args navigates to arodome root."
|
|
7
|
+
config: "read/write aos vars. (enter vars lowercase excluding bash prefix)."
|
|
8
|
+
data: "manage aos data."
|
|
8
9
|
exit: "exit."
|
|
10
|
+
help: "help."
|
|
9
11
|
ll: "list files and folders in the pwd including hidden files."
|
|
10
12
|
ls: "list files and folders in the pwd."
|
|
11
13
|
pwd: "show pwd."
|
|
12
14
|
usage:
|
|
15
|
+
amg: "$ amg [-h | --help] <command>"
|
|
13
16
|
cd: "$ cd <name>"
|
|
14
|
-
config: "$ config"
|
|
15
|
-
|
|
17
|
+
config: "$ config <var_name> <var_value>"
|
|
18
|
+
data: "$ data [-h | --help] <command>"
|
|
16
19
|
exit: "$ exit"
|
|
20
|
+
help: "$ help"
|
|
17
21
|
ll: "$ ll"
|
|
18
22
|
ls: "$ ls"
|
|
19
23
|
pwd: "$ pwd"
|
|
20
24
|
constants:
|
|
21
25
|
commands: "COMMANDS"
|
|
26
|
+
subcommands: "SUBCOMMANDS"
|
|
22
27
|
views:
|
|
23
28
|
dom:
|
|
24
|
-
title: "
|
|
25
|
-
description: "
|
|
29
|
+
title: "ready to go..."
|
|
30
|
+
description: "awaiting input..."
|
|
26
31
|
quick_navigation: "the following room names are reserved for quick navigation. enter any of them to navigate to that room."
|
|
27
32
|
game:
|
|
28
|
-
title: "aro"
|
|
33
|
+
title: "you are playing aro..."
|
|
29
34
|
description: "enter commands to play."
|
|
30
35
|
is_the: "welcome to the %{name} game room."
|
|
31
36
|
designed_for: "originally designed for %{description}"
|
data/locale/en.data.yml
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
en:
|
|
2
|
+
data:
|
|
3
|
+
commands:
|
|
4
|
+
description:
|
|
5
|
+
ilogs: "show aos ilogs."
|
|
6
|
+
yous: "show aos ilogs."
|
|
7
|
+
usage:
|
|
8
|
+
ilogs: "$ data ilogs"
|
|
9
|
+
yous: "$ data yous"
|
|
10
|
+
ilogs:
|
|
11
|
+
display: "%{you} entered '%{cmd}' at %{timestamp} in %{pwd}."
|
|
12
|
+
yous:
|
|
13
|
+
display: "name: %{name}, access: %{access}, pwd: %{pwd}."
|
|
14
|
+
messages:
|
|
15
|
+
listing_ilogs: "listing aos input ilogs..."
|
|
16
|
+
listing_yous: "listing yous..."
|
|
17
|
+
no_ilogs: "no input ilogs."
|
|
18
|
+
no_yous: "no yous."
|
|
19
|
+
usage: |
|
|
20
|
+
|
|
21
|
+
data [-h | --help] <command>
|
|
22
|
+
aos data management.
|
|
23
|
+
|
|
24
|
+
COMMANDS
|
|
25
|
+
|
|
26
|
+
ilogs
|
|
27
|
+
show aos ilogs.
|
|
28
|
+
|
|
29
|
+
yous
|
|
30
|
+
show aos yous.
|
data/locale/en.dom.yml
CHANGED
|
@@ -7,8 +7,8 @@ en:
|
|
|
7
7
|
description: "aro game rooms."
|
|
8
8
|
know:
|
|
9
9
|
description: "information space."
|
|
10
|
-
|
|
11
|
-
description: "
|
|
10
|
+
root:
|
|
11
|
+
description: "aos system space."
|
|
12
12
|
rooms:
|
|
13
13
|
waite:
|
|
14
14
|
description: "sign up."
|
|
@@ -22,12 +22,14 @@ en:
|
|
|
22
22
|
description: "human and artificial beings."
|
|
23
23
|
vipps:
|
|
24
24
|
description: "only dev_tarot users. no ruby_facots allowed."
|
|
25
|
-
|
|
26
|
-
description: "
|
|
27
|
-
|
|
28
|
-
description: "
|
|
29
|
-
|
|
30
|
-
description: "
|
|
25
|
+
body:
|
|
26
|
+
description: "body."
|
|
27
|
+
mind:
|
|
28
|
+
description: "mind."
|
|
29
|
+
spirit:
|
|
30
|
+
description: "spirit."
|
|
31
|
+
config:
|
|
32
|
+
description: "user config and configuration."
|
|
31
33
|
errors:
|
|
32
34
|
directory_exists: "unable to create arodome at %{name}. file or directory already exists."
|
|
33
35
|
failed_already_in_arodom: "unable to create an arodome because you are already in arodom."
|
data/locale/en.usage.yml
CHANGED
|
@@ -3,7 +3,7 @@ en:
|
|
|
3
3
|
main: |
|
|
4
4
|
NAME
|
|
5
5
|
|
|
6
|
-
aro - a cli for tarot
|
|
6
|
+
aro - a cli for tarot.
|
|
7
7
|
|
|
8
8
|
SYNOPSIS
|
|
9
9
|
|
|
@@ -16,7 +16,7 @@ en:
|
|
|
16
16
|
$ aro create <name>
|
|
17
17
|
|
|
18
18
|
init
|
|
19
|
-
|
|
19
|
+
sets up the .aro directory that contains database and config
|
|
20
20
|
|
|
21
21
|
note:
|
|
22
22
|
this runs by default after create and has no effect if init is complete.
|
|
@@ -24,28 +24,28 @@ en:
|
|
|
24
24
|
config
|
|
25
25
|
aro config management.
|
|
26
26
|
|
|
27
|
-
$ aro config <
|
|
27
|
+
$ aro config <var_name> <var_value>
|
|
28
28
|
|
|
29
|
-
passing no args
|
|
29
|
+
passing no args or only <var_name> prints the current config or <var_value>.
|
|
30
30
|
|
|
31
31
|
SUBCOMMANDS
|
|
32
32
|
set
|
|
33
33
|
sets an ivar to a specified value. the aro var prefix can be omitted.
|
|
34
34
|
|
|
35
|
-
$ aro config
|
|
35
|
+
$ aro config <var_name> <var_value>
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
manage
|
|
37
|
+
teck
|
|
38
|
+
manage tecks in the current room.
|
|
39
39
|
|
|
40
|
-
$ aro
|
|
40
|
+
$ aro teck <commands>
|
|
41
41
|
|
|
42
42
|
passing no args opens the selection menu.
|
|
43
43
|
|
|
44
44
|
note:
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
teck subcommands do not require typing 'teck'. for example,
|
|
47
47
|
|
|
48
|
-
$ aro
|
|
48
|
+
$ aro teck show
|
|
49
49
|
|
|
50
50
|
is the same thing as:
|
|
51
51
|
|
|
@@ -53,29 +53,29 @@ en:
|
|
|
53
53
|
|
|
54
54
|
SUBCOMMANDS
|
|
55
55
|
draw
|
|
56
|
-
draw a random card from the current
|
|
56
|
+
draw a random card from the current teck.
|
|
57
57
|
|
|
58
58
|
explore
|
|
59
|
-
allows user to browse each card in the current
|
|
59
|
+
allows user to browse each card in the current teck.
|
|
60
60
|
|
|
61
61
|
new
|
|
62
|
-
create a new
|
|
62
|
+
create a new teck with the specified name.
|
|
63
63
|
|
|
64
64
|
example:
|
|
65
65
|
|
|
66
|
-
$ aro
|
|
66
|
+
$ aro teck new <name>
|
|
67
67
|
|
|
68
68
|
replace
|
|
69
69
|
replaces all drawn cards FIFO and puts them on the bottom of
|
|
70
|
-
the
|
|
70
|
+
the teck. this will preserve all card orientations.
|
|
71
71
|
|
|
72
72
|
reset
|
|
73
|
-
completely reset the
|
|
73
|
+
completely reset the teck. replace all drawn and reset order.
|
|
74
74
|
all orientations will be set to upright. you must enter 'aroyes'
|
|
75
75
|
to continue.
|
|
76
76
|
|
|
77
77
|
show
|
|
78
|
-
displays the current
|
|
78
|
+
displays the current teck's log record(s).
|
|
79
79
|
|
|
80
80
|
the default behavior is to display only the most recent log record.
|
|
81
81
|
|
|
@@ -85,11 +85,11 @@ en:
|
|
|
85
85
|
|
|
86
86
|
OPTIONS
|
|
87
87
|
|
|
88
|
-
[-n | --count] specify number of
|
|
88
|
+
[-n | --count] specify number of teck tlogs to show.
|
|
89
89
|
|
|
90
90
|
default is 1 (latest/current state)
|
|
91
91
|
|
|
92
|
-
passing 'all' display all
|
|
92
|
+
passing 'all' display all tlogs
|
|
93
93
|
|
|
94
94
|
[-o | --order] specify the output order of the log records.
|
|
95
95
|
|
|
@@ -98,15 +98,15 @@ en:
|
|
|
98
98
|
possible values: ['asc', 'desc']
|
|
99
99
|
|
|
100
100
|
shuffle
|
|
101
|
-
shuffles the current
|
|
101
|
+
shuffles the current teck and generates a log record.
|
|
102
102
|
|
|
103
103
|
dom
|
|
104
|
-
|
|
104
|
+
aos arodome management.
|
|
105
105
|
|
|
106
106
|
$ aro dom <commands>
|
|
107
107
|
|
|
108
108
|
SUBCOMMANDS
|
|
109
|
-
init
|
|
109
|
+
init <username> <password>
|
|
110
110
|
generate the arodome
|
|
111
111
|
new
|
|
112
112
|
create a new arodome with the specified name.
|
data/locale/en.yml
CHANGED
|
@@ -21,13 +21,17 @@ en:
|
|
|
21
21
|
dev_tarot_description: "reads from /dev/tarot device if available."
|
|
22
22
|
ruby_facot_description: "generated ruby_facot (facade randomness)."
|
|
23
23
|
format:
|
|
24
|
-
description: "
|
|
25
|
-
text_description: "show
|
|
26
|
-
json_description: "show
|
|
24
|
+
description: "aos output format."
|
|
25
|
+
text_description: "show aos output in text format (default)."
|
|
26
|
+
json_description: "show aos output in json format."
|
|
27
|
+
interface:
|
|
28
|
+
description: "aos output interface."
|
|
29
|
+
terminal_description: "render terminal output (default)."
|
|
30
|
+
lanimret_description: "render flie web output."
|
|
27
31
|
height_description: "display height. valid range: (${min}-${max})"
|
|
28
32
|
width_description: "display width. valid range: (${min}-${max})"
|
|
29
33
|
env:
|
|
30
|
-
description: "
|
|
34
|
+
description: "aos run environment."
|
|
31
35
|
development_description: "basic development logs and features."
|
|
32
36
|
production_description: "game logging only."
|
|
33
37
|
test_description: "logging and features tailored for tests."
|
|
@@ -50,15 +54,15 @@ en:
|
|
|
50
54
|
header: "%{cmd} says there was a problem."
|
|
51
55
|
invalid_usage: "%{cmd} says you're not supposed to be here."
|
|
52
56
|
missing_args: "%{cmd} says missing required argument(s)."
|
|
53
|
-
|
|
57
|
+
missing_teck: "%{cmd} says no teck selected. use 'aro teck' to select one or 'aro teck new <name>' to create one."
|
|
54
58
|
not_in_aro: "%{cmd} says you are not in aro space. that command will not work here."
|
|
55
59
|
not_in_aos: "%{cmd} says you are not in aos space. that command will not work here."
|
|
56
60
|
not_initialized: "%{cmd} says you need to initialize aro. run 'aro init' to do so"
|
|
57
61
|
warnings:
|
|
58
|
-
invalid_order: "the order specified for displaying
|
|
62
|
+
invalid_order: "the order specified for displaying tlogs in invalid. using default (desc)."
|
|
59
63
|
messages:
|
|
60
64
|
choose_card: "choose a card."
|
|
61
|
-
|
|
65
|
+
choose_teck: "choose a teck."
|
|
62
66
|
confirmation_prompt: "input 'aroyes' to reset %{name}, or enter to cancel (cancel): "
|
|
63
67
|
creating: "creating %{name}..."
|
|
64
68
|
creation_attempt: "attempting to create aro table named %{name}..."
|
|
@@ -71,7 +75,8 @@ en:
|
|
|
71
75
|
$ cd %{name}
|
|
72
76
|
|
|
73
77
|
see aro --help for usage.
|
|
74
|
-
|
|
78
|
+
teck_created_sucessfully: "%{name} teck created successfully"
|
|
79
|
+
teck_selected: "%{name} teck selected in the %{room} room."
|
|
75
80
|
drawing: "drawing a card from %{name}"
|
|
76
81
|
drawing_from_dimension: "in the the %{dimension} dimension..."
|
|
77
82
|
ruby_facot_random: |
|
|
@@ -79,12 +84,12 @@ en:
|
|
|
79
84
|
for more information visit:
|
|
80
85
|
https://github.com/arowmancy/dev_tarot
|
|
81
86
|
history_drawn: "drawn cards"
|
|
82
|
-
|
|
83
|
-
no
|
|
87
|
+
no_tecks: |
|
|
88
|
+
no tecks created yet.
|
|
84
89
|
|
|
85
90
|
use the following command to create one:
|
|
86
91
|
|
|
87
|
-
$ aro
|
|
92
|
+
$ aro teck new <teck_name>
|
|
88
93
|
|
|
89
94
|
see aro --help for usage.
|
|
90
95
|
showing: "showing %{name} [count:%{count}, order:%{order}]..."
|
data/sys/aos/amg.rb
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
amg.rb
|
|
4
|
+
|
|
5
|
+
aos system management.
|
|
6
|
+
|
|
7
|
+
by i2097i
|
|
8
|
+
|
|
9
|
+
=end
|
|
10
|
+
|
|
11
|
+
module Aos
|
|
12
|
+
class Amg
|
|
13
|
+
include Singleton
|
|
14
|
+
|
|
15
|
+
attr_accessor :display_lines
|
|
16
|
+
|
|
17
|
+
CMDS = {
|
|
18
|
+
INST: {
|
|
19
|
+
key: :inst,
|
|
20
|
+
description: I18n.t("amg.commands.description.inst"),
|
|
21
|
+
usage: I18n.t("amg.commands.usage.inst"),
|
|
22
|
+
},
|
|
23
|
+
INSTUN: {
|
|
24
|
+
key: :instun,
|
|
25
|
+
description: I18n.t("amg.commands.description.instun"),
|
|
26
|
+
usage: I18n.t("amg.commands.usage.instun"),
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
def initialize
|
|
31
|
+
self.display_lines = Aos::Amg.base_lines
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def self.process_cmd(args)
|
|
35
|
+
self.instance.display_lines = []
|
|
36
|
+
if args[Aro::Mancy::S].nil? ||
|
|
37
|
+
CLI::FLAGS[:HELP].include?(args[Aro::Mancy::S].to_sym)
|
|
38
|
+
Aos::Amg.amg
|
|
39
|
+
return true
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
case args[Aro::Mancy::S].to_sym
|
|
43
|
+
when Aos::Amg::CMDS[:INST][:key]
|
|
44
|
+
unless args[Aro::Mancy::OS].nil?
|
|
45
|
+
ilib_name = args[Aro::Mancy::OS]
|
|
46
|
+
ilib = Aos::Ilib.find_by(name: ilib_name)
|
|
47
|
+
unless ilib.nil?
|
|
48
|
+
if ilib.installed?
|
|
49
|
+
self.instance.display_lines << I18n.t("amg.messages.already_installed", name: ilib_name)
|
|
50
|
+
else
|
|
51
|
+
Aos::Amg.install(ilib)
|
|
52
|
+
if ilib.reload.installed?
|
|
53
|
+
self.instance.display_lines << I18n.t("amg.messages.install_success", name: ilib_name)
|
|
54
|
+
self.instance.display_lines += self.inst_lines
|
|
55
|
+
return true
|
|
56
|
+
else
|
|
57
|
+
self.instance.display_lines << I18n.t("amg.messages.install_failure", name: ilib_name)
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
else
|
|
61
|
+
self.instance.display_lines << I18n.t("amg.messages.cannot_locate", name: ilib_name)
|
|
62
|
+
end
|
|
63
|
+
else
|
|
64
|
+
# list installed ilibs
|
|
65
|
+
Aos::Amg.inst
|
|
66
|
+
return true
|
|
67
|
+
end
|
|
68
|
+
when Aos::Amg::CMDS[:INSTUN][:key]
|
|
69
|
+
unless args[Aro::Mancy::OS].nil?
|
|
70
|
+
ilib_name = args[Aro::Mancy::OS]
|
|
71
|
+
ilib = Aos::Ilib.find_by(name: ilib_name)
|
|
72
|
+
unless ilib.nil?
|
|
73
|
+
if ilib.available?
|
|
74
|
+
self.instance.display_lines << I18n.t("amg.messages.not_installed", name: ilib_name)
|
|
75
|
+
else
|
|
76
|
+
Aos::Amg.uninstall(ilib)
|
|
77
|
+
if ilib.reload.available?
|
|
78
|
+
self.instance.display_lines << I18n.t("amg.messages.uninstall_success", name: ilib_name)
|
|
79
|
+
self.instance.display_lines += self.instun_lines
|
|
80
|
+
return true
|
|
81
|
+
else
|
|
82
|
+
self.instance.display_lines << I18n.t("amg.messages.uninstall_failure", name: ilib_name)
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
else
|
|
86
|
+
self.instance.display_lines << I18n.t("amg.messages.cannot_locate", name: ilib_name)
|
|
87
|
+
end
|
|
88
|
+
else
|
|
89
|
+
# list available ilibs
|
|
90
|
+
Aos::Amg.instun
|
|
91
|
+
return true
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
return false
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def self.load(ilib_name)
|
|
99
|
+
Aos::Ilib.find_or_create_by(name: ilib_name)
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def self.install(ilib)
|
|
103
|
+
return unless ilib.kind_of?(Aos::Ilib)
|
|
104
|
+
ilib.installed!
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def self.uninstall(ilib)
|
|
108
|
+
return unless ilib.kind_of?(Aos::Ilib)
|
|
109
|
+
ilib.available!
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
def self.inst
|
|
113
|
+
self.instance.display_lines = Aos::Amg.inst_lines
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def self.instun
|
|
117
|
+
self.instance.display_lines = Aos::Amg.instun_lines
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
def self.amg
|
|
121
|
+
self.instance.display_lines = Aos::Amg.base_lines
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
def self.base_lines
|
|
125
|
+
# print amg commands
|
|
126
|
+
lines = []
|
|
127
|
+
lines << ""
|
|
128
|
+
lines << I18n.t("aos.constants.commands")
|
|
129
|
+
lines += Aos::Vw::Base.lines_for_cmd(Aos::Os::CMDS[:AMG])
|
|
130
|
+
lines << I18n.t("aos.constants.subcommands")
|
|
131
|
+
Aos::Amg::CMDS.keys.each{|k|
|
|
132
|
+
lines += Aos::Vw::Base.lines_for_cmd(Aos::Amg::CMDS[k])
|
|
133
|
+
}
|
|
134
|
+
lines << ""
|
|
135
|
+
|
|
136
|
+
lines
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
def self.inst_lines
|
|
140
|
+
# list installed ilibs
|
|
141
|
+
lines = []
|
|
142
|
+
lines << ""
|
|
143
|
+
installed_ilibs = Aos::Ilib.where(status: :installed)
|
|
144
|
+
unless installed_ilibs.any?
|
|
145
|
+
lines << I18n.t("amg.messages.none_installed")
|
|
146
|
+
else
|
|
147
|
+
lines << I18n.t("amg.messages.listing_installed")
|
|
148
|
+
lines += Aos::Amg.ilib_lines(installed_ilibs)
|
|
149
|
+
end
|
|
150
|
+
lines << ""
|
|
151
|
+
|
|
152
|
+
lines
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
def self.instun_lines
|
|
156
|
+
# list installed ilibs
|
|
157
|
+
lines = []
|
|
158
|
+
lines << ""
|
|
159
|
+
available_ilibs = Aos::Ilib.where(status: :available)
|
|
160
|
+
unless available_ilibs.any?
|
|
161
|
+
lines << I18n.t("amg.messages.none_available")
|
|
162
|
+
else
|
|
163
|
+
lines << I18n.t("amg.messages.listing_available")
|
|
164
|
+
lines += Aos::Amg.ilib_lines(available_ilibs)
|
|
165
|
+
end
|
|
166
|
+
lines << ""
|
|
167
|
+
|
|
168
|
+
lines
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
def self.ilib_lines(ilibs)
|
|
172
|
+
lines = []
|
|
173
|
+
ilibs.each_with_index{|ilib, i|
|
|
174
|
+
lines << "[#{i + Aro::Mancy::S} of #{ilibs.count}]"
|
|
175
|
+
lines << I18n.t("amg.messages.ilib_name", name: ilib.name)
|
|
176
|
+
lines << I18n.t("amg.messages.ilib_path", path: ilib.so_path.split("/").last(Aro::Mancy::N).join("/"))
|
|
177
|
+
lines << I18n.t("amg.messages.ilib_usage", usage: ilib.usage)
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
lines
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
end
|
|
184
|
+
end
|