aro 0.2.3 → 0.2.4
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 +9 -9
- data/bin/aro +8 -2
- data/locale/en.abot.yml +15 -15
- data/locale/en.amg.yml +7 -7
- data/locale/en.aos.yml +7 -7
- data/locale/en.cards.yml +361 -312
- data/locale/en.data.yml +1 -1
- data/locale/en.dom.yml +2 -2
- data/locale/en.flie.yml +1 -1
- data/locale/en.usage.yml +94 -67
- data/locale/en.yml +4 -3
- data/sys/aos/abot.rb +12 -13
- data/sys/aos/aos.rb +31 -26
- data/sys/aos/cor.rb +11 -14
- data/sys/aos/db.rb +1 -3
- data/sys/aos/models/agodo.rb +1 -2
- data/sys/aos/models/fpxy.rb +0 -2
- data/sys/aos/models/ilib.rb +0 -2
- data/sys/aos/models/ilog.rb +0 -2
- data/sys/aos/models/you.rb +7 -3
- data/sys/aos/vws/base.rb +13 -14
- data/sys/aos/vws/games/teck.rb +18 -14
- data/sys/aos/vws/welcome.rb +1 -1
- data/sys/aro/db.rb +3 -5
- data/sys/aro/models/teck.rb +25 -12
- data/sys/cli/constants.rb +1 -0
- data/sys/cli/create.rb +1 -1
- data/sys/cli/dom.rb +2 -2
- data/sys/cli/nterface.rb +15 -9
- data/sys/cli/teck.rb +4 -6
- data/sys/cli/usage.rb +11 -1
- data/sys/dom/dom.rb +0 -1
- data/sys/fpx.rb +25 -37
- data/sys/shr/t.rb +2 -2
- data/sys/shr/version.rb +1 -1
- metadata +1 -2
- data/sys/aos/models/base_model.rb +0 -13
data/sys/aos/vws/base.rb
CHANGED
|
@@ -12,7 +12,6 @@ module Aos
|
|
|
12
12
|
module Vw
|
|
13
13
|
class Base
|
|
14
14
|
BAR = :"".to_s
|
|
15
|
-
COL_POW = Proc.new{|n| n.pow(Aro::Mancy::S.to_f / Aro::Mancy::OS.to_f).to_i}
|
|
16
15
|
MARGIN_V = Aro::Mancy::S
|
|
17
16
|
MARGIN_H = Aro::Mancy::S
|
|
18
17
|
|
|
@@ -30,7 +29,7 @@ module Aos
|
|
|
30
29
|
return false unless body_lines.kind_of?(Array)
|
|
31
30
|
lines = []
|
|
32
31
|
|
|
33
|
-
dc = Aos::Cor.
|
|
32
|
+
dc = Aos::Cor.discon
|
|
34
33
|
width = dc[:WIDTH]
|
|
35
34
|
|
|
36
35
|
if Aro::Dom.in_arodom?
|
|
@@ -77,17 +76,8 @@ module Aos
|
|
|
77
76
|
def self.get_aos_display_lines
|
|
78
77
|
# current Aos::Os output
|
|
79
78
|
|
|
80
|
-
width = Aos::Cor.
|
|
79
|
+
width = Aos::Cor.discon[:WIDTH]
|
|
81
80
|
lines = []
|
|
82
|
-
Aos::Os.instance.display_lines ||= []
|
|
83
|
-
unless Aos::Os.instance.display_lines.empty?
|
|
84
|
-
Aos::Os.instance.display_lines.each{|line|
|
|
85
|
-
lines << line
|
|
86
|
-
}
|
|
87
|
-
Aos::Os.instance.display_lines = []
|
|
88
|
-
lines << "".center(width)
|
|
89
|
-
end
|
|
90
|
-
|
|
91
81
|
Aos::Db.load
|
|
92
82
|
|
|
93
83
|
the_you = Aos::Os.instance.you_flag || Aos::Os.instance.you
|
|
@@ -108,6 +98,15 @@ module Aos
|
|
|
108
98
|
lines << ("[ " + present_users.join(" ") + " ]").center(width)
|
|
109
99
|
end
|
|
110
100
|
lines << ":you_are_root".center(width) if the_you.root?
|
|
101
|
+
Aos::Os.instance.display_lines ||= []
|
|
102
|
+
unless Aos::Os.instance.display_lines.empty?
|
|
103
|
+
lines << ""
|
|
104
|
+
Aos::Os.instance.display_lines.each{|line|
|
|
105
|
+
lines << line
|
|
106
|
+
}
|
|
107
|
+
Aos::Os.instance.display_lines = []
|
|
108
|
+
lines << ""
|
|
109
|
+
end
|
|
111
110
|
lines += get_main_divider(width)
|
|
112
111
|
lines
|
|
113
112
|
end
|
|
@@ -129,7 +128,7 @@ module Aos
|
|
|
129
128
|
end
|
|
130
129
|
|
|
131
130
|
def self.viewport_width
|
|
132
|
-
dc = Aos::Cor.
|
|
131
|
+
dc = Aos::Cor.discon
|
|
133
132
|
width = dc[:WIDTH]
|
|
134
133
|
bar_width = (Aos::Vw::Base::BAR.length * Aro::Mancy::OS)
|
|
135
134
|
h_margin_width = (Aos::Vw::Base::MARGIN_H * Aro::Mancy::OS)
|
|
@@ -141,7 +140,7 @@ module Aos
|
|
|
141
140
|
hm = Aos::Vw::Base::MARGIN_H
|
|
142
141
|
bar = Aos::Vw::Base::BAR
|
|
143
142
|
hm_space = " " * Aos::Vw::Base::MARGIN_H
|
|
144
|
-
just = Aos::Cor.
|
|
143
|
+
just = Aos::Cor.discon[:WIDTH] - (hm_space.length + bar.length)
|
|
145
144
|
(bar + hm_space + (line || "")).ljust(just) + hm_space + bar
|
|
146
145
|
end
|
|
147
146
|
|
data/sys/aos/vws/games/teck.rb
CHANGED
|
@@ -46,6 +46,7 @@ module Aos
|
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
def self.show_game(model)
|
|
49
|
+
Aro::Db.load
|
|
49
50
|
mk = model.keys
|
|
50
51
|
dp = Aos::Vw::Teck::TECK_PARAMS
|
|
51
52
|
return nil unless (mk & dp).count == dp.count
|
|
@@ -57,9 +58,13 @@ module Aos
|
|
|
57
58
|
count_n = model[:count_n]
|
|
58
59
|
order_o = model[:order_o]
|
|
59
60
|
|
|
60
|
-
divider =
|
|
61
|
+
divider = "".ljust(
|
|
62
|
+
Aos::Vw::Base.viewport_width,
|
|
63
|
+
Aos::Vw::Teck::DIV_CHAR.to_s
|
|
64
|
+
)
|
|
61
65
|
lines = []
|
|
62
66
|
lines << divider
|
|
67
|
+
lines << ""
|
|
63
68
|
lines << "#{teck.name.upcase.center(Aos::Vw::Base.viewport_width)}"
|
|
64
69
|
tlog_records.each_with_index{|l, i|
|
|
65
70
|
lines << divider
|
|
@@ -72,7 +77,7 @@ module Aos
|
|
|
72
77
|
lines << divider
|
|
73
78
|
cards = Base64::decode64(l.card_data).split(Aro::Teck::CARD_DELIM.to_s)
|
|
74
79
|
if !cards.nil? && cards.any?
|
|
75
|
-
|
|
80
|
+
lines << ""
|
|
76
81
|
lines += self.get_display_for_cards(cards)
|
|
77
82
|
# lines << divider
|
|
78
83
|
end
|
|
@@ -98,20 +103,19 @@ module Aos
|
|
|
98
103
|
end
|
|
99
104
|
|
|
100
105
|
def self.get_display_for_cards(input = [])
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
106
|
+
return input unless input.any?
|
|
107
|
+
width = Aos::Cor.discon[:WIDTH]
|
|
108
|
+
c_width = Aro::Mancy::NUMERALS[:XI]
|
|
109
|
+
columns = (width / c_width).to_i
|
|
104
110
|
lines = []
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
if Aro::Mancy::O == s || i == input.count - Aro::Mancy::S
|
|
111
|
-
lines << card_line
|
|
112
|
-
card_line = ""
|
|
111
|
+
while input.any?
|
|
112
|
+
line = []
|
|
113
|
+
columns.times do
|
|
114
|
+
next if input[Aro::Mancy::O].nil?
|
|
115
|
+
line << input.delete_at(Aro::Mancy::O).center(c_width)
|
|
113
116
|
end
|
|
114
|
-
|
|
117
|
+
lines << line.join("")
|
|
118
|
+
end
|
|
115
119
|
lines << ""
|
|
116
120
|
lines
|
|
117
121
|
end
|
data/sys/aos/vws/welcome.rb
CHANGED
data/sys/aro/db.rb
CHANGED
|
@@ -23,10 +23,8 @@ module Aro
|
|
|
23
23
|
|
|
24
24
|
def self.load
|
|
25
25
|
Aro::Db.configure_logger
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
self.instance.setup_local_aro
|
|
29
|
-
end
|
|
26
|
+
if Aro::Mancy.in_aro?
|
|
27
|
+
self.instance.setup_local_aro
|
|
30
28
|
end
|
|
31
29
|
end
|
|
32
30
|
|
|
@@ -51,7 +49,7 @@ module Aro
|
|
|
51
49
|
|
|
52
50
|
def setup_local_aro
|
|
53
51
|
name = Aro::Mancy.in_aro? ? Aro::Mancy.aro_mancy_name : nil
|
|
54
|
-
return if name.nil?
|
|
52
|
+
return if name.nil? || name.to_sym == Aos::Os::CMDS[:ABOT][:key]
|
|
55
53
|
|
|
56
54
|
# create local .aro/ directory
|
|
57
55
|
unless File.exist?(Aro::Db.base_aro_dir)
|
data/sys/aro/models/teck.rb
CHANGED
|
@@ -48,6 +48,7 @@ class Aro::Teck < ActiveRecord::Base
|
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
def self.display_selection_menu
|
|
51
|
+
Aro::Db.load
|
|
51
52
|
unless Aro::Teck.any?
|
|
52
53
|
Aro::P.say(I18n.t("cli.messages.no_tecks"))
|
|
53
54
|
exit(CLI::EXIT_CODES[:SUCCESS])
|
|
@@ -97,6 +98,7 @@ class Aro::Teck < ActiveRecord::Base
|
|
|
97
98
|
end
|
|
98
99
|
|
|
99
100
|
# perform query
|
|
101
|
+
Aro::Db.load
|
|
100
102
|
tlog_records = tlogs.order(created_at: order_o).first(count_n)
|
|
101
103
|
|
|
102
104
|
# todo: this is doing more work than it needs to. needs debugging.
|
|
@@ -121,20 +123,29 @@ class Aro::Teck < ActiveRecord::Base
|
|
|
121
123
|
Aro::Mancy::PS1.to_s + I18n.t("cli.messages.choose_card"),
|
|
122
124
|
# formatted for tty-prompt gem
|
|
123
125
|
cards.split(Aro::Teck::CARD_DELIM.to_s).map{|c| [I18n.t("cards.#{Aro::Teck.card_strip(c)}.name"), c]}.to_h,
|
|
124
|
-
per_page: Aos::Cor.
|
|
126
|
+
per_page: Aos::Cor.discon[:HEIGHT] - Aro::Mancy::S,
|
|
125
127
|
cycle: true,
|
|
126
128
|
default: Aro::Mancy::S
|
|
127
129
|
)
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
130
|
+
|
|
131
|
+
Aro::Teck.print_card(answer)
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
def self.print_card(card_code)
|
|
135
|
+
card_code = card_code.to_s.upcase
|
|
136
|
+
orientation = "+"
|
|
137
|
+
if card_code.include?("-")
|
|
138
|
+
orientation = "-"
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
definition = I18n.t("cards.#{Aro::Teck.card_strip(card_code)}")
|
|
142
|
+
output = []
|
|
143
|
+
output << orientation + definition[:name]
|
|
144
|
+
output += definition["#{orientation}tags".to_sym].sort
|
|
145
|
+
# todo: add an actual summary
|
|
146
|
+
# Aro::P.say(definition["#{orientation}summary".to_sym])
|
|
147
|
+
width = Aos::Cor.discon[:WIDTH]
|
|
148
|
+
Aro::P.say("#{card_code}\n#{output.map{|l| l.center(width, Aos::Cor.discon[:DIVIDER])}.join("\n")}")
|
|
138
149
|
end
|
|
139
150
|
|
|
140
151
|
def shuffle
|
|
@@ -185,7 +196,7 @@ class Aro::Teck < ActiveRecord::Base
|
|
|
185
196
|
# find a card that is not already drawn
|
|
186
197
|
while sleeps <= sleeps_max && dev_tarot.nil? do
|
|
187
198
|
# use fallback randomness if /dev/tarot unavailable
|
|
188
|
-
|
|
199
|
+
unless Aro::T.is_dev_tarot? && Aro::T.is_dev_tarot_avail?
|
|
189
200
|
dev_tarot = Aro::T.summon_ruby_facot.split("")
|
|
190
201
|
else
|
|
191
202
|
# preferred randomness
|
|
@@ -219,6 +230,8 @@ class Aro::Teck < ActiveRecord::Base
|
|
|
219
230
|
|
|
220
231
|
# insert dev_tarot to drawn
|
|
221
232
|
drawn_arr << dev_tarot
|
|
233
|
+
Aro::Teck.print_card(dev_tarot)
|
|
234
|
+
Aro::Db.load
|
|
222
235
|
|
|
223
236
|
# update database
|
|
224
237
|
update(
|
data/sys/cli/constants.rb
CHANGED
data/sys/cli/create.rb
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
module CLI
|
|
12
12
|
def self.create
|
|
13
|
-
CLI::Nterface.exit_error_missing_args! if CLI::ARGV1.nil?
|
|
13
|
+
CLI::Nterface.exit_error_missing_args!(:var_aro_name) if CLI::ARGV1.nil?
|
|
14
14
|
|
|
15
15
|
name = CLI::ARGV1&.to_s
|
|
16
16
|
Aro::P.say(I18n.t("cli.messages.creation_attempt", name: name))
|
data/sys/cli/dom.rb
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
module CLI
|
|
12
12
|
def self.dom
|
|
13
13
|
if CLI::FLAGS[:HELP].include?(CLI::ARGV1)
|
|
14
|
-
CLI.
|
|
14
|
+
CLI.usage_dom
|
|
15
15
|
exit(CLI::EXIT_CODES[:SUCCESS])
|
|
16
16
|
end
|
|
17
17
|
|
|
@@ -30,7 +30,7 @@ module CLI
|
|
|
30
30
|
CLI::Nterface.exit_error_invalid_usage!
|
|
31
31
|
end
|
|
32
32
|
when CLI::CMDS[:DOM][:NEW]
|
|
33
|
-
CLI::Nterface.exit_error_missing_args! if CLI::ARGV2.nil?
|
|
33
|
+
CLI::Nterface.exit_error_missing_args!(:var_dom_name) if CLI::ARGV2.nil?
|
|
34
34
|
if Aro::Dom.in_arodom?
|
|
35
35
|
Aro::P.say(I18n.t("dom.errors.failed_already_in_arodom"))
|
|
36
36
|
elsif Aro::Mancy.in_aro?
|
data/sys/cli/nterface.rb
CHANGED
|
@@ -10,22 +10,28 @@
|
|
|
10
10
|
|
|
11
11
|
module CLI
|
|
12
12
|
class Nterface
|
|
13
|
-
def self.
|
|
14
|
-
Aro::P.say(I18n.t("cli.errors.header", cmd: Aro::Mancy
|
|
15
|
-
Aro::P.say(I18n.t("cli.errors.
|
|
13
|
+
def self.exit_error_not_found!(arg)
|
|
14
|
+
Aro::P.say(I18n.t("cli.errors.header", cmd: Aro::Mancy))
|
|
15
|
+
Aro::P.say(I18n.t("cli.errors.not_found", cmd: arg))
|
|
16
16
|
exit(CLI::EXIT_CODES[:INVALID_ARG])
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def self.
|
|
20
|
-
Aro::P.say(I18n.t("cli.errors.header", cmd: Aro::Mancy
|
|
21
|
-
Aro::P.say(I18n.t("cli.errors.
|
|
19
|
+
def self.exit_error_missing_args!(arg)
|
|
20
|
+
Aro::P.say(I18n.t("cli.errors.header", cmd: Aro::Mancy))
|
|
21
|
+
Aro::P.say(I18n.t("cli.errors.missing_args", cmd: arg))
|
|
22
22
|
exit(CLI::EXIT_CODES[:INVALID_ARG])
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
+
def self.exit_error_invalid_usage!
|
|
26
|
+
Aro::P.say(I18n.t("cli.errors.header", cmd: Aro::Mancy))
|
|
27
|
+
Aro::P.say(I18n.t("cli.errors.invalid_usage", cmd: Aro::Mancy))
|
|
28
|
+
exit(CLI::EXIT_CODES[:GENERAL_ERROR])
|
|
29
|
+
end
|
|
30
|
+
|
|
25
31
|
def self.exit_error_not_initialized!
|
|
26
|
-
Aro::P.say(I18n.t("cli.errors.header", cmd: Aro::Mancy
|
|
27
|
-
Aro::P.say(I18n.t("cli.errors.not_initialized", cmd: Aro::Mancy
|
|
28
|
-
exit(CLI::EXIT_CODES[:
|
|
32
|
+
Aro::P.say(I18n.t("cli.errors.header", cmd: Aro::Mancy))
|
|
33
|
+
Aro::P.say(I18n.t("cli.errors.not_initialized", cmd: Aro::Mancy))
|
|
34
|
+
exit(CLI::EXIT_CODES[:GENERAL_ERROR])
|
|
29
35
|
end
|
|
30
36
|
end
|
|
31
37
|
end
|
data/sys/cli/teck.rb
CHANGED
|
@@ -12,10 +12,8 @@ module CLI
|
|
|
12
12
|
def self.teck
|
|
13
13
|
Aro::Mancy.init
|
|
14
14
|
action = CLI::ARGV1&.to_sym
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
# todo: breakout usage into subcommand-specific verbiage
|
|
18
|
-
CLI.usage::usage
|
|
15
|
+
if CLI::FLAGS[:HELP].include?(action)
|
|
16
|
+
CLI.usage_teck
|
|
19
17
|
exit(CLI::EXIT_CODES[:SUCCESS])
|
|
20
18
|
elsif action.nil? || action == :aos
|
|
21
19
|
# no args, open teck menu
|
|
@@ -25,7 +23,7 @@ module CLI
|
|
|
25
23
|
Aro::P.say(I18n.t("cli.errors.not_in_aro" , cmd: Aro::Mancy::I2097I))
|
|
26
24
|
end
|
|
27
25
|
elsif action == CLI::CMDS[:TECK][:NEW]
|
|
28
|
-
CLI::Nterface.exit_error_missing_args! if CLI::ARGV2.nil?
|
|
26
|
+
CLI::Nterface.exit_error_missing_args!(:var_teck_name) if CLI::ARGV2.nil?
|
|
29
27
|
if Aro::Mancy.in_aro?
|
|
30
28
|
teck = Aro::Teck.make(CLI::ARGV2.to_s)
|
|
31
29
|
Aro::P.say(I18n.t("cli.messages.teck_created_sucessfully", name: teck.name))
|
|
@@ -47,6 +45,7 @@ module CLI
|
|
|
47
45
|
Aro::P.say(I18n.t("cli.messages.shuffling", name: Aro::Mancy.teck.name))
|
|
48
46
|
Aro::Mancy.teck.shuffle
|
|
49
47
|
when CLI::CMDS[:TECK][:DRAW]
|
|
48
|
+
Aos::Cor.instance.load
|
|
50
49
|
Aro::P.say(I18n.t("cli.messages.drawing", name: Aro::Mancy.teck.name))
|
|
51
50
|
Aro::P.say(I18n.t("cli.messages.drawing_from_dimension", dimension: "#{Aos::Cor.ivar(:DIMENSION)}"))
|
|
52
51
|
Aro::Mancy.teck.draw(
|
|
@@ -59,7 +58,6 @@ module CLI
|
|
|
59
58
|
Aro::Mancy.teck.replace
|
|
60
59
|
when CLI::CMDS[:TECK][:RESET]
|
|
61
60
|
Aro::P.say("#{I18n.t("cli.messages.confirmation_prompt", name: Aro::Mancy.teck.name)}")
|
|
62
|
-
Aro::P.say("\n")
|
|
63
61
|
if Aro::Mancy::YES.to_s != Aos::S.p.ask("\n#{Aro::Mancy::PS1}$")
|
|
64
62
|
Aro::P.say(I18n.t("cli.messages.understood", name: Aro::Mancy.teck.name))
|
|
65
63
|
exit(CLI::EXIT_CODES[:SUCCESS])
|
data/sys/cli/usage.rb
CHANGED
|
@@ -9,7 +9,17 @@
|
|
|
9
9
|
=end
|
|
10
10
|
|
|
11
11
|
module CLI
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
def self.usage_dom
|
|
14
|
+
Aro::P.less(I18n.t("usage.dom"))
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def self.usage_main
|
|
13
18
|
Aro::P.less(I18n.t("usage.main"))
|
|
14
19
|
end
|
|
20
|
+
|
|
21
|
+
def self.usage_teck
|
|
22
|
+
Aro::P.less(I18n.t("usage.teck"))
|
|
23
|
+
end
|
|
24
|
+
|
|
15
25
|
end
|
data/sys/dom/dom.rb
CHANGED
data/sys/fpx.rb
CHANGED
|
@@ -13,15 +13,6 @@ require :sinatra.to_s
|
|
|
13
13
|
|
|
14
14
|
module Aos
|
|
15
15
|
module Fpx
|
|
16
|
-
def self.read_you(you_name)
|
|
17
|
-
url = URI.parse(File.join(Aos::Fpx::Server::URL, :"you/#{you_name}".to_s))
|
|
18
|
-
req = Net::HTTP::Get.new(url.to_s)
|
|
19
|
-
res = Net::HTTP.start(url.host, url.port) {|http|
|
|
20
|
-
http.request(req)
|
|
21
|
-
}
|
|
22
|
-
res.body
|
|
23
|
-
end
|
|
24
|
-
|
|
25
16
|
class Server < Sinatra::Base
|
|
26
17
|
PORT = 7474
|
|
27
18
|
HOST = :localhost
|
|
@@ -29,54 +20,51 @@ module Aos
|
|
|
29
20
|
URL = :"http://#{Aos::Fpx::Server::HOST}:#{Aos::Fpx::Server::PORT}/".to_s
|
|
30
21
|
TIMEOUT = Aro::Mancy::NUMERALS[:VI] * Aro::Mancy::NUMERALS[:X]
|
|
31
22
|
|
|
32
|
-
def self.
|
|
33
|
-
|
|
23
|
+
def self.log_filepath
|
|
24
|
+
File.join(
|
|
25
|
+
Aro::Dom.dom_root,
|
|
26
|
+
Aro::Dom.room_path(:flie),
|
|
27
|
+
"fpx.log"
|
|
28
|
+
)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def self.server_pid_file
|
|
32
|
+
return "" if Aro::Dom.dom_root.nil? || Aro::Dom.room_path(:flie).nil?
|
|
34
33
|
File.join(Aro::Dom.dom_root, Aro::Dom.room_path(:flie), "fpx.pid")
|
|
35
34
|
end
|
|
36
35
|
|
|
37
|
-
# def self.log_file
|
|
38
|
-
# File.new(
|
|
39
|
-
# File.join(
|
|
40
|
-
# Aro::Dom.dom_root,
|
|
41
|
-
# Aro::Dom.room_path(:flie),
|
|
42
|
-
# "fpx.log"
|
|
43
|
-
# ),
|
|
44
|
-
# "a+"
|
|
45
|
-
# )
|
|
46
|
-
# end
|
|
47
36
|
|
|
48
37
|
def self.start
|
|
49
|
-
return if File.exist?(Aos::Fpx::Server.
|
|
38
|
+
return if File.exist?(Aos::Fpx::Server.server_pid_file)
|
|
50
39
|
|
|
51
40
|
serve_pid = fork {Aos::Fpx::Server.run!}
|
|
52
41
|
Process.detach(serve_pid)
|
|
53
|
-
File.open(Aos::Fpx::Server.
|
|
42
|
+
File.open(Aos::Fpx::Server.server_pid_file, "w") do |f|
|
|
54
43
|
f.write(serve_pid)
|
|
55
44
|
end
|
|
56
45
|
end
|
|
57
46
|
|
|
58
47
|
def self.stop
|
|
59
|
-
if File.exist?(Aos::Fpx::Server.
|
|
60
|
-
system("kill -9 #{File.read(Aos::Fpx::Server.
|
|
61
|
-
FileUtils.rm(Aos::Fpx::Server.
|
|
48
|
+
if File.exist?(Aos::Fpx::Server.server_pid_file)
|
|
49
|
+
system("kill -9 #{File.read(Aos::Fpx::Server.server_pid_file)}")
|
|
50
|
+
FileUtils.rm(Aos::Fpx::Server.server_pid_file)
|
|
62
51
|
end
|
|
63
52
|
end
|
|
64
53
|
|
|
54
|
+
# todo: make this work
|
|
55
|
+
# aos fpx -h localhost -p 7474 -t 60 -l root/flie/fpx.log --flie localhost:3000
|
|
56
|
+
|
|
65
57
|
set :port, Aos::Fpx::Server::PORT
|
|
66
58
|
# set :bind, "0.0.0.0"
|
|
67
59
|
set :server_settings, timeout: Aos::Fpx::Server::TIMEOUT
|
|
68
60
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
# after do
|
|
78
|
-
# ActiveRecord::Base.clear_active_connections!
|
|
79
|
-
# end
|
|
61
|
+
configure do
|
|
62
|
+
enable :logging
|
|
63
|
+
file = File.new(Aos::Fpx::Server.log_filepath, "w+")
|
|
64
|
+
file.sync = true
|
|
65
|
+
use Rack::CommonLogger, file
|
|
66
|
+
set :logging, Logger::DEBUG
|
|
67
|
+
end
|
|
80
68
|
|
|
81
69
|
use Rack::Cors do |config|
|
|
82
70
|
config.allow do |allow|
|
data/sys/shr/t.rb
CHANGED
|
@@ -52,7 +52,7 @@ module Aro
|
|
|
52
52
|
# get orientation
|
|
53
53
|
rf = ["+","-"].sample
|
|
54
54
|
|
|
55
|
-
# get
|
|
55
|
+
# get suit
|
|
56
56
|
rf += ruby_facot[1]
|
|
57
57
|
|
|
58
58
|
# calculate the sym
|
|
@@ -60,7 +60,7 @@ module Aro
|
|
|
60
60
|
# loops through the characters in ruby_facot
|
|
61
61
|
# return all characters not matching:
|
|
62
62
|
# => character[0]: orientation
|
|
63
|
-
# => character[1]:
|
|
63
|
+
# => character[1]: suit
|
|
64
64
|
|
|
65
65
|
# the first two characters in the dev_tarot format designate the
|
|
66
66
|
!ruby_facot.first(Aro::Mancy::OS).include?(c)
|
data/sys/shr/version.rb
CHANGED
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.2.
|
|
4
|
+
version: 0.2.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- i2097i
|
|
@@ -242,7 +242,6 @@ files:
|
|
|
242
242
|
- sys/aos/db/migrate/1766203888_create_fpxies.rb
|
|
243
243
|
- sys/aos/flie.rb
|
|
244
244
|
- sys/aos/models/agodo.rb
|
|
245
|
-
- sys/aos/models/base_model.rb
|
|
246
245
|
- sys/aos/models/fpxy.rb
|
|
247
246
|
- sys/aos/models/ilib.rb
|
|
248
247
|
- sys/aos/models/ilog.rb
|