aro 0.2.0 → 0.2.1
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/aro.gemspec +1 -0
- data/bin/aos +2 -2
- data/bin/aro +1 -1
- data/listen.rb +1 -1
- data/locale/en.aos.yml +44 -5
- data/locale/en.dom.yml +2 -2
- data/locale/en.usage.yml +2 -2
- data/locale/en.yml +1 -0
- data/sys/aos/amg.rb +182 -0
- data/sys/aos/aos.rb +144 -63
- data/sys/aos/db/migrate/1765762724_create_libs.rb +22 -0
- data/sys/aos/db.rb +8 -9
- data/sys/aos/{views → vws}/base.rb +64 -61
- data/sys/aos/{views → vws}/dom.rb +6 -9
- data/sys/aos/vws/games/abpps.rb +19 -0
- data/sys/aos/{views → vws}/games/game.rb +16 -15
- 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/{views → vws}/know/library.rb +3 -3
- data/sys/aos/{views → vws}/know/temple.rb +3 -3
- data/sys/aos/{views → vws}/know.rb +3 -3
- data/sys/aos/vws/setup/amg.rb +22 -0
- data/sys/aos/vws/setup/config.rb +21 -0
- data/sys/aos/{views → vws}/setup.rb +3 -3
- data/sys/aos/vws/welcome/waite.rb +30 -0
- data/sys/aos/{views → vws}/welcome/winner.rb +3 -3
- data/sys/aos/{views → vws}/welcome.rb +3 -3
- data/sys/aos/you.rb +6 -4
- data/sys/aro/db.rb +6 -5
- data/sys/aro/mancy.rb +1 -0
- data/sys/aro/v.rb +1 -1
- data/sys/cli/deck.rb +9 -4
- data/sys/cli.rb +8 -9
- data/sys/{cli → dom}/config.rb +153 -157
- data/sys/dom/d.rb +10 -5
- data/sys/dom/dom.rb +3 -2
- data/sys/models/deck.rb +13 -18
- data/sys/reiquire.rb +4 -3
- data/sys/shr/lib/crs/CMakeLists.txt +12 -0
- data/sys/shr/lib/crs/compile.sh +5 -0
- data/sys/shr/lib/crs/crs.c +24 -0
- data/sys/shr/lib/crs/crs.o +0 -0
- data/sys/shr/lib/crs/libcrs.so +0 -0
- data/sys/shr/lib/lib.rb +43 -0
- data/sys/shr/prompt.rb +2 -2
- data/sys/shr/t.rb +14 -8
- data/sys/shr/version.rb +1 -1
- metadata +50 -21
- 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/setup/settings.rb +0 -37
- data/sys/aos/views/welcome/waite.rb +0 -19
- /data/{db → sys/aos/db}/migrate/1765148774_create_yous.rb +0 -0
- /data/{db → sys/aro/db}/migrate/1763374647_create_decks.rb +0 -0
- /data/{db → sys/aro/db}/migrate/1763432541_create_logs.rb +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e1f1c3e26c91bbdc591e6ef19be185940727ad2dc3f742d55755158bd2f080ae
|
|
4
|
+
data.tar.gz: 2da7a2917f1d59a472c88f13a502cf9e4e048b184d30b37e3619ad99814a2017
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 913970c4cdd1a9ccce0fa08a84b71d0717dc451431bd098cf1a56e4a5310b1070f16cfc17a837b36750e97e8b2be6cbffb1e6331b7948afa952accfae7713a9d
|
|
7
|
+
data.tar.gz: 102e29375b1cd65b9381ec68156774a1e6d18ac3da98d87bc9f24cdbc43ed00cc5ab741be5933f32901080c5bf9aa7884f7c2812a9f0f3365cf50c262a98b531
|
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/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
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.aos.yml
CHANGED
|
@@ -1,31 +1,70 @@
|
|
|
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
|
+
|
|
3
37
|
commands:
|
|
4
38
|
description:
|
|
5
|
-
|
|
6
|
-
|
|
39
|
+
amg: "manage aos. a tool for package installation/management."
|
|
40
|
+
cd: "change directory. no args navigates to arodome root."
|
|
41
|
+
config: "prints loaded config."
|
|
7
42
|
config_set: "sets an ivar to a specified value. the prefix '%{prefix}' can be omitted."
|
|
8
43
|
exit: "exit."
|
|
44
|
+
help: "help."
|
|
9
45
|
ll: "list files and folders in the pwd including hidden files."
|
|
10
46
|
ls: "list files and folders in the pwd."
|
|
11
47
|
pwd: "show pwd."
|
|
12
48
|
usage:
|
|
49
|
+
amg: "$ amg [-h | --help] <command>"
|
|
13
50
|
cd: "$ cd <name>"
|
|
14
51
|
config: "$ config"
|
|
15
52
|
config_set: "$ config set <var_name> <var_value>"
|
|
16
53
|
exit: "$ exit"
|
|
54
|
+
help: "$ help"
|
|
17
55
|
ll: "$ ll"
|
|
18
56
|
ls: "$ ls"
|
|
19
57
|
pwd: "$ pwd"
|
|
20
58
|
constants:
|
|
21
59
|
commands: "COMMANDS"
|
|
60
|
+
subcommands: "SUBCOMMANDS"
|
|
22
61
|
views:
|
|
23
62
|
dom:
|
|
24
|
-
title: "
|
|
25
|
-
description: "
|
|
63
|
+
title: "ready to go..."
|
|
64
|
+
description: "awaiting input..."
|
|
26
65
|
quick_navigation: "the following room names are reserved for quick navigation. enter any of them to navigate to that room."
|
|
27
66
|
game:
|
|
28
|
-
title: "aro"
|
|
67
|
+
title: "you are playing aro..."
|
|
29
68
|
description: "enter commands to play."
|
|
30
69
|
is_the: "welcome to the %{name} game room."
|
|
31
70
|
designed_for: "originally designed for %{description}"
|
data/locale/en.dom.yml
CHANGED
|
@@ -26,8 +26,8 @@ en:
|
|
|
26
26
|
description: "definition management."
|
|
27
27
|
temple:
|
|
28
28
|
description: "mindfulness management."
|
|
29
|
-
|
|
30
|
-
description: "user
|
|
29
|
+
config:
|
|
30
|
+
description: "user config and configuration."
|
|
31
31
|
errors:
|
|
32
32
|
directory_exists: "unable to create arodome at %{name}. file or directory already exists."
|
|
33
33
|
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
|
|
|
@@ -101,7 +101,7 @@ en:
|
|
|
101
101
|
shuffles the current deck and generates a log record.
|
|
102
102
|
|
|
103
103
|
dom
|
|
104
|
-
|
|
104
|
+
aos arodome management.
|
|
105
105
|
|
|
106
106
|
$ aro dom <commands>
|
|
107
107
|
|
data/locale/en.yml
CHANGED
|
@@ -72,6 +72,7 @@ en:
|
|
|
72
72
|
|
|
73
73
|
see aro --help for usage.
|
|
74
74
|
deck_created_sucessfully: "%{name} deck created successfully"
|
|
75
|
+
deck_selected: "%{name} deck selected in the %{room} room."
|
|
75
76
|
drawing: "drawing a card from %{name}"
|
|
76
77
|
drawing_from_dimension: "in the the %{dimension} dimension..."
|
|
77
78
|
ruby_facot_random: |
|
data/sys/aos/amg.rb
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
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("aos.amg.commands.description.inst"),
|
|
21
|
+
usage: I18n.t("aos.amg.commands.usage.inst"),
|
|
22
|
+
},
|
|
23
|
+
INSTUN: {
|
|
24
|
+
key: :instun,
|
|
25
|
+
description: I18n.t("aos.amg.commands.description.instun"),
|
|
26
|
+
usage: I18n.t("aos.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
|
+
lib_name = args[Aro::Mancy::OS]
|
|
46
|
+
lib = Aos::Lib.find_by(name: lib_name)
|
|
47
|
+
unless lib.nil?
|
|
48
|
+
if lib.installed?
|
|
49
|
+
self.instance.display_lines << "#{lib_name} lib is already installed."
|
|
50
|
+
else
|
|
51
|
+
Aos::Amg.install(lib)
|
|
52
|
+
if lib.reload.installed?
|
|
53
|
+
self.instance.display_lines << "#{lib_name} installed successfully."
|
|
54
|
+
self.instance.display_lines += self.inst_lines
|
|
55
|
+
return true
|
|
56
|
+
else
|
|
57
|
+
self.instance.display_lines << "failed to install #{lib_name}."
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
else
|
|
61
|
+
self.instance.display_lines << "could not find #{lib_name} lib."
|
|
62
|
+
end
|
|
63
|
+
else
|
|
64
|
+
# list installed libs
|
|
65
|
+
Aos::Amg.inst
|
|
66
|
+
return true
|
|
67
|
+
end
|
|
68
|
+
when Aos::Amg::CMDS[:INSTUN][:key]
|
|
69
|
+
unless args[Aro::Mancy::OS].nil?
|
|
70
|
+
lib_name = args[Aro::Mancy::OS]
|
|
71
|
+
lib = Aos::Lib.find_by(name: lib_name)
|
|
72
|
+
unless lib.nil?
|
|
73
|
+
if lib.available?
|
|
74
|
+
self.instance.display_lines << "#{lib_name} lib is not installed."
|
|
75
|
+
else
|
|
76
|
+
Aos::Amg.uninstall(lib)
|
|
77
|
+
if lib.reload.available?
|
|
78
|
+
self.instance.display_lines << "#{lib_name} uninstalled successfully."
|
|
79
|
+
self.instance.display_lines += self.instun_lines
|
|
80
|
+
return true
|
|
81
|
+
else
|
|
82
|
+
self.instance.display_lines << "failed to uninstall #{lib_name}."
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
else
|
|
86
|
+
self.instance.display_lines << "could not find #{lib_name} lib."
|
|
87
|
+
end
|
|
88
|
+
else
|
|
89
|
+
# list available libs
|
|
90
|
+
Aos::Amg.instun
|
|
91
|
+
return true
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
return false
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def self.load(lib)
|
|
99
|
+
Aos::Lib.find_or_create_by(name: lib)
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def self.install(lib)
|
|
103
|
+
return unless lib.kind_of?(Aos::Lib)
|
|
104
|
+
lib.installed!
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def self.uninstall(lib)
|
|
108
|
+
return unless lib.kind_of?(Aos::Lib)
|
|
109
|
+
lib.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 libs
|
|
141
|
+
lines = []
|
|
142
|
+
lines << ""
|
|
143
|
+
installed_libs = Aos::Lib.where(status: :installed)
|
|
144
|
+
unless installed_libs.any?
|
|
145
|
+
lines << I18n.t("aos.amg.lib.none_installed")
|
|
146
|
+
else
|
|
147
|
+
lines << I18n.t("aos.amg.lib.listing_installed")
|
|
148
|
+
installed_libs.each_with_index{|lib, i|
|
|
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
|
+
}
|
|
154
|
+
end
|
|
155
|
+
lines << ""
|
|
156
|
+
|
|
157
|
+
lines
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
def self.instun_lines
|
|
161
|
+
# list installed libs
|
|
162
|
+
lines = []
|
|
163
|
+
lines << ""
|
|
164
|
+
available_libs = Aos::Lib.where(status: :available)
|
|
165
|
+
unless available_libs.any?
|
|
166
|
+
lines << I18n.t("aos.amg.lib.none_available")
|
|
167
|
+
else
|
|
168
|
+
lines << I18n.t("aos.amg.lib.listing_available")
|
|
169
|
+
available_libs.each_with_index{|lib, i|
|
|
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
|
+
}
|
|
175
|
+
end
|
|
176
|
+
lines << ""
|
|
177
|
+
|
|
178
|
+
lines
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
end
|
|
182
|
+
end
|