aro 0.2.1 → 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/README.md +1 -1
- data/bin/aro +3 -3
- data/checksums/aro-0.2.1.gem.sha512 +1 -0
- data/checksums/aro-0.2.2.gem.sha512 +1 -0
- data/locale/en.amg.yml +44 -0
- data/locale/en.aos.yml +4 -38
- data/locale/en.data.yml +30 -0
- data/locale/en.dom.yml +8 -6
- data/locale/en.usage.yml +20 -20
- data/locale/en.yml +16 -12
- data/sys/aos/amg.rb +58 -56
- data/sys/aos/aos.rb +82 -49
- data/sys/aos/data.rb +117 -0
- data/sys/aos/db/migrate/1765148774_create_yous.rb +1 -0
- data/sys/aos/db/migrate/{1765762724_create_libs.rb → 1765762724_create_ilibs.rb} +5 -5
- data/sys/aos/db/migrate/1765907766_create_ilogs.rb +18 -0
- data/sys/aos/db.rb +37 -17
- data/sys/{shr/lib/lib.rb → aos/models/ilib.rb} +9 -6
- data/sys/aos/models/ilog.rb +27 -0
- data/sys/aos/models/you.rb +50 -0
- data/sys/aos/vws/base.rb +9 -58
- data/sys/aos/vws/dom.rb +0 -1
- data/sys/aos/vws/games/game.rb +10 -10
- data/sys/aos/vws/know/{temple.rb → body.rb} +3 -3
- data/sys/aos/vws/know/{library.rb → mind.rb} +3 -3
- data/sys/aos/vws/know/spirit.rb +19 -0
- data/sys/aos/vws/{setup → root}/amg.rb +1 -2
- data/sys/aos/vws/{setup → root}/config.rb +1 -1
- data/sys/aos/vws/root/data.rb +21 -0
- data/sys/aos/vws/{setup.rb → root.rb} +3 -3
- data/sys/aos/vws/welcome/waite.rb +1 -0
- data/sys/aos/vws/welcome.rb +11 -0
- data/sys/aro/db/migrate/{1763374647_create_decks.rb → 1763374647_create_tecks.rb} +5 -5
- data/sys/aro/db/migrate/1763432541_create_tlogs.rb +20 -0
- data/sys/aro/db.rb +11 -11
- data/sys/aro/mancy.rb +4 -4
- data/sys/{models/deck.rb → aro/models/teck.rb} +51 -52
- data/sys/aro/models/tlog.rb +20 -0
- data/sys/cli/constants.rb +1 -1
- data/sys/cli/dom.rb +1 -1
- data/sys/cli/{deck.rb → teck.rb} +15 -15
- data/sys/cli.rb +4 -3
- data/sys/dom/config.rb +196 -143
- data/sys/dom/d.rb +32 -19
- data/sys/dom/dom.rb +22 -13
- data/sys/reiquire.rb +6 -7
- data/sys/shr/prompt.rb +0 -4
- data/sys/shr/version.rb +1 -1
- metadata +28 -20
- data/locale/en.cngelog.yml +0 -5
- data/sys/aos/you.rb +0 -21
- data/sys/aro/db/migrate/1763432541_create_logs.rb +0 -20
- data/sys/models/log.rb +0 -20
- /data/sys/shr/{lib → ilib}/crs/CMakeLists.txt +0 -0
- /data/sys/shr/{lib → ilib}/crs/compile.sh +0 -0
- /data/sys/shr/{lib → ilib}/crs/crs.c +0 -0
- /data/sys/shr/{lib → ilib}/crs/crs.o +0 -0
- /data/sys/shr/{lib → ilib}/crs/libcrs.so +0 -0
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/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/bin/aro
CHANGED
|
@@ -27,17 +27,17 @@ when CLI::CMDS[: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/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
|
@@ -1,45 +1,11 @@
|
|
|
1
1
|
en:
|
|
2
2
|
aos:
|
|
3
|
-
amg:
|
|
4
|
-
lib:
|
|
5
|
-
listing_available: "listing available libs..."
|
|
6
|
-
listing_installed: "listing installed libs..."
|
|
7
|
-
none_available: "no libs available for install."
|
|
8
|
-
none_installed: "no libs installed."
|
|
9
|
-
commands:
|
|
10
|
-
description:
|
|
11
|
-
inst: "show installed libs or install a lib."
|
|
12
|
-
instun: "show uninstalled libs or uninstall a lib."
|
|
13
|
-
usage:
|
|
14
|
-
inst: "$ amg inst <lib>"
|
|
15
|
-
instun: "$ amg instun <lib>"
|
|
16
|
-
usage: |
|
|
17
|
-
|
|
18
|
-
amg [-h | --help] <command>
|
|
19
|
-
aos system management.
|
|
20
|
-
|
|
21
|
-
COMMANDS
|
|
22
|
-
|
|
23
|
-
inst
|
|
24
|
-
show installed libs.
|
|
25
|
-
|
|
26
|
-
install a lib named <lib>.
|
|
27
|
-
|
|
28
|
-
$ amg inst <lib>
|
|
29
|
-
|
|
30
|
-
instun
|
|
31
|
-
show uninstalled libs.
|
|
32
|
-
|
|
33
|
-
uninstall a lib named <lib>.
|
|
34
|
-
|
|
35
|
-
$ amg instun <lib>
|
|
36
|
-
|
|
37
3
|
commands:
|
|
38
4
|
description:
|
|
39
5
|
amg: "manage aos. a tool for package installation/management."
|
|
40
6
|
cd: "change directory. no args navigates to arodome root."
|
|
41
|
-
config: "
|
|
42
|
-
|
|
7
|
+
config: "read/write aos vars. (enter vars lowercase excluding bash prefix)."
|
|
8
|
+
data: "manage aos data."
|
|
43
9
|
exit: "exit."
|
|
44
10
|
help: "help."
|
|
45
11
|
ll: "list files and folders in the pwd including hidden files."
|
|
@@ -48,8 +14,8 @@ en:
|
|
|
48
14
|
usage:
|
|
49
15
|
amg: "$ amg [-h | --help] <command>"
|
|
50
16
|
cd: "$ cd <name>"
|
|
51
|
-
config: "$ config"
|
|
52
|
-
|
|
17
|
+
config: "$ config <var_name> <var_value>"
|
|
18
|
+
data: "$ data [-h | --help] <command>"
|
|
53
19
|
exit: "$ exit"
|
|
54
20
|
help: "$ help"
|
|
55
21
|
ll: "$ ll"
|
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,10 +22,12 @@ 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: "
|
|
25
|
+
body:
|
|
26
|
+
description: "body."
|
|
27
|
+
mind:
|
|
28
|
+
description: "mind."
|
|
29
|
+
spirit:
|
|
30
|
+
description: "spirit."
|
|
29
31
|
config:
|
|
30
32
|
description: "user config and configuration."
|
|
31
33
|
errors:
|
data/locale/en.usage.yml
CHANGED
|
@@ -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,7 +98,7 @@ 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.
|
|
@@ -106,7 +106,7 @@ en:
|
|
|
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,8 +75,8 @@ en:
|
|
|
71
75
|
$ cd %{name}
|
|
72
76
|
|
|
73
77
|
see aro --help for usage.
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
teck_created_sucessfully: "%{name} teck created successfully"
|
|
79
|
+
teck_selected: "%{name} teck selected in the %{room} room."
|
|
76
80
|
drawing: "drawing a card from %{name}"
|
|
77
81
|
drawing_from_dimension: "in the the %{dimension} dimension..."
|
|
78
82
|
ruby_facot_random: |
|
|
@@ -80,12 +84,12 @@ en:
|
|
|
80
84
|
for more information visit:
|
|
81
85
|
https://github.com/arowmancy/dev_tarot
|
|
82
86
|
history_drawn: "drawn cards"
|
|
83
|
-
|
|
84
|
-
no
|
|
87
|
+
no_tecks: |
|
|
88
|
+
no tecks created yet.
|
|
85
89
|
|
|
86
90
|
use the following command to create one:
|
|
87
91
|
|
|
88
|
-
$ aro
|
|
92
|
+
$ aro teck new <teck_name>
|
|
89
93
|
|
|
90
94
|
see aro --help for usage.
|
|
91
95
|
showing: "showing %{name} [count:%{count}, order:%{order}]..."
|
data/sys/aos/amg.rb
CHANGED
|
@@ -17,13 +17,13 @@ module Aos
|
|
|
17
17
|
CMDS = {
|
|
18
18
|
INST: {
|
|
19
19
|
key: :inst,
|
|
20
|
-
description: I18n.t("
|
|
21
|
-
usage: I18n.t("
|
|
20
|
+
description: I18n.t("amg.commands.description.inst"),
|
|
21
|
+
usage: I18n.t("amg.commands.usage.inst"),
|
|
22
22
|
},
|
|
23
23
|
INSTUN: {
|
|
24
24
|
key: :instun,
|
|
25
|
-
description: I18n.t("
|
|
26
|
-
usage: I18n.t("
|
|
25
|
+
description: I18n.t("amg.commands.description.instun"),
|
|
26
|
+
usage: I18n.t("amg.commands.usage.instun"),
|
|
27
27
|
},
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -42,51 +42,51 @@ module Aos
|
|
|
42
42
|
case args[Aro::Mancy::S].to_sym
|
|
43
43
|
when Aos::Amg::CMDS[:INST][:key]
|
|
44
44
|
unless args[Aro::Mancy::OS].nil?
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
unless
|
|
48
|
-
if
|
|
49
|
-
self.instance.display_lines << "
|
|
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
50
|
else
|
|
51
|
-
Aos::Amg.install(
|
|
52
|
-
if
|
|
53
|
-
self.instance.display_lines << "
|
|
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
54
|
self.instance.display_lines += self.inst_lines
|
|
55
55
|
return true
|
|
56
56
|
else
|
|
57
|
-
self.instance.display_lines << "
|
|
57
|
+
self.instance.display_lines << I18n.t("amg.messages.install_failure", name: ilib_name)
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
60
|
else
|
|
61
|
-
self.instance.display_lines << "
|
|
61
|
+
self.instance.display_lines << I18n.t("amg.messages.cannot_locate", name: ilib_name)
|
|
62
62
|
end
|
|
63
63
|
else
|
|
64
|
-
# list installed
|
|
64
|
+
# list installed ilibs
|
|
65
65
|
Aos::Amg.inst
|
|
66
66
|
return true
|
|
67
67
|
end
|
|
68
68
|
when Aos::Amg::CMDS[:INSTUN][:key]
|
|
69
69
|
unless args[Aro::Mancy::OS].nil?
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
unless
|
|
73
|
-
if
|
|
74
|
-
self.instance.display_lines << "
|
|
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
75
|
else
|
|
76
|
-
Aos::Amg.uninstall(
|
|
77
|
-
if
|
|
78
|
-
self.instance.display_lines << "
|
|
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
79
|
self.instance.display_lines += self.instun_lines
|
|
80
80
|
return true
|
|
81
81
|
else
|
|
82
|
-
self.instance.display_lines << "
|
|
82
|
+
self.instance.display_lines << I18n.t("amg.messages.uninstall_failure", name: ilib_name)
|
|
83
83
|
end
|
|
84
84
|
end
|
|
85
85
|
else
|
|
86
|
-
self.instance.display_lines << "
|
|
86
|
+
self.instance.display_lines << I18n.t("amg.messages.cannot_locate", name: ilib_name)
|
|
87
87
|
end
|
|
88
88
|
else
|
|
89
|
-
# list available
|
|
89
|
+
# list available ilibs
|
|
90
90
|
Aos::Amg.instun
|
|
91
91
|
return true
|
|
92
92
|
end
|
|
@@ -95,18 +95,18 @@ module Aos
|
|
|
95
95
|
return false
|
|
96
96
|
end
|
|
97
97
|
|
|
98
|
-
def self.load(
|
|
99
|
-
Aos::
|
|
98
|
+
def self.load(ilib_name)
|
|
99
|
+
Aos::Ilib.find_or_create_by(name: ilib_name)
|
|
100
100
|
end
|
|
101
101
|
|
|
102
|
-
def self.install(
|
|
103
|
-
return unless
|
|
104
|
-
|
|
102
|
+
def self.install(ilib)
|
|
103
|
+
return unless ilib.kind_of?(Aos::Ilib)
|
|
104
|
+
ilib.installed!
|
|
105
105
|
end
|
|
106
106
|
|
|
107
|
-
def self.uninstall(
|
|
108
|
-
return unless
|
|
109
|
-
|
|
107
|
+
def self.uninstall(ilib)
|
|
108
|
+
return unless ilib.kind_of?(Aos::Ilib)
|
|
109
|
+
ilib.available!
|
|
110
110
|
end
|
|
111
111
|
|
|
112
112
|
def self.inst
|
|
@@ -137,20 +137,15 @@ module Aos
|
|
|
137
137
|
end
|
|
138
138
|
|
|
139
139
|
def self.inst_lines
|
|
140
|
-
# list installed
|
|
140
|
+
# list installed ilibs
|
|
141
141
|
lines = []
|
|
142
142
|
lines << ""
|
|
143
|
-
|
|
144
|
-
unless
|
|
145
|
-
lines << I18n.t("
|
|
143
|
+
installed_ilibs = Aos::Ilib.where(status: :installed)
|
|
144
|
+
unless installed_ilibs.any?
|
|
145
|
+
lines << I18n.t("amg.messages.none_installed")
|
|
146
146
|
else
|
|
147
|
-
lines << I18n.t("
|
|
148
|
-
|
|
149
|
-
lines << "[#{i + Aro::Mancy::S} of #{Aos::Lib.count}]"
|
|
150
|
-
lines << "name: #{lib.name}"
|
|
151
|
-
lines << "path: " + lib.so_path.split("/").last(Aro::Mancy::N).join("/")
|
|
152
|
-
lines << "usage: #{lib.usage}"
|
|
153
|
-
}
|
|
147
|
+
lines << I18n.t("amg.messages.listing_installed")
|
|
148
|
+
lines += Aos::Amg.ilib_lines(installed_ilibs)
|
|
154
149
|
end
|
|
155
150
|
lines << ""
|
|
156
151
|
|
|
@@ -158,25 +153,32 @@ module Aos
|
|
|
158
153
|
end
|
|
159
154
|
|
|
160
155
|
def self.instun_lines
|
|
161
|
-
# list installed
|
|
156
|
+
# list installed ilibs
|
|
162
157
|
lines = []
|
|
163
158
|
lines << ""
|
|
164
|
-
|
|
165
|
-
unless
|
|
166
|
-
lines << I18n.t("
|
|
159
|
+
available_ilibs = Aos::Ilib.where(status: :available)
|
|
160
|
+
unless available_ilibs.any?
|
|
161
|
+
lines << I18n.t("amg.messages.none_available")
|
|
167
162
|
else
|
|
168
|
-
lines << I18n.t("
|
|
169
|
-
|
|
170
|
-
lines << "[#{i + Aro::Mancy::S} of #{Aos::Lib.count}]"
|
|
171
|
-
lines << "name: #{lib.name}"
|
|
172
|
-
lines << "path: " + lib.so_path.split("/").last(Aro::Mancy::N).join("/")
|
|
173
|
-
lines << "usage: #{lib.usage}"
|
|
174
|
-
}
|
|
163
|
+
lines << I18n.t("amg.messages.listing_available")
|
|
164
|
+
lines += Aos::Amg.ilib_lines(available_ilibs)
|
|
175
165
|
end
|
|
176
166
|
lines << ""
|
|
177
167
|
|
|
178
168
|
lines
|
|
179
169
|
end
|
|
180
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
|
+
|
|
181
183
|
end
|
|
182
184
|
end
|