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/aos/vws/base.rb
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
vws/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 Vw
|
|
15
|
+
class Base
|
|
16
|
+
BAR = :"".to_s
|
|
17
|
+
COL_POW = Proc.new{|n| n.pow(Aro::Mancy::S.to_f / Aro::Mancy::OS.to_f).to_i}
|
|
18
|
+
MARGIN_V = Aro::Mancy::S
|
|
19
|
+
MARGIN_H = Aro::Mancy::S
|
|
20
|
+
|
|
21
|
+
def self.show
|
|
22
|
+
draw([self.name])
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def self.get_json(lines)
|
|
26
|
+
{
|
|
27
|
+
body: lines,
|
|
28
|
+
you: Aos::Os.instance.you.to_json,
|
|
29
|
+
domain: self.get_domain,
|
|
30
|
+
clock: self.get_clock,
|
|
31
|
+
dimension: self.get_dimension,
|
|
32
|
+
dev_tarot: self.get_dt,
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def self.draw(body_lines)
|
|
37
|
+
unless Aro::Config.is_format_text?
|
|
38
|
+
Aos::S.say(self.get_json(lines))
|
|
39
|
+
return true
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
return false unless body_lines.kind_of?(Array)
|
|
43
|
+
lines = []
|
|
44
|
+
dc = Aro::Config.display_configuration
|
|
45
|
+
height = dc[:HEIGHT]
|
|
46
|
+
width = dc[:WIDTH]
|
|
47
|
+
|
|
48
|
+
# header
|
|
49
|
+
# lines << "".center(width, "=")
|
|
50
|
+
# lines << "".center(width)
|
|
51
|
+
|
|
52
|
+
# half = ((width - self.name.length) / Aro::Mancy::OS.to_f).ceil
|
|
53
|
+
# domain = self.get_domain
|
|
54
|
+
# clock = self.get_clock
|
|
55
|
+
# lines << (
|
|
56
|
+
# (
|
|
57
|
+
# domain.ljust(half) + self.name.to_s.upcase
|
|
58
|
+
# ).ljust(width - clock.length) + clock
|
|
59
|
+
# )
|
|
60
|
+
|
|
61
|
+
# lines << "".center(width, dc[:DIVIDER])
|
|
62
|
+
|
|
63
|
+
# top vertical margin
|
|
64
|
+
Aos::Vw::Base::MARGIN_V.times do
|
|
65
|
+
lines << get_body_line("")
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# yield => print lines
|
|
69
|
+
body_lines.each{|line|
|
|
70
|
+
lines << get_body_line(line)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
lines += get_aos_display_lines
|
|
74
|
+
|
|
75
|
+
# footer
|
|
76
|
+
# display_dim = self.get_display_dimension
|
|
77
|
+
# lines << (
|
|
78
|
+
# (
|
|
79
|
+
# ">[#{domain}]>#{Aos::Os::osify(Aos::Os.instance.you&.pwd || Dir.pwd)}"
|
|
80
|
+
# ).ljust(width - display_dim.length) + display_dim
|
|
81
|
+
# )
|
|
82
|
+
|
|
83
|
+
# print everything
|
|
84
|
+
Aos::S.say(lines.join("\n"))
|
|
85
|
+
|
|
86
|
+
# explicitly return true
|
|
87
|
+
true
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def self.get_aos_display_lines
|
|
91
|
+
# current Aos::Os output
|
|
92
|
+
lines = []
|
|
93
|
+
unless Aos::Os.instance.display_lines.empty?
|
|
94
|
+
dc = Aro::Config.display_configuration
|
|
95
|
+
width = dc[:WIDTH]
|
|
96
|
+
lines << "".center(width)
|
|
97
|
+
display_dim = get_display_dimension
|
|
98
|
+
Aos::Os.instance.display_lines.each{|line|
|
|
99
|
+
lines << line
|
|
100
|
+
}
|
|
101
|
+
lines << "".center(width)
|
|
102
|
+
lines << "v#{Aro::VERSION.to_s}".ljust(width - display_dim.length) + display_dim
|
|
103
|
+
# lines << "".center(width, "=")
|
|
104
|
+
end
|
|
105
|
+
lines
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
def self.get_display_dimension
|
|
109
|
+
"#{self.get_dt.rjust(Aro::Mancy::V)} :<[#{self.get_dimension}]<"
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
def self.get_dt
|
|
113
|
+
Aro::T.read_dev_tarot.strip[Aro::Mancy::S..]
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def self.get_dimension
|
|
117
|
+
(Aro::T.is_dev_tarot? ? Aro::T::DEV_TAROT : Aro::T::RUBY_FACOT)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
def self.get_domain
|
|
121
|
+
Aro::Dom.in_arodom? ? Aro::Dom::domain : Aro::Mancy.domain
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
def self.get_clock
|
|
125
|
+
Time.now.strftime(Aos::Os::DATE_FORMAT)
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
def self.viewport_width
|
|
129
|
+
dc = Aro::Config.display_configuration
|
|
130
|
+
width = dc[:WIDTH]
|
|
131
|
+
bar_width = (Aos::Vw::Base::BAR.length * Aro::Mancy::OS)
|
|
132
|
+
h_margin_width = (Aos::Vw::Base::MARGIN_H * Aro::Mancy::OS)
|
|
133
|
+
|
|
134
|
+
(width - (bar_width + h_margin_width))
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
def self.get_body_line(line)
|
|
138
|
+
hm = Aos::Vw::Base::MARGIN_H
|
|
139
|
+
bar = Aos::Vw::Base::BAR
|
|
140
|
+
hm_space = " " * Aos::Vw::Base::MARGIN_H
|
|
141
|
+
just = Aro::Config.display_configuration[:WIDTH] - (hm_space.length + bar.length)
|
|
142
|
+
(bar + hm_space + (line || "")).ljust(just) + hm_space + bar
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
def self.lines_for_cmd(cmd)
|
|
146
|
+
just_cmds = Aro::Mancy::NUMERALS[:IX]
|
|
147
|
+
cmd_lines = []
|
|
148
|
+
key_proc = Proc.new{|k| "$ #{k}"}
|
|
149
|
+
desc_proc = Proc.new{|desc| "#{"desc:".rjust(just_cmds)} #{desc}"}
|
|
150
|
+
usage_proc = Proc.new{|usage| "#{"usage:".rjust(just_cmds)} #{usage}"}
|
|
151
|
+
|
|
152
|
+
cmd_lines << key_proc.call(cmd[:key])
|
|
153
|
+
cmd_lines << desc_proc.call(cmd[:description])
|
|
154
|
+
cmd_lines << usage_proc.call(cmd[:usage])
|
|
155
|
+
(cmd[:cmds] || []).each{|k, v|
|
|
156
|
+
cmd_lines << key_proc.call("#{cmd[:key]} #{v[:key]}")
|
|
157
|
+
cmd_lines << desc_proc.call(v[:description])
|
|
158
|
+
cmd_lines << usage_proc.call(v[:usage])
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
cmd_lines
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
def self.debug_log(lines)
|
|
165
|
+
Aro::V.say(lines)
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
vws/dom.rb
|
|
4
4
|
|
|
5
5
|
the dom view.
|
|
6
6
|
|
|
@@ -11,25 +11,22 @@
|
|
|
11
11
|
require_relative :"./base".to_s
|
|
12
12
|
|
|
13
13
|
module Aos
|
|
14
|
-
module
|
|
15
|
-
class Dom < Aos::
|
|
14
|
+
module Vw
|
|
15
|
+
class Dom < Aos::Vw::Base
|
|
16
16
|
|
|
17
|
-
def self.show
|
|
17
|
+
def self.show
|
|
18
18
|
lines = []
|
|
19
19
|
lines << I18n.t("aos.views.dom.title")
|
|
20
20
|
lines << I18n.t("aos.views.dom.description")
|
|
21
21
|
lines << ""
|
|
22
22
|
lines << I18n.t("aos.constants.commands")
|
|
23
|
-
Aos::Os::CMDS
|
|
24
|
-
lines += lines_for_cmd(Aos::Os::CMDS[cmd])
|
|
25
|
-
}
|
|
26
|
-
|
|
23
|
+
lines += lines_for_cmd(Aos::Os::CMDS[:HELP])
|
|
27
24
|
lines << ""
|
|
28
25
|
lines << I18n.t("aos.views.dom.quick_navigation")
|
|
29
26
|
lines << ""
|
|
30
27
|
lines << " => #{Aro::Dom::D.reserved_words.join(" ")}"
|
|
31
28
|
lines << ""
|
|
32
|
-
draw(lines
|
|
29
|
+
draw(lines)
|
|
33
30
|
end
|
|
34
31
|
end
|
|
35
32
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
vws/games/game.rb
|
|
4
4
|
|
|
5
5
|
the game view.
|
|
6
6
|
|
|
@@ -12,8 +12,8 @@ require_relative :"../../../models/deck".to_s
|
|
|
12
12
|
require_relative :"../base".to_s
|
|
13
13
|
|
|
14
14
|
module Aos
|
|
15
|
-
module
|
|
16
|
-
class Game < Aos::
|
|
15
|
+
module Vw
|
|
16
|
+
class Game < Aos::Vw::Base
|
|
17
17
|
|
|
18
18
|
DECK_PARAMS = [
|
|
19
19
|
:deck,
|
|
@@ -22,7 +22,7 @@ module Aos
|
|
|
22
22
|
:order_o,
|
|
23
23
|
]
|
|
24
24
|
|
|
25
|
-
def self.show
|
|
25
|
+
def self.show
|
|
26
26
|
unless Aro::Mancy.game.nil?
|
|
27
27
|
Aro::Mancy.game.show
|
|
28
28
|
return
|
|
@@ -33,19 +33,19 @@ module Aos
|
|
|
33
33
|
lines << I18n.t("aos.views.game.description").center(viewport_width)
|
|
34
34
|
|
|
35
35
|
room_def = Aro::Dom::D::WINGS[:GAMES].values.filter{|gr|
|
|
36
|
-
"#{Aos::
|
|
36
|
+
"#{Aos::Vw.name}::#{gr[:name].to_s.downcase.capitalize}" == self.name
|
|
37
37
|
}.first
|
|
38
38
|
unless room_def.nil?
|
|
39
39
|
lines << I18n.t("aos.views.game.is_the", name: room_def[:name].to_s)
|
|
40
40
|
lines << I18n.t("aos.views.game.designed_for", description: room_def[:description])
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
-
draw(lines
|
|
43
|
+
draw(lines)
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
def self.show_game(model)
|
|
47
47
|
mk = model.keys
|
|
48
|
-
dp = Aos::
|
|
48
|
+
dp = Aos::Vw::Game::DECK_PARAMS
|
|
49
49
|
return nil unless (mk & dp).count == dp.count
|
|
50
50
|
return nil unless model.values.all?{|v| v != nil}
|
|
51
51
|
|
|
@@ -54,23 +54,24 @@ module Aos
|
|
|
54
54
|
count_n = model[:count_n]
|
|
55
55
|
order_o = model[:order_o]
|
|
56
56
|
|
|
57
|
-
dc =
|
|
58
|
-
width = dc[:WIDTH]
|
|
59
|
-
divider = dc[:DIVIDER] *
|
|
57
|
+
dc = Aro::Config.display_configuration
|
|
58
|
+
width = count_n == Aro::Mancy::S ? viewport_width : dc[:WIDTH]
|
|
59
|
+
divider = dc[:DIVIDER] * width
|
|
60
60
|
lines = []
|
|
61
|
+
lines << divider
|
|
61
62
|
lines << "#{deck.name.upcase.center(width)}"
|
|
62
63
|
h_logs.each_with_index{|l, i|
|
|
63
64
|
lines << divider
|
|
64
65
|
lines << ""
|
|
65
|
-
timestamp = l.created_at.strftime(
|
|
66
|
+
timestamp = l.created_at.strftime(Aro::Config::DATE_FORMAT)
|
|
66
67
|
of_text = "#{order_o.to_sym == Aro::Log::ORDERING[:DESC] ? deck.logs.count - i : 1 + i} of #{deck.logs.count}"
|
|
67
68
|
lines << of_text.ljust(width - timestamp.length) + timestamp
|
|
68
69
|
lines << divider
|
|
69
70
|
cards = Base64::decode64(l.card_data).split(Aro::Deck::CARD_DELIM.to_s)
|
|
70
71
|
if !cards.nil? && cards.any?
|
|
71
|
-
lines << ""
|
|
72
|
+
# lines << ""
|
|
72
73
|
lines += self.get_display_for_cards(cards)
|
|
73
|
-
lines << divider
|
|
74
|
+
# lines << divider
|
|
74
75
|
end
|
|
75
76
|
|
|
76
77
|
drawn_cards = Base64::decode64(l.drawn_data).split(Aro::Deck::CARD_DELIM.to_s)
|
|
@@ -82,8 +83,8 @@ module Aos
|
|
|
82
83
|
lines += self.get_display_for_cards(
|
|
83
84
|
drawn_cards
|
|
84
85
|
)
|
|
85
|
-
lines << ""
|
|
86
|
-
lines << divider
|
|
86
|
+
# lines << ""
|
|
87
|
+
# lines << divider
|
|
87
88
|
end
|
|
88
89
|
}
|
|
89
90
|
if count_n == Aro::Mancy::S
|
|
@@ -94,7 +95,9 @@ module Aos
|
|
|
94
95
|
end
|
|
95
96
|
|
|
96
97
|
def self.get_display_for_cards(input = [])
|
|
97
|
-
columns =
|
|
98
|
+
columns = Aos::Vw::Base::COL_POW.call(
|
|
99
|
+
Aro::Config.display_configuration[:WIDTH].to_i
|
|
100
|
+
)
|
|
98
101
|
lines = []
|
|
99
102
|
return lines unless input.any?
|
|
100
103
|
card_line = ""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
vws/know/library.rb
|
|
4
4
|
|
|
5
5
|
the library view.
|
|
6
6
|
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
require_relative :"../base".to_s
|
|
12
12
|
|
|
13
13
|
module Aos
|
|
14
|
-
module
|
|
15
|
-
class Library < Aos::
|
|
14
|
+
module Vw
|
|
15
|
+
class Library < Aos::Vw::Base
|
|
16
16
|
|
|
17
17
|
end
|
|
18
18
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
vws/know/temple.rb
|
|
4
4
|
|
|
5
5
|
the temple view.
|
|
6
6
|
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
require_relative :"../base".to_s
|
|
12
12
|
|
|
13
13
|
module Aos
|
|
14
|
-
module
|
|
15
|
-
class Temple < Aos::
|
|
14
|
+
module Vw
|
|
15
|
+
class Temple < Aos::Vw::Base
|
|
16
16
|
|
|
17
17
|
end
|
|
18
18
|
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
vws/setup/amg.rb
|
|
4
|
+
|
|
5
|
+
the amg view.
|
|
6
|
+
|
|
7
|
+
by i2097i
|
|
8
|
+
|
|
9
|
+
=end
|
|
10
|
+
|
|
11
|
+
require_relative :"../base".to_s
|
|
12
|
+
|
|
13
|
+
module Aos
|
|
14
|
+
module Vw
|
|
15
|
+
class Amg < Aos::Vw::Base
|
|
16
|
+
def self.show
|
|
17
|
+
# draw output
|
|
18
|
+
draw(Aos::Amg.instance.display_lines)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
vws/setup/config.rb
|
|
4
|
+
|
|
5
|
+
the config view.
|
|
6
|
+
|
|
7
|
+
by i2097i
|
|
8
|
+
|
|
9
|
+
=end
|
|
10
|
+
|
|
11
|
+
require_relative :"../base".to_s
|
|
12
|
+
|
|
13
|
+
module Aos
|
|
14
|
+
module Vw
|
|
15
|
+
class Config < Aos::Vw::Base
|
|
16
|
+
def self.show
|
|
17
|
+
draw(Aro::Config.instance.display_lines)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
vws/welcome/waite.rb
|
|
4
|
+
|
|
5
|
+
the welcome waite view.
|
|
6
|
+
|
|
7
|
+
by i2097i
|
|
8
|
+
|
|
9
|
+
=end
|
|
10
|
+
|
|
11
|
+
require_relative :"../base".to_s
|
|
12
|
+
|
|
13
|
+
module Aos
|
|
14
|
+
module Vw
|
|
15
|
+
class Waite < Aos::Vw::Base
|
|
16
|
+
def self.show
|
|
17
|
+
# print all commands
|
|
18
|
+
lines = []
|
|
19
|
+
lines << ""
|
|
20
|
+
lines << I18n.t("aos.constants.commands")
|
|
21
|
+
Aos::Os::CMDS.values.each{|v|
|
|
22
|
+
lines += lines_for_cmd(v)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
# draw output
|
|
26
|
+
draw(lines)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
vws/welcome/winner.rb
|
|
4
4
|
|
|
5
5
|
the welcome winner view.
|
|
6
6
|
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
require_relative :"../base".to_s
|
|
12
12
|
|
|
13
13
|
module Aos
|
|
14
|
-
module
|
|
15
|
-
class Winner < Aos::
|
|
14
|
+
module Vw
|
|
15
|
+
class Winner < Aos::Vw::Base
|
|
16
16
|
|
|
17
17
|
end
|
|
18
18
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
vws/welcome.rb
|
|
4
4
|
|
|
5
5
|
the welcome view.
|
|
6
6
|
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
require_relative :"./base".to_s
|
|
12
12
|
|
|
13
13
|
module Aos
|
|
14
|
-
module
|
|
15
|
-
class Welcome < Aos::
|
|
14
|
+
module Vw
|
|
15
|
+
class Welcome < Aos::Vw::Base
|
|
16
16
|
|
|
17
17
|
end
|
|
18
18
|
end
|
data/sys/aos/you.rb
CHANGED
|
@@ -10,10 +10,12 @@
|
|
|
10
10
|
|
|
11
11
|
module Aos
|
|
12
12
|
class You < ActiveRecord::Base
|
|
13
|
-
|
|
13
|
+
after_update :clear_aos_display
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
private
|
|
16
|
+
|
|
17
|
+
def clear_aos_display
|
|
18
|
+
Aos::Os.instance.display_lines = [Aos::Os.osify(pwd, true)]
|
|
17
19
|
end
|
|
18
20
|
end
|
|
19
21
|
end
|
data/sys/aro/db.rb
CHANGED
|
@@ -11,16 +11,23 @@
|
|
|
11
11
|
module Aro
|
|
12
12
|
class Db
|
|
13
13
|
DATABASE_YML = :"database.yml"
|
|
14
|
-
|
|
15
|
-
SCHEMA_FILE = :"schema.rb"
|
|
14
|
+
GEM_DB_PATH = :"sys/aro/db"
|
|
16
15
|
MIGRATIONS_DIR = :"db/migrate"
|
|
16
|
+
SCHEMA_FILE = :"schema.rb"
|
|
17
|
+
SQL_FILE = :"database.sql"
|
|
17
18
|
|
|
18
19
|
def initialize
|
|
19
|
-
|
|
20
|
+
Aro::Db.configure_logger
|
|
20
21
|
if Aro::Mancy.in_aro?
|
|
21
22
|
setup_local_aro
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def self.configure_logger
|
|
27
|
+
if Aro::Config.ivar(:LOG_ARO_DB).to_s == Aro::Config::BOOLS[:TRUE].to_s
|
|
28
|
+
ActiveRecord::Base.logger = Logger.new(STDOUT)
|
|
22
29
|
else
|
|
23
|
-
|
|
30
|
+
ActiveRecord::Base.logger = nil
|
|
24
31
|
end
|
|
25
32
|
end
|
|
26
33
|
|
|
@@ -34,7 +41,7 @@ module Aro
|
|
|
34
41
|
|
|
35
42
|
def self.base_aro_dir
|
|
36
43
|
base_aro_file = Aro::Mancy::ARO_FILE.to_s
|
|
37
|
-
|
|
44
|
+
Aro::Config.is_test? ? "#{base_aro_file}_test" : base_aro_file
|
|
38
45
|
end
|
|
39
46
|
|
|
40
47
|
def db_config_filepath
|
|
@@ -71,7 +78,7 @@ module Aro
|
|
|
71
78
|
local_migrate_dir = File.join(Aro::Db.base_aro_dir, Aro::Db::MIGRATIONS_DIR.to_s)
|
|
72
79
|
unless Dir.exist?(local_migrate_dir)
|
|
73
80
|
gem_dir = Dir[Gem.loaded_specs[:aro.to_s]&.full_gem_path || '.'].first
|
|
74
|
-
FileUtils.cp_r(File.join(gem_dir,
|
|
81
|
+
FileUtils.cp_r(File.join(gem_dir, Aro::Db::GEM_DB_PATH.to_s), Aro::Db::base_aro_dir)
|
|
75
82
|
end
|
|
76
83
|
|
|
77
84
|
migration_version = Dir["#{local_migrate_dir}/*.rb"].map{|n|
|
data/sys/aro/mancy.rb
CHANGED