aro 0.1.7 → 0.1.8
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/aro.gemspec +3 -3
- data/bin/aos +19 -0
- data/checksums/aro-0.1.7.gem.sha512 +1 -0
- data/checksums/aro-0.1.8.gem.sha512 +1 -0
- data/db/migrate/1763374647_create_decks.rb +3 -0
- data/db/migrate/1763432541_create_logs.rb +1 -0
- data/db/migrate/1765148774_create_yous.rb +19 -0
- data/locale/en.aos.yml +27 -0
- data/locale/en.cngelog.yml +5 -0
- data/locale/en.usage.yml +9 -10
- data/locale/en.yml +46 -31
- data/sys/aos/aos.rb +199 -0
- data/sys/aos/db.rb +81 -0
- data/sys/aos/s.rb +25 -0
- data/sys/aos/views/base.rb +139 -0
- data/sys/aos/views/dom.rb +45 -0
- data/sys/aos/views/games/abpps.rb +21 -0
- data/sys/aos/views/games/deck.rb +95 -0
- data/sys/aos/views/games/game.rb +24 -0
- data/sys/aos/views/games/hbpps.rb +21 -0
- data/sys/aos/views/games/shpps.rb +21 -0
- data/sys/aos/views/games/vipps.rb +21 -0
- data/sys/aos/views/games.rb +19 -0
- data/sys/aos/views/know/library.rb +19 -0
- data/sys/aos/views/know/temple.rb +19 -0
- data/sys/aos/views/know.rb +19 -0
- data/sys/aos/views/setup/settings.rb +50 -0
- data/sys/aos/views/setup.rb +19 -0
- data/sys/aos/views/welcome/waite.rb +19 -0
- data/sys/aos/views/welcome/winner.rb +19 -0
- data/sys/aos/views/welcome.rb +19 -0
- data/sys/aos/you.rb +15 -0
- data/sys/aro/d.rb +1 -1
- data/sys/aro/db.rb +5 -12
- data/sys/aro/mancy.rb +12 -15
- data/sys/aro/p.rb +1 -1
- data/sys/aro/v.rb +2 -3
- data/sys/aro.rb +1 -0
- data/sys/cli/config.rb +168 -104
- data/sys/cli/constants.rb +5 -2
- data/sys/cli/dom.rb +5 -13
- data/sys/cli/nterface.rb +6 -0
- data/sys/dom/d.rb +0 -5
- data/sys/dom/dom.rb +52 -85
- data/sys/models/deck.rb +13 -7
- data/sys/models/log.rb +12 -2
- data/sys/reiquire.rb +2 -2
- data/sys/shr/prompt.rb +8 -4
- data/sys/shr/t.rb +1 -1
- data/sys/shr/version.rb +2 -4
- metadata +50 -27
- data/sys/views/base.rb +0 -29
- data/sys/views/dom.rb +0 -27
- data/sys/views/games/deck.rb +0 -97
- data/sys/views/games/menu.rb +0 -27
- data/sys/views/setup/setup.rb +0 -27
|
@@ -0,0 +1,139 @@
|
|
|
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
|
+
# default view
|
|
22
|
+
draw([self.name], model)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def self.draw(lines, you = nil)
|
|
26
|
+
return false unless lines.kind_of?(Array)
|
|
27
|
+
|
|
28
|
+
dc = CLI::Config.display_config
|
|
29
|
+
height = dc[:HEIGHT]
|
|
30
|
+
width = dc[:WIDTH]
|
|
31
|
+
divider = dc[:DIVIDER] * width
|
|
32
|
+
|
|
33
|
+
# lines printed
|
|
34
|
+
printed = Aro::Mancy::O
|
|
35
|
+
|
|
36
|
+
# max printable lines
|
|
37
|
+
# vertical margins
|
|
38
|
+
max_lines = height - Aos::Vi::Base::MARGIN_V * Aro::Mancy::OS
|
|
39
|
+
# footer
|
|
40
|
+
max_lines = max_lines - Aro::Mancy::OS
|
|
41
|
+
|
|
42
|
+
# header
|
|
43
|
+
Aro::Mancy::S.times do |i|
|
|
44
|
+
printed += Aro::Mancy::S
|
|
45
|
+
Aos::S.say(divider)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
t_divider = dc[:DIVIDER] * ((width - self.name.length) / Aro::Mancy::OS)
|
|
49
|
+
printed += Aro::Mancy::S
|
|
50
|
+
Aos::S.say((t_divider + self.name.to_s.upcase).ljust(width, dc[:DIVIDER]))
|
|
51
|
+
|
|
52
|
+
Aro::Mancy::S.times do
|
|
53
|
+
printed += Aro::Mancy::S
|
|
54
|
+
Aos::S.say(divider)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# top vertical margin
|
|
58
|
+
Aos::Vi::Base::MARGIN_V.times do
|
|
59
|
+
printed += Aro::Mancy::S
|
|
60
|
+
print_regular_line("")
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# print lines
|
|
64
|
+
lines.each{|line|
|
|
65
|
+
next if printed == max_lines
|
|
66
|
+
|
|
67
|
+
printed += Aro::Mancy::S
|
|
68
|
+
print_regular_line(line)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
# fill empty space
|
|
72
|
+
while printed < max_lines
|
|
73
|
+
printed += Aro::Mancy::S
|
|
74
|
+
print_regular_line("")
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# bottom vertical margin
|
|
78
|
+
Aos::Vi::Base::MARGIN_V.times do
|
|
79
|
+
printed += Aro::Mancy::S
|
|
80
|
+
print_regular_line("")
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# footer
|
|
84
|
+
if you.nil?
|
|
85
|
+
Aos::S.say("")
|
|
86
|
+
Aos::S.say("")
|
|
87
|
+
else
|
|
88
|
+
Aos::S.say(divider[Aro::Mancy::O..width - Aro::Mancy::S])
|
|
89
|
+
Aos::S.say("#{Aos::Os}_v#{Aro::VERSION}_#{Aro::Dom}: /#{Aos::Os::osify(you.pwd)}")
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
Aro::D.say("invalid printed height: #{height}, printed: #{printed}") if printed != height
|
|
93
|
+
|
|
94
|
+
# explicitly return true
|
|
95
|
+
true
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def self.viewport_width
|
|
99
|
+
dc = CLI::Config.display_config
|
|
100
|
+
width = dc[:WIDTH]
|
|
101
|
+
bar_width = (Aos::Vi::Base::BAR.length * Aro::Mancy::OS)
|
|
102
|
+
h_margin_width = (Aos::Vi::Base::MARGIN_H * Aro::Mancy::OS)
|
|
103
|
+
|
|
104
|
+
(width - (bar_width + h_margin_width))
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def self.print_regular_line(line)
|
|
108
|
+
hm = Aos::Vi::Base::MARGIN_H
|
|
109
|
+
bar = Aos::Vi::Base::BAR
|
|
110
|
+
hm_space = " " * Aos::Vi::Base::MARGIN_H
|
|
111
|
+
just = CLI::Config.display_config[:WIDTH] - (hm_space.length + bar.length)
|
|
112
|
+
Aos::S.say((bar + hm_space + (line || "")).ljust(just) + hm_space + bar)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def self.lines_for_cmd(cmd)
|
|
116
|
+
just_cmds = Aro::Mancy::NUMERALS[:IX]
|
|
117
|
+
cmd_lines = []
|
|
118
|
+
key_proc = Proc.new{|k| "$ #{k}"}
|
|
119
|
+
desc_proc = Proc.new{|desc| "#{"desc:".rjust(just_cmds)} #{desc}"}
|
|
120
|
+
usage_proc = Proc.new{|usage| "#{"usage:".rjust(just_cmds)} #{usage}"}
|
|
121
|
+
|
|
122
|
+
cmd_lines << key_proc.call(cmd[:key])
|
|
123
|
+
cmd_lines << desc_proc.call(cmd[:description])
|
|
124
|
+
cmd_lines << usage_proc.call(cmd[:usage])
|
|
125
|
+
(cmd[:cmds] || []).each{|k, v|
|
|
126
|
+
cmd_lines << key_proc.call("#{cmd[:key]} #{v[:key]}")
|
|
127
|
+
cmd_lines << desc_proc.call(v[:description])
|
|
128
|
+
cmd_lines << usage_proc.call(v[:usage])
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
cmd_lines
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
def self.debug_log(lines)
|
|
135
|
+
Aro::V.say(lines)
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
views/dom.rb
|
|
4
|
+
|
|
5
|
+
the dom view.
|
|
6
|
+
|
|
7
|
+
by i2097i
|
|
8
|
+
|
|
9
|
+
=end
|
|
10
|
+
|
|
11
|
+
require_relative :"./base".to_s
|
|
12
|
+
|
|
13
|
+
module Aos
|
|
14
|
+
module Vi
|
|
15
|
+
class Dom < Aos::Vi::Base
|
|
16
|
+
|
|
17
|
+
def self.show(model)
|
|
18
|
+
lines = []
|
|
19
|
+
lines << I18n.t("aos.views.dom.title")
|
|
20
|
+
lines << I18n.t("aos.views.dom.description")
|
|
21
|
+
lines << ""
|
|
22
|
+
lines << I18n.t("aos.constants.commands")
|
|
23
|
+
Aos::Os::CMDS.keys.sort.each{|cmd|
|
|
24
|
+
lines += lines_for_cmd(Aos::Os::CMDS[cmd])
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
lines << ""
|
|
28
|
+
lines << I18n.t("aos.views.dom.quick_navigation")
|
|
29
|
+
lines << ""
|
|
30
|
+
just = Aro::Mancy::NUMERALS[:XI]
|
|
31
|
+
converter = Proc.new{|layout|
|
|
32
|
+
"#{layout[:name].to_s.ljust(just)} #{layout[:rooms].map{|r| r[:name].to_s.ljust(just)}.join(" ")}"
|
|
33
|
+
}
|
|
34
|
+
lines << converter.call(Aro::Dom::D::LAYOUT[:WELCOME])
|
|
35
|
+
lines << ""
|
|
36
|
+
lines << converter.call(Aro::Dom::D::LAYOUT[:GAMES])
|
|
37
|
+
lines << ""
|
|
38
|
+
lines << converter.call(Aro::Dom::D::LAYOUT[:KNOW])
|
|
39
|
+
lines << ""
|
|
40
|
+
lines << converter.call(Aro::Dom::D::LAYOUT[:SETUP])
|
|
41
|
+
draw(lines, model)
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
views/games/deck.rb
|
|
4
|
+
|
|
5
|
+
the deck game view.
|
|
6
|
+
|
|
7
|
+
by i2097i
|
|
8
|
+
|
|
9
|
+
=end
|
|
10
|
+
|
|
11
|
+
require_relative :"../base".to_s
|
|
12
|
+
require_relative :"../../../models/deck".to_s
|
|
13
|
+
|
|
14
|
+
module Aos
|
|
15
|
+
module Vi
|
|
16
|
+
class Deck < Aos::Vi::Base
|
|
17
|
+
|
|
18
|
+
PARAMS = [
|
|
19
|
+
:deck,
|
|
20
|
+
:h_logs,
|
|
21
|
+
:count_n,
|
|
22
|
+
:order_o,
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
def self.show(model)
|
|
26
|
+
self.debug_log(model)
|
|
27
|
+
mk = model.keys
|
|
28
|
+
dp = Aos::Vi::Deck::PARAMS
|
|
29
|
+
return nil unless (mk & dp).count == dp.count
|
|
30
|
+
return nil unless model.values.all?{|v| v != nil}
|
|
31
|
+
|
|
32
|
+
deck = model[:deck]
|
|
33
|
+
h_logs = model[:h_logs]
|
|
34
|
+
count_n = model[:count_n]
|
|
35
|
+
order_o = model[:order_o]
|
|
36
|
+
|
|
37
|
+
dc = CLI::Config.display_config
|
|
38
|
+
width = dc[:WIDTH] = viewport_width
|
|
39
|
+
divider = dc[:DIVIDER] * viewport_width
|
|
40
|
+
lines = []
|
|
41
|
+
lines << divider
|
|
42
|
+
lines << ""
|
|
43
|
+
lines << "#{deck.name.upcase.center(width)}"
|
|
44
|
+
lines << ""
|
|
45
|
+
h_logs.each_with_index{|l, i|
|
|
46
|
+
lines << divider
|
|
47
|
+
lines << l.created_at.strftime(CLI::Config::DATE_FORMAT).center(width)
|
|
48
|
+
lines << "#{order_o.to_sym == Aro::Log::ORDERING[:DESC] ? deck.logs.count - i : 1 + i} of #{deck.logs.count}".rjust(width)
|
|
49
|
+
lines << divider
|
|
50
|
+
lines << ""
|
|
51
|
+
lines << ""
|
|
52
|
+
lines += self.get_display_for_cards(
|
|
53
|
+
Base64::decode64(l.card_data).split(Aro::Deck::CARD_DELIM.to_s)
|
|
54
|
+
)
|
|
55
|
+
lines << divider
|
|
56
|
+
|
|
57
|
+
drawn_cards = Base64::decode64(l.drawn_data).split(Aro::Deck::CARD_DELIM.to_s)
|
|
58
|
+
|
|
59
|
+
if !drawn_cards.nil? && drawn_cards.any?
|
|
60
|
+
lines << I18n.t("cli.messages.history_drawn").center(width)
|
|
61
|
+
lines << divider
|
|
62
|
+
lines << ""
|
|
63
|
+
lines += self.get_display_for_cards(
|
|
64
|
+
drawn_cards
|
|
65
|
+
)
|
|
66
|
+
lines << ""
|
|
67
|
+
lines << divider
|
|
68
|
+
end
|
|
69
|
+
}
|
|
70
|
+
if count_n == Aro::Mancy::S
|
|
71
|
+
draw(lines)
|
|
72
|
+
else
|
|
73
|
+
Aro::P.less(lines.join("\n"))
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def self.get_display_for_cards(input = [])
|
|
78
|
+
columns = CLI::Config.display_config[:COLUMNS].to_i
|
|
79
|
+
lines = []
|
|
80
|
+
card_line = ""
|
|
81
|
+
input.each_with_index{|c, i|
|
|
82
|
+
s = (i + Aro::Mancy::S) % [Aro::Mancy::S, columns].max
|
|
83
|
+
card_line += c.ljust(columns)
|
|
84
|
+
if Aro::Mancy::O == s || i == input.count - Aro::Mancy::S
|
|
85
|
+
lines << card_line
|
|
86
|
+
card_line = ""
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
}
|
|
90
|
+
lines << ""
|
|
91
|
+
lines
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
views/games/game.rb
|
|
4
|
+
|
|
5
|
+
the game view.
|
|
6
|
+
|
|
7
|
+
by i2097i
|
|
8
|
+
|
|
9
|
+
=end
|
|
10
|
+
|
|
11
|
+
require_relative :"../base".to_s
|
|
12
|
+
|
|
13
|
+
module Aos
|
|
14
|
+
module Vi
|
|
15
|
+
class Game < Aos::Vi::Base
|
|
16
|
+
def self.show(model)
|
|
17
|
+
lines = []
|
|
18
|
+
lines << I18n.t("aos.views.game.title").center(viewport_width)
|
|
19
|
+
lines << I18n.t("aos.views.game.description").center(viewport_width)
|
|
20
|
+
lines
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
views/games/shpps.rb
|
|
4
|
+
|
|
5
|
+
the shbbs view.
|
|
6
|
+
|
|
7
|
+
by i2097i
|
|
8
|
+
|
|
9
|
+
=end
|
|
10
|
+
|
|
11
|
+
require_relative :"./game".to_s
|
|
12
|
+
|
|
13
|
+
module Aos
|
|
14
|
+
module Vi
|
|
15
|
+
class Shpps < Aos::Vi::Game
|
|
16
|
+
def self.show(model)
|
|
17
|
+
draw(super, model)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
views/games/vipps.rb
|
|
4
|
+
|
|
5
|
+
the vipps view.
|
|
6
|
+
|
|
7
|
+
by i2097i
|
|
8
|
+
|
|
9
|
+
=end
|
|
10
|
+
|
|
11
|
+
require_relative :"./game".to_s
|
|
12
|
+
|
|
13
|
+
module Aos
|
|
14
|
+
module Vi
|
|
15
|
+
class Vipps < Aos::Vi::Game
|
|
16
|
+
def self.show(model)
|
|
17
|
+
draw(super, model)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
views/settings/settings.rb
|
|
4
|
+
|
|
5
|
+
the settings view.
|
|
6
|
+
|
|
7
|
+
by i2097i
|
|
8
|
+
|
|
9
|
+
=end
|
|
10
|
+
|
|
11
|
+
require_relative :"../base".to_s
|
|
12
|
+
|
|
13
|
+
module Aos
|
|
14
|
+
module Vi
|
|
15
|
+
class Settings < Aos::Vi::Base
|
|
16
|
+
def self.show(model)
|
|
17
|
+
just_access = Aro::Mancy::NUMERALS[:VI]
|
|
18
|
+
just_key = Aro::Mancy::NUMERALS[:XXI]
|
|
19
|
+
just_value = Aro::Mancy::NUMERALS[:VI]
|
|
20
|
+
bullet = ":"
|
|
21
|
+
|
|
22
|
+
# print CLI::Config::DEF
|
|
23
|
+
lines = []
|
|
24
|
+
lines << "CLI::Config::DEF:"
|
|
25
|
+
lines << "#{"access".rjust(just_access)}#{bullet} #{"variable_name".ljust(just_key)}=value"
|
|
26
|
+
lines << ""
|
|
27
|
+
CLI::Config::DEF.each{|k, deff|
|
|
28
|
+
val = nil
|
|
29
|
+
|
|
30
|
+
if deff[:access] == CLI::Config::DEF_ACCESS[:READ]
|
|
31
|
+
val = CLI::Config.ovar(k)
|
|
32
|
+
else
|
|
33
|
+
val = CLI::Config.ivar(k)
|
|
34
|
+
k = CLI::Config.ivar_k(k)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
lines << "#{deff[:access].to_s.rjust(just_access)}#{bullet} #{k.to_s.ljust(just_key)}=#{val}"
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
# print config commands
|
|
41
|
+
lines << ""
|
|
42
|
+
lines << I18n.t("aos.constants.commands")
|
|
43
|
+
lines += lines_for_cmd(Aos::Os::CMDS[:CONFIG])
|
|
44
|
+
|
|
45
|
+
# draw output
|
|
46
|
+
draw(lines, model)
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
data/sys/aos/you.rb
ADDED
data/sys/aro/d.rb
CHANGED
data/sys/aro/db.rb
CHANGED
|
@@ -16,16 +16,13 @@ module Aro
|
|
|
16
16
|
MIGRATIONS_DIR = :"db/migrate"
|
|
17
17
|
|
|
18
18
|
def initialize
|
|
19
|
+
# ActiveRecord::Base.logger = Logger.new(STDOUT)
|
|
19
20
|
unless Aro::Mancy.is_aro_space?
|
|
20
21
|
Aro::P.say(I18n.t("cli.errors.not_in_aro" , cmd: Aro::Mancy::I2097I))
|
|
21
22
|
return
|
|
22
23
|
end
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
setup_local_aro
|
|
26
|
-
else
|
|
27
|
-
Aro::P.say(I18n.t("cli.warnings.not_initialized"))
|
|
28
|
-
end
|
|
24
|
+
|
|
25
|
+
setup_local_aro
|
|
29
26
|
end
|
|
30
27
|
|
|
31
28
|
def connect(name)
|
|
@@ -38,19 +35,15 @@ module Aro
|
|
|
38
35
|
|
|
39
36
|
def self.base_aro_dir
|
|
40
37
|
base_aro_file = Aro::Mancy::ARO_FILE.to_s
|
|
41
|
-
CLI::Config.is_test? ? "#{base_aro_file}_test" : base_aro_file
|
|
38
|
+
CLI::Config.is_test? ? "#{base_aro_file}_test" : base_aro_file
|
|
42
39
|
end
|
|
43
40
|
|
|
44
41
|
def db_config_filepath
|
|
45
42
|
File.join(Aro::Db.base_aro_dir, Aro::Db::DATABASE_YML.to_s)
|
|
46
43
|
end
|
|
47
44
|
|
|
48
|
-
def self.get_name_from_namefile
|
|
49
|
-
Aro::Mancy.is_aro_space? ? File.read(Aro::Mancy::NAME_FILE.to_s).strip : nil
|
|
50
|
-
end
|
|
51
|
-
|
|
52
45
|
def setup_local_aro
|
|
53
|
-
name = Aro::
|
|
46
|
+
name = Aro::Mancy.is_aro_space? ? File.read(Aro::Mancy::NAME_FILE.to_s).strip : nil
|
|
54
47
|
return if name.nil?
|
|
55
48
|
|
|
56
49
|
# create local .aro/ directory
|