aro 0.1.9 → 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 +3 -3
- data/bin/aro +3 -3
- data/checksums/aro-0.2.0.gem.sha512 +1 -0
- data/listen.rb +1 -1
- data/locale/en.aos.yml +46 -7
- data/locale/en.cards.yml +156 -156
- data/locale/en.dom.yml +2 -2
- data/locale/en.usage.yml +3 -9
- data/locale/en.yml +4 -0
- data/sys/aos/amg.rb +182 -0
- data/sys/aos/aos.rb +253 -120
- data/sys/aos/db/migrate/1765762724_create_libs.rb +22 -0
- data/sys/aos/db.rb +17 -10
- data/sys/aos/vws/base.rb +169 -0
- 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 +19 -16
- 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 +5 -3
- data/sys/aro/db.rb +13 -6
- data/sys/aro/mancy.rb +1 -0
- data/sys/aro/v.rb +1 -1
- data/sys/cli/deck.rb +22 -8
- data/sys/cli.rb +8 -9
- data/sys/{cli → dom}/config.rb +170 -144
- data/sys/dom/d.rb +10 -5
- data/sys/dom/dom.rb +7 -3
- data/sys/models/deck.rb +24 -20
- data/sys/reiquire.rb +5 -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 +17 -3
- data/sys/shr/version.rb +2 -6
- metadata +52 -23
- data/sys/aos/views/base.rb +0 -155
- 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
data/sys/dom/d.rb
CHANGED
|
@@ -63,9 +63,13 @@ module Aro
|
|
|
63
63
|
},
|
|
64
64
|
},
|
|
65
65
|
SETUP: {
|
|
66
|
-
|
|
67
|
-
name: Aro::Dom::
|
|
68
|
-
description: I18n.t("dom.rooms.
|
|
66
|
+
CONFIG: {
|
|
67
|
+
name: Aro::Dom::CONFIG,
|
|
68
|
+
description: I18n.t("dom.rooms.config.description"),
|
|
69
|
+
},
|
|
70
|
+
AMG: {
|
|
71
|
+
name: Aro::Dom::AMG,
|
|
72
|
+
description: I18n.t("dom.rooms.amg.description"),
|
|
69
73
|
},
|
|
70
74
|
},
|
|
71
75
|
}
|
|
@@ -95,14 +99,15 @@ module Aro
|
|
|
95
99
|
description: I18n.t("dom.wings.know.description"),
|
|
96
100
|
rooms: [
|
|
97
101
|
Aro::Dom::D::WINGS[:KNOW][:LIBRARY],
|
|
98
|
-
Aro::Dom::D::WINGS[:KNOW][:TEMPLE]
|
|
102
|
+
Aro::Dom::D::WINGS[:KNOW][:TEMPLE],
|
|
99
103
|
],
|
|
100
104
|
},
|
|
101
105
|
SETUP: {
|
|
102
106
|
name: Aro::Dom::SETUP,
|
|
103
107
|
description: I18n.t("dom.wings.setup.description"),
|
|
104
108
|
rooms: [
|
|
105
|
-
Aro::Dom::D::WINGS[:SETUP][:
|
|
109
|
+
Aro::Dom::D::WINGS[:SETUP][:CONFIG],
|
|
110
|
+
Aro::Dom::D::WINGS[:SETUP][:AMG],
|
|
106
111
|
],
|
|
107
112
|
}
|
|
108
113
|
}
|
data/sys/dom/dom.rb
CHANGED
|
@@ -43,7 +43,8 @@ module Aro
|
|
|
43
43
|
# ...
|
|
44
44
|
|
|
45
45
|
# > setup spaces
|
|
46
|
-
|
|
46
|
+
CONFIG = :config
|
|
47
|
+
AMG = :amg
|
|
47
48
|
# ...
|
|
48
49
|
|
|
49
50
|
def self.create(name)
|
|
@@ -68,11 +69,13 @@ module Aro
|
|
|
68
69
|
end
|
|
69
70
|
|
|
70
71
|
def self.is_initialized?
|
|
72
|
+
return false if !Aro::Dom.in_arodom?
|
|
73
|
+
|
|
71
74
|
File.exist?(File.join(Aro::Dom::ethergeist_path, Aos::Db::SQL_FILE.to_s))
|
|
72
75
|
end
|
|
73
76
|
|
|
74
77
|
def self.domain
|
|
75
|
-
"#{Aro::Dom}#{Aos::Os::A}#{Aro::Dom.ethergeist_name}"
|
|
78
|
+
"#{Aos::Os.instance.you.nil? ? Aro::Dom : Aos::Os.instance.you.name}#{Aos::Os::A}#{Aro::Dom.ethergeist_name}"
|
|
76
79
|
end
|
|
77
80
|
|
|
78
81
|
def self.dom_root
|
|
@@ -111,6 +114,7 @@ module Aro
|
|
|
111
114
|
search_path.any?{|step|
|
|
112
115
|
search_pwd = File.join(search_pwd, step)
|
|
113
116
|
ls = Dir.glob("#{search_pwd}/#{ETHER_FILE}", File::FNM_DOTMATCH)
|
|
117
|
+
|
|
114
118
|
path = ls.first if ls.any?
|
|
115
119
|
!path.nil?
|
|
116
120
|
}
|
|
@@ -155,7 +159,7 @@ module Aro
|
|
|
155
159
|
FileUtils.mkdir(room_path)
|
|
156
160
|
|
|
157
161
|
if wing[:name] == Aro::Dom::GAMES
|
|
158
|
-
File.open(File.join(room_path, Aro::Mancy::NAME_FILE.to_s), "w
|
|
162
|
+
File.open(File.join(room_path, Aro::Mancy::NAME_FILE.to_s), "w") do |f|
|
|
159
163
|
f.write(room[:name])
|
|
160
164
|
end
|
|
161
165
|
end
|
data/sys/models/deck.rb
CHANGED
|
@@ -24,11 +24,7 @@ class Aro::Deck < ActiveRecord::Base
|
|
|
24
24
|
return nil unless Aro::Mancy.is_initialized?
|
|
25
25
|
Aro::Db.new
|
|
26
26
|
new_deck = Aro::Deck.create(name: new_name)
|
|
27
|
-
if Aro::Deck.current_deck.nil?
|
|
28
|
-
File.open(Aro::Deck::DECK_FILE.to_s, "w") do |file|
|
|
29
|
-
file.write(new_deck.id)
|
|
30
|
-
end
|
|
31
|
-
end
|
|
27
|
+
Aro::Deck.select_deck(new_deck) if Aro::Deck.current_deck.nil?
|
|
32
28
|
new_deck
|
|
33
29
|
end
|
|
34
30
|
|
|
@@ -55,17 +51,17 @@ class Aro::Deck < ActiveRecord::Base
|
|
|
55
51
|
Aro::P.say(I18n.t("cli.messages.no_decks"))
|
|
56
52
|
exit(CLI::EXIT_CODES[:SUCCESS])
|
|
57
53
|
end
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
Aro::
|
|
61
|
-
if d.id == Aro::Deck.current_deck&.id
|
|
62
|
-
menu.default d.id
|
|
63
|
-
end
|
|
64
|
-
menu.choice(d.name, d.id)
|
|
65
|
-
}
|
|
54
|
+
c_d = Aro::Deck.current_deck
|
|
55
|
+
Aro::Deck.all.each do |d|
|
|
56
|
+
Aro::P.say("#{d.id == c_d.id ? :*.to_s : " "}#{d.id}): #{d.name}")
|
|
66
57
|
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def self.select_deck(deck)
|
|
61
|
+
return unless deck.present?
|
|
62
|
+
Aro::P.say(I18n.t("cli.messages.deck_selected", name: deck.name, room: Aro::Mancy::aro_mancy_name))
|
|
67
63
|
File.open(Aro::Deck::DECK_FILE.to_s, "w") do |file|
|
|
68
|
-
file.write(
|
|
64
|
+
file.write(deck.id)
|
|
69
65
|
end
|
|
70
66
|
end
|
|
71
67
|
|
|
@@ -104,11 +100,11 @@ class Aro::Deck < ActiveRecord::Base
|
|
|
104
100
|
# Aro::V.say("h_logs.count: #{h_logs.count}")
|
|
105
101
|
|
|
106
102
|
# for now tests just expect text output
|
|
107
|
-
return h_logs if
|
|
103
|
+
return h_logs if Aro::Config.is_test?
|
|
108
104
|
|
|
109
105
|
Aro::D.say(I18n.t("cli.messages.showing", name: name, count: count_n, order: order_o))
|
|
110
106
|
|
|
111
|
-
Aos::
|
|
107
|
+
Aos::Vw::Game.show_game({
|
|
112
108
|
deck: self,
|
|
113
109
|
h_logs: h_logs,
|
|
114
110
|
count_n: count_n,
|
|
@@ -119,15 +115,23 @@ class Aro::Deck < ActiveRecord::Base
|
|
|
119
115
|
def explore
|
|
120
116
|
# allows user to browse each card in the current deck.
|
|
121
117
|
answer = Aro::P.p.select(
|
|
122
|
-
I18n.t("cli.messages.choose_card"),
|
|
118
|
+
Aro::Mancy::PS1.to_s + I18n.t("cli.messages.choose_card"),
|
|
123
119
|
# formatted for tty-prompt gem
|
|
124
120
|
cards.split(Aro::Deck::CARD_DELIM.to_s).map{|c| [I18n.t("cards.#{Aro::Deck.card_strip(c)}.name"), c]}.to_h,
|
|
125
|
-
per_page: Aro::
|
|
121
|
+
per_page: Aro::Config.display_configuration[:HEIGHT] - Aro::Mancy::S,
|
|
126
122
|
cycle: true,
|
|
127
123
|
default: Aro::Mancy::S
|
|
128
124
|
)
|
|
129
|
-
|
|
130
|
-
|
|
125
|
+
# {name: "four of swords", tag_list: ["lord of rest from strife", "libra", "jupiter", "introspection", "recuperation", "regain strength", "rest", "solitude", "stability"], reversed_tag_list: ["lord of rest from strife", "libra", "jupiter", "burnt out", "inundated", "need a break", "overwhelmed"], summary: "", reversed_summary: ""}
|
|
126
|
+
definition = I18n.t("cards.#{Aro::Deck.card_strip(answer)}")
|
|
127
|
+
indent = Aro::Mancy::N
|
|
128
|
+
Aro::P.say(definition[:name])
|
|
129
|
+
Aro::P.say(definition[:summary])
|
|
130
|
+
Aro::P.say("tags:")
|
|
131
|
+
definition[:tag_list].sort.each{|tl| Aro::P.say("".rjust(indent) + tl)}
|
|
132
|
+
Aro::P.say(definition[:reversed_summary])
|
|
133
|
+
Aro::P.say("reverse tags:")
|
|
134
|
+
definition[:reversed_tag_list].sort.each{|tl| Aro::P.say("".rjust(indent) + tl)}
|
|
131
135
|
end
|
|
132
136
|
|
|
133
137
|
def shuffle
|
data/sys/reiquire.rb
CHANGED
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
require :active_record.to_s
|
|
13
13
|
require :"active_record/schema_dumper".to_s
|
|
14
14
|
require :base64.to_s
|
|
15
|
+
require :ffi.to_s
|
|
15
16
|
require :fileutils.to_s
|
|
17
|
+
require :"io/console".to_s
|
|
16
18
|
require :i18n.to_s
|
|
17
19
|
require :readline.to_s
|
|
18
20
|
require :"tty-prompt".to_s
|
|
@@ -21,7 +23,7 @@ require :yaml.to_s
|
|
|
21
23
|
module Reiquire
|
|
22
24
|
def self.aro
|
|
23
25
|
locale_path = Gem.loaded_specs[:aro.to_s]&.full_gem_path
|
|
24
|
-
# if
|
|
26
|
+
# if Aro::Config.is_test?
|
|
25
27
|
# locale_path = Dir.pwd
|
|
26
28
|
# end
|
|
27
29
|
|
|
@@ -30,7 +32,7 @@ module Reiquire
|
|
|
30
32
|
I18n.default_locale = :en
|
|
31
33
|
|
|
32
34
|
# require all aro folders
|
|
33
|
-
Reiquire::requires [:aro, :
|
|
35
|
+
Reiquire::requires [:aro, :dom, :cli, :models, :shr, :vws, :aos]
|
|
34
36
|
|
|
35
37
|
# require cli module
|
|
36
38
|
require_relative :"./cli".to_s
|
|
@@ -39,7 +41,7 @@ module Reiquire
|
|
|
39
41
|
def self.requires(dirs)
|
|
40
42
|
dirs.each{|d|
|
|
41
43
|
Dir[
|
|
42
|
-
File.join(__dir__, d.to_s, :"
|
|
44
|
+
File.join(__dir__, d.to_s, :"**/*.rb".to_s)
|
|
43
45
|
].each { |f| require f}
|
|
44
46
|
}
|
|
45
47
|
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#include <stdio.h>
|
|
2
|
+
|
|
3
|
+
#if defined(__clang__) || defined(__gcc__)
|
|
4
|
+
#define EXPORT __attribute__((visibility("default")))
|
|
5
|
+
#define IMPORT
|
|
6
|
+
#define INLINE __attribute__((always_inline)) inline
|
|
7
|
+
#define NOINLINE __attribute((noinline))
|
|
8
|
+
#elif defined(_MSC_VER)
|
|
9
|
+
#define EXPORT __declspec(dllexport)
|
|
10
|
+
#define IMPORT __declspec(dllimport)
|
|
11
|
+
#define INLINE __forceinline
|
|
12
|
+
#define _Static_assert static_assert
|
|
13
|
+
#else
|
|
14
|
+
#define EXPORT __attribute__((visibility("default")))
|
|
15
|
+
#define IMPORT
|
|
16
|
+
#define INLINE static inline
|
|
17
|
+
#define NOINLINE
|
|
18
|
+
#endif
|
|
19
|
+
|
|
20
|
+
char* CRS_str = "Hello World\n";
|
|
21
|
+
|
|
22
|
+
EXPORT char* hello() {
|
|
23
|
+
return CRS_str;
|
|
24
|
+
}
|
|
Binary file
|
|
Binary file
|
data/sys/shr/lib/lib.rb
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
lib.rb
|
|
4
|
+
|
|
5
|
+
aos lib object.
|
|
6
|
+
|
|
7
|
+
by i2097i
|
|
8
|
+
|
|
9
|
+
=end
|
|
10
|
+
|
|
11
|
+
# todo: put in separate file and require it
|
|
12
|
+
# installed lib modules section
|
|
13
|
+
|
|
14
|
+
module CRS
|
|
15
|
+
SO_FILE = :"libcrs.so".to_s
|
|
16
|
+
SO_PATH = File.join(File.dirname(__dir__), :lib.to_s, :crs.to_s, CRS::SO_FILE)
|
|
17
|
+
extend FFI::Library
|
|
18
|
+
ffi_lib CRS::SO_PATH
|
|
19
|
+
attach_function :hello, [], :string
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# installed lib modules section
|
|
23
|
+
|
|
24
|
+
class Aos::Lib < ActiveRecord::Base
|
|
25
|
+
before_create :set_so_path
|
|
26
|
+
|
|
27
|
+
enum :status, [
|
|
28
|
+
:available,
|
|
29
|
+
:installed,
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
def usage
|
|
33
|
+
# todo: each ffi lib should expose a 'usage' method
|
|
34
|
+
CRS.hello.strip
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
private
|
|
38
|
+
|
|
39
|
+
def set_so_path
|
|
40
|
+
# todo make configurable
|
|
41
|
+
self.so_path = CRS::SO_PATH
|
|
42
|
+
end
|
|
43
|
+
end
|
data/sys/shr/prompt.rb
CHANGED
data/sys/shr/t.rb
CHANGED
|
@@ -15,20 +15,34 @@ module Aro
|
|
|
15
15
|
RUBY_FACOT = :"Ruby::Facot".to_s
|
|
16
16
|
|
|
17
17
|
def self.is_dev_tarot?
|
|
18
|
-
|
|
18
|
+
Aro::T.is_dev_tarot_avail? && (
|
|
19
|
+
Aro::Config.ivar(:DIMENSION)&.to_sym ==
|
|
20
|
+
Aro::Config::DMS[:DEV_TAROT]
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def self.is_dev_tarot_avail?
|
|
25
|
+
File.exist?(Aro::T::DEV_TAROT_FILE.to_s)
|
|
19
26
|
end
|
|
20
27
|
|
|
21
28
|
# read dev_tarot
|
|
22
29
|
def self.read_dev_tarot
|
|
23
30
|
dt = nil
|
|
24
|
-
if Aro::T.is_dev_tarot?
|
|
31
|
+
if Aro::T.is_dev_tarot?
|
|
32
|
+
# VERY IMPORTANT!
|
|
25
33
|
File.open(Aro::T::DEV_TAROT_FILE.to_s, "r"){|dtf| dt = dtf.read(Aro::Mancy::N)}
|
|
26
34
|
# VERY IMPORTANT!
|
|
27
35
|
Aro::V.say(I18n.t("cli.very_important", dev_tarot: dt))
|
|
28
36
|
else
|
|
37
|
+
Aro::D.say("error: #{Aro::T::DEV_TAROT_FILE.to_s} not installed.")
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
if dt.nil?
|
|
41
|
+
# fallback on ruby_facot
|
|
29
42
|
Aro::V.say("warning: summoning ruby_facot in #{__method__}")
|
|
30
|
-
dt = Aro::T.summon_ruby_facot
|
|
43
|
+
dt = Aro::T.summon_ruby_facot
|
|
31
44
|
end
|
|
45
|
+
|
|
32
46
|
return dt
|
|
33
47
|
end
|
|
34
48
|
|
data/sys/shr/version.rb
CHANGED
|
@@ -9,10 +9,6 @@
|
|
|
9
9
|
=end
|
|
10
10
|
|
|
11
11
|
module Aro
|
|
12
|
-
VERSION = :"0.1
|
|
13
|
-
RELEASE_NOTES = :"this version".to_s + [
|
|
14
|
-
"adds improved views.",
|
|
15
|
-
"adds aro gameplay within an arodome game room.",
|
|
16
|
-
"adds ability to set config ivars from aos."
|
|
17
|
-
].join(",")
|
|
12
|
+
VERSION = :"0.2.1"
|
|
13
|
+
RELEASE_NOTES = :"this version".to_s + [].join(",")
|
|
18
14
|
end
|
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.1
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- i2097i
|
|
@@ -169,6 +169,26 @@ dependencies:
|
|
|
169
169
|
- - ">="
|
|
170
170
|
- !ruby/object:Gem::Version
|
|
171
171
|
version: 0.23.1
|
|
172
|
+
- !ruby/object:Gem::Dependency
|
|
173
|
+
name: ffi
|
|
174
|
+
requirement: !ruby/object:Gem::Requirement
|
|
175
|
+
requirements:
|
|
176
|
+
- - "~>"
|
|
177
|
+
- !ruby/object:Gem::Version
|
|
178
|
+
version: '1.17'
|
|
179
|
+
- - ">="
|
|
180
|
+
- !ruby/object:Gem::Version
|
|
181
|
+
version: 1.17.2
|
|
182
|
+
type: :runtime
|
|
183
|
+
prerelease: false
|
|
184
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
185
|
+
requirements:
|
|
186
|
+
- - "~>"
|
|
187
|
+
- !ruby/object:Gem::Version
|
|
188
|
+
version: '1.17'
|
|
189
|
+
- - ">="
|
|
190
|
+
- !ruby/object:Gem::Version
|
|
191
|
+
version: 1.17.2
|
|
172
192
|
description: a cli for tarot.
|
|
173
193
|
email:
|
|
174
194
|
- i2097i@hotmail.com
|
|
@@ -194,9 +214,7 @@ files:
|
|
|
194
214
|
- checksums/aro-0.1.7.gem.sha512
|
|
195
215
|
- checksums/aro-0.1.8.gem.sha512
|
|
196
216
|
- checksums/aro-0.1.9.gem.sha512
|
|
197
|
-
-
|
|
198
|
-
- db/migrate/1763432541_create_logs.rb
|
|
199
|
-
- db/migrate/1765148774_create_yous.rb
|
|
217
|
+
- checksums/aro-0.2.0.gem.sha512
|
|
200
218
|
- listen.rb
|
|
201
219
|
- locale/en.aos.yml
|
|
202
220
|
- locale/en.cards.yml
|
|
@@ -204,47 +222,59 @@ files:
|
|
|
204
222
|
- locale/en.dom.yml
|
|
205
223
|
- locale/en.usage.yml
|
|
206
224
|
- locale/en.yml
|
|
225
|
+
- sys/aos/amg.rb
|
|
207
226
|
- sys/aos/aos.rb
|
|
208
227
|
- sys/aos/db.rb
|
|
228
|
+
- sys/aos/db/migrate/1765148774_create_yous.rb
|
|
229
|
+
- sys/aos/db/migrate/1765762724_create_libs.rb
|
|
209
230
|
- sys/aos/s.rb
|
|
210
|
-
- sys/aos/
|
|
211
|
-
- sys/aos/
|
|
212
|
-
- sys/aos/
|
|
213
|
-
- sys/aos/
|
|
214
|
-
- sys/aos/
|
|
215
|
-
- sys/aos/
|
|
216
|
-
- sys/aos/
|
|
217
|
-
- sys/aos/
|
|
218
|
-
- sys/aos/
|
|
219
|
-
- sys/aos/
|
|
220
|
-
- sys/aos/
|
|
221
|
-
- sys/aos/
|
|
222
|
-
- sys/aos/
|
|
223
|
-
- sys/aos/
|
|
224
|
-
- sys/aos/
|
|
225
|
-
- sys/aos/
|
|
231
|
+
- sys/aos/vws/base.rb
|
|
232
|
+
- sys/aos/vws/dom.rb
|
|
233
|
+
- sys/aos/vws/games.rb
|
|
234
|
+
- sys/aos/vws/games/abpps.rb
|
|
235
|
+
- sys/aos/vws/games/game.rb
|
|
236
|
+
- sys/aos/vws/games/hbpps.rb
|
|
237
|
+
- sys/aos/vws/games/shpps.rb
|
|
238
|
+
- sys/aos/vws/games/vipps.rb
|
|
239
|
+
- sys/aos/vws/know.rb
|
|
240
|
+
- sys/aos/vws/know/library.rb
|
|
241
|
+
- sys/aos/vws/know/temple.rb
|
|
242
|
+
- sys/aos/vws/setup.rb
|
|
243
|
+
- sys/aos/vws/setup/amg.rb
|
|
244
|
+
- sys/aos/vws/setup/config.rb
|
|
245
|
+
- sys/aos/vws/welcome.rb
|
|
246
|
+
- sys/aos/vws/welcome/waite.rb
|
|
247
|
+
- sys/aos/vws/welcome/winner.rb
|
|
226
248
|
- sys/aos/you.rb
|
|
227
249
|
- sys/aro.rb
|
|
228
250
|
- sys/aro/d.rb
|
|
229
251
|
- sys/aro/db.rb
|
|
252
|
+
- sys/aro/db/migrate/1763374647_create_decks.rb
|
|
253
|
+
- sys/aro/db/migrate/1763432541_create_logs.rb
|
|
230
254
|
- sys/aro/mancy.rb
|
|
231
255
|
- sys/aro/p.rb
|
|
232
256
|
- sys/aro/r.rb
|
|
233
257
|
- sys/aro/v.rb
|
|
234
258
|
- sys/cli.rb
|
|
235
|
-
- sys/cli/config.rb
|
|
236
259
|
- sys/cli/constants.rb
|
|
237
260
|
- sys/cli/create.rb
|
|
238
261
|
- sys/cli/deck.rb
|
|
239
262
|
- sys/cli/dom.rb
|
|
240
263
|
- sys/cli/nterface.rb
|
|
241
264
|
- sys/cli/usage.rb
|
|
265
|
+
- sys/dom/config.rb
|
|
242
266
|
- sys/dom/d.rb
|
|
243
267
|
- sys/dom/dom.rb
|
|
244
268
|
- sys/dom/p.rb
|
|
245
269
|
- sys/models/deck.rb
|
|
246
270
|
- sys/models/log.rb
|
|
247
271
|
- sys/reiquire.rb
|
|
272
|
+
- sys/shr/lib/crs/CMakeLists.txt
|
|
273
|
+
- sys/shr/lib/crs/compile.sh
|
|
274
|
+
- sys/shr/lib/crs/crs.c
|
|
275
|
+
- sys/shr/lib/crs/crs.o
|
|
276
|
+
- sys/shr/lib/crs/libcrs.so
|
|
277
|
+
- sys/shr/lib/lib.rb
|
|
248
278
|
- sys/shr/prompt.rb
|
|
249
279
|
- sys/shr/t.rb
|
|
250
280
|
- sys/shr/version.rb
|
|
@@ -270,6 +300,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
270
300
|
requirements: []
|
|
271
301
|
rubygems_version: 3.6.9
|
|
272
302
|
specification_version: 4
|
|
273
|
-
summary: this
|
|
274
|
-
room.,adds ability to set config ivars from aos.
|
|
303
|
+
summary: this version
|
|
275
304
|
test_files: []
|
data/sys/aos/views/base.rb
DELETED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
=begin
|
|
2
|
-
|
|
3
|
-
views/base.rb
|
|
4
|
-
|
|
5
|
-
the base view (abstract).
|
|
6
|
-
|
|
7
|
-
by i2097i
|
|
8
|
-
|
|
9
|
-
=end
|
|
10
|
-
|
|
11
|
-
require :aro.to_s
|
|
12
|
-
|
|
13
|
-
module Aos
|
|
14
|
-
module Vi
|
|
15
|
-
class Base
|
|
16
|
-
BAR = :"|".to_s
|
|
17
|
-
MARGIN_V = Aro::Mancy::S
|
|
18
|
-
MARGIN_H = Aro::Mancy::S
|
|
19
|
-
|
|
20
|
-
def self.show(model)
|
|
21
|
-
unless Aro::Mancy.game.nil?
|
|
22
|
-
Aro::Mancy.game.show
|
|
23
|
-
return
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
# default view
|
|
27
|
-
draw([self.name], model)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def self.draw(lines, you = nil)
|
|
31
|
-
return false unless lines.kind_of?(Array)
|
|
32
|
-
|
|
33
|
-
dc = CLI::Config.display_config
|
|
34
|
-
height = dc[:HEIGHT]
|
|
35
|
-
width = dc[:WIDTH]
|
|
36
|
-
|
|
37
|
-
# lines printed
|
|
38
|
-
printed = Aro::Mancy::O
|
|
39
|
-
|
|
40
|
-
# max printable lines
|
|
41
|
-
# vertical margins
|
|
42
|
-
max_lines = height - Aos::Vi::Base::MARGIN_V * Aro::Mancy::OS
|
|
43
|
-
# footer
|
|
44
|
-
max_lines = max_lines + Aro::Mancy::S
|
|
45
|
-
|
|
46
|
-
# header
|
|
47
|
-
Aro::Mancy::S.times do |i|
|
|
48
|
-
printed += Aro::Mancy::OS
|
|
49
|
-
Aos::S.say("".center(width, dc[:DIVIDER]))
|
|
50
|
-
printed += Aro::Mancy::OS
|
|
51
|
-
Aos::S.say("".center(width))
|
|
52
|
-
Aos::S.say("\n")
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
half = ((width - self.name.length) / Aro::Mancy::OS.to_f).ceil
|
|
56
|
-
domain = Aro::Dom.in_arodom? ? Aro::Dom::domain : Aro::Mancy.domain
|
|
57
|
-
clock = Time.now.strftime(Aos::Os::DATE_FORMAT)
|
|
58
|
-
printed += Aro::Mancy::S
|
|
59
|
-
Aos::S.say(
|
|
60
|
-
(
|
|
61
|
-
domain.ljust(half) + self.name.to_s.upcase
|
|
62
|
-
).ljust(width - clock.length) + clock
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
Aro::Mancy::S.times do
|
|
66
|
-
printed += Aro::Mancy::S
|
|
67
|
-
Aos::S.say("".center(width, dc[:DIVIDER]))
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
# top vertical margin
|
|
71
|
-
Aos::Vi::Base::MARGIN_V.times do
|
|
72
|
-
printed += Aro::Mancy::S
|
|
73
|
-
print_regular_line("")
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
# yield => print lines
|
|
77
|
-
lines.each{|line|
|
|
78
|
-
next if printed == max_lines
|
|
79
|
-
|
|
80
|
-
printed += Aro::Mancy::S
|
|
81
|
-
print_regular_line(line)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
# fill empty space
|
|
85
|
-
while printed < max_lines
|
|
86
|
-
printed += Aro::Mancy::S
|
|
87
|
-
print_regular_line("")
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
# bottom vertical margin
|
|
91
|
-
Aos::Vi::Base::MARGIN_V.times do
|
|
92
|
-
printed += Aro::Mancy::S
|
|
93
|
-
Aos::S.say("[#{Aos::Os} v#{Aro::VERSION.to_s}]".center(width, :"-".to_s))
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
-
# footer
|
|
97
|
-
dimension = (Aro::T.is_dev_tarot? ? Aro::T::DEV_TAROT : Aro::T::RUBY_FACOT)
|
|
98
|
-
dt = Aro::T.read_dev_tarot.strip[Aro::Mancy::S..]
|
|
99
|
-
display_dim = "#{dt.rjust(Aro::Mancy::V)} :<[#{dimension}]<"
|
|
100
|
-
Aos::S.say(
|
|
101
|
-
(
|
|
102
|
-
">#{domain}>#{Aos::Os::osify(you&.pwd || Dir.pwd)}"
|
|
103
|
-
).ljust(width - display_dim.length) + display_dim
|
|
104
|
-
)
|
|
105
|
-
Aos::S.say("".center(width, dc[:DIVIDER]))
|
|
106
|
-
|
|
107
|
-
# debug logging
|
|
108
|
-
Aro::D.say("invalid printed height: #{height}, printed: #{printed}") if printed != height
|
|
109
|
-
|
|
110
|
-
# explicitly return true
|
|
111
|
-
true
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
def self.viewport_width
|
|
115
|
-
dc = CLI::Config.display_config
|
|
116
|
-
width = dc[:WIDTH]
|
|
117
|
-
bar_width = (Aos::Vi::Base::BAR.length * Aro::Mancy::OS)
|
|
118
|
-
h_margin_width = (Aos::Vi::Base::MARGIN_H * Aro::Mancy::OS)
|
|
119
|
-
|
|
120
|
-
(width - (bar_width + h_margin_width))
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
def self.print_regular_line(line)
|
|
124
|
-
hm = Aos::Vi::Base::MARGIN_H
|
|
125
|
-
bar = Aos::Vi::Base::BAR
|
|
126
|
-
hm_space = " " * Aos::Vi::Base::MARGIN_H
|
|
127
|
-
just = CLI::Config.display_config[:WIDTH] - (hm_space.length + bar.length)
|
|
128
|
-
Aos::S.say((bar + hm_space + (line || "")).ljust(just) + hm_space + bar)
|
|
129
|
-
end
|
|
130
|
-
|
|
131
|
-
def self.lines_for_cmd(cmd)
|
|
132
|
-
just_cmds = Aro::Mancy::NUMERALS[:IX]
|
|
133
|
-
cmd_lines = []
|
|
134
|
-
key_proc = Proc.new{|k| "$ #{k}"}
|
|
135
|
-
desc_proc = Proc.new{|desc| "#{"desc:".rjust(just_cmds)} #{desc}"}
|
|
136
|
-
usage_proc = Proc.new{|usage| "#{"usage:".rjust(just_cmds)} #{usage}"}
|
|
137
|
-
|
|
138
|
-
cmd_lines << key_proc.call(cmd[:key])
|
|
139
|
-
cmd_lines << desc_proc.call(cmd[:description])
|
|
140
|
-
cmd_lines << usage_proc.call(cmd[:usage])
|
|
141
|
-
(cmd[:cmds] || []).each{|k, v|
|
|
142
|
-
cmd_lines << key_proc.call("#{cmd[:key]} #{v[:key]}")
|
|
143
|
-
cmd_lines << desc_proc.call(v[:description])
|
|
144
|
-
cmd_lines << usage_proc.call(v[:usage])
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
cmd_lines
|
|
148
|
-
end
|
|
149
|
-
|
|
150
|
-
def self.debug_log(lines)
|
|
151
|
-
Aro::V.say(lines)
|
|
152
|
-
end
|
|
153
|
-
end
|
|
154
|
-
end
|
|
155
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
=begin
|
|
2
|
-
|
|
3
|
-
views/games/abpps.rb
|
|
4
|
-
|
|
5
|
-
the apbbs view.
|
|
6
|
-
|
|
7
|
-
by i2097i
|
|
8
|
-
|
|
9
|
-
=end
|
|
10
|
-
|
|
11
|
-
require_relative :"./game".to_s
|
|
12
|
-
|
|
13
|
-
module Aos
|
|
14
|
-
module Vi
|
|
15
|
-
class Abpps < Aos::Vi::Game
|
|
16
|
-
def self.show(model)
|
|
17
|
-
draw(super, model)
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
=begin
|
|
2
|
-
|
|
3
|
-
views/games/hbpps.rb
|
|
4
|
-
|
|
5
|
-
the hpbbs view.
|
|
6
|
-
|
|
7
|
-
by i2097i
|
|
8
|
-
|
|
9
|
-
=end
|
|
10
|
-
|
|
11
|
-
require_relative :"./game".to_s
|
|
12
|
-
|
|
13
|
-
module Aos
|
|
14
|
-
module Vi
|
|
15
|
-
class Hbpps < Aos::Vi::Game
|
|
16
|
-
def self.show(model)
|
|
17
|
-
draw(super, model)
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|