aro 0.2.1 → 0.2.3

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.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +1 -1
  5. data/aro.gemspec +3 -3
  6. data/bin/aos +10 -3
  7. data/bin/aro +18 -11
  8. data/checksums/aro-0.2.1.gem.sha512 +1 -0
  9. data/checksums/aro-0.2.2.gem.sha512 +1 -0
  10. data/checksums/aro-0.2.3.gem.sha512 +1 -0
  11. data/locale/en.abot.yml +81 -0
  12. data/locale/en.amg.yml +44 -0
  13. data/locale/en.aos.yml +8 -38
  14. data/locale/en.cor.yml +47 -0
  15. data/locale/en.data.yml +30 -0
  16. data/locale/en.dom.yml +22 -18
  17. data/locale/en.flie.yml +29 -0
  18. data/locale/en.usage.yml +39 -26
  19. data/locale/en.yml +10 -51
  20. data/sys/aos/abot.rb +256 -0
  21. data/sys/aos/amg.rb +58 -56
  22. data/sys/aos/aos.rb +425 -180
  23. data/sys/aos/cor.rb +773 -0
  24. data/sys/aos/data.rb +117 -0
  25. data/sys/aos/db/migrate/1765148774_create_yous.rb +1 -0
  26. data/sys/aos/db/migrate/{1765762724_create_libs.rb → 1765762724_create_ilibs.rb} +5 -5
  27. data/sys/aos/db/migrate/1765907766_create_ilogs.rb +18 -0
  28. data/sys/aos/db/migrate/1765933985_create_agodos.rb +22 -0
  29. data/sys/aos/db/migrate/1766203888_create_fpxies.rb +18 -0
  30. data/sys/aos/db.rb +47 -27
  31. data/sys/aos/flie.rb +144 -0
  32. data/sys/aos/models/agodo.rb +96 -0
  33. data/sys/aos/models/base_model.rb +13 -0
  34. data/sys/aos/models/fpxy.rb +28 -0
  35. data/sys/{shr/lib/lib.rb → aos/models/ilib.rb} +11 -6
  36. data/sys/aos/models/ilog.rb +29 -0
  37. data/sys/aos/models/you.rb +98 -0
  38. data/sys/aos/s.rb +2 -1
  39. data/sys/aos/vws/base.rb +69 -78
  40. data/sys/aos/vws/dom.rb +1 -2
  41. data/sys/aos/vws/games/abot.rb +21 -0
  42. data/sys/aos/vws/games/{game.rb → teck.rb} +27 -24
  43. data/sys/aos/vws/home.rb +23 -0
  44. data/sys/aos/vws/know/{temple.rb → body.rb} +3 -3
  45. data/sys/aos/vws/know/{library.rb → mind.rb} +3 -3
  46. data/sys/aos/vws/know/spirit.rb +19 -0
  47. data/sys/aos/vws/{setup → root}/amg.rb +1 -2
  48. data/sys/aos/vws/{setup → root}/config.rb +4 -4
  49. data/sys/aos/vws/root/data.rb +21 -0
  50. data/sys/aos/vws/root/flie.rb +21 -0
  51. data/sys/aos/vws/{setup.rb → root.rb} +3 -3
  52. data/sys/aos/vws/welcome/waite.rb +1 -0
  53. data/sys/aos/vws/welcome.rb +47 -0
  54. data/sys/aro/d.rb +4 -2
  55. data/sys/aro/db/migrate/{1763374647_create_decks.rb → 1763374647_create_tecks.rb} +5 -5
  56. data/sys/aro/db/migrate/1763432541_create_tlogs.rb +20 -0
  57. data/sys/aro/db.rb +28 -19
  58. data/sys/aro/mancy.rb +18 -22
  59. data/sys/aro/models/base_model.rb +13 -0
  60. data/sys/{models/deck.rb → aro/models/teck.rb} +60 -57
  61. data/sys/aro/models/tlog.rb +21 -0
  62. data/sys/aro/p.rb +1 -1
  63. data/sys/aro/r.rb +2 -1
  64. data/sys/aro/v.rb +2 -2
  65. data/sys/cli/constants.rb +4 -10
  66. data/sys/cli/create.rb +2 -3
  67. data/sys/cli/dom.rb +1 -2
  68. data/sys/cli/{deck.rb → teck.rb} +38 -45
  69. data/sys/cli.rb +10 -11
  70. data/sys/dom/d.rb +68 -46
  71. data/sys/dom/dom.rb +79 -44
  72. data/sys/dom/p.rb +1 -1
  73. data/sys/fpx.rb +116 -0
  74. data/sys/reiquire.rb +8 -8
  75. data/sys/shr/prompt.rb +2 -6
  76. data/sys/shr/t.rb +11 -13
  77. data/sys/shr/version.rb +1 -1
  78. data/tasks/make.rake +1 -1
  79. metadata +82 -62
  80. data/locale/en.cngelog.yml +0 -5
  81. data/sys/aos/vws/games/abpps.rb +0 -19
  82. data/sys/aos/vws/games/hbpps.rb +0 -19
  83. data/sys/aos/vws/games/shpps.rb +0 -19
  84. data/sys/aos/vws/games/vipps.rb +0 -19
  85. data/sys/aos/you.rb +0 -21
  86. data/sys/aro/db/migrate/1763432541_create_logs.rb +0 -20
  87. data/sys/dom/config.rb +0 -665
  88. data/sys/models/log.rb +0 -20
  89. /data/sys/shr/{lib → ilib}/crs/CMakeLists.txt +0 -0
  90. /data/sys/shr/{lib → ilib}/crs/compile.sh +0 -0
  91. /data/sys/shr/{lib → ilib}/crs/crs.c +0 -0
  92. /data/sys/shr/{lib → ilib}/crs/crs.o +0 -0
  93. /data/sys/shr/{lib → ilib}/crs/libcrs.so +0 -0
data/locale/en.yml CHANGED
@@ -4,61 +4,20 @@ en:
4
4
  very_important: "VERY IMPORTANT! %{dev_tarot}"
5
5
  # VERY IMPORTANT!
6
6
 
7
- config:
8
- aro_env:
9
- O_description: "read-only env var for holding O."
10
- S_description: "read-only env var for holding S."
11
- OS_description: "read-only env var for holding OS."
12
- E_description: "read-only env var for holding E."
13
- N_description: "read-only env var for holding N"
14
- PS1_description: "read-only env var for holding default PS1."
15
- NAME_FILE_description: "read-only env var for name file."
16
- I2097I_description: "read-only env var for i2097i."
17
- YES_description: "read-only env var for 'aroyes'."
18
- ALL_description: "read-only env var for 'all'."
19
- dimension:
20
- description: "selected dimension of aro space."
21
- dev_tarot_description: "reads from /dev/tarot device if available."
22
- ruby_facot_description: "generated ruby_facot (facade randomness)."
23
- format:
24
- description: "aro output format."
25
- text_description: "show aro responses in text format (default)"
26
- json_description: "show aro responses in json format."
27
- height_description: "display height. valid range: (${min}-${max})"
28
- width_description: "display width. valid range: (${min}-${max})"
29
- env:
30
- description: "aro run environment."
31
- development_description: "basic development logs and features."
32
- production_description: "game logging only."
33
- test_description: "logging and features tailored for tests."
34
- verbose_description: "enable verbose logging in development env."
35
- log_aos_db_description: "show aos database transactions."
36
- log_aro_db_description: "show aro database transactions"
37
- generate: "generating default config file at %{name}."
38
- source: "installing ivars from %{name}..."
39
- maximum: "max"
40
- minimum: "min"
41
- possible_values: "possible values"
42
- type:
43
- bool_description: "true or false."
44
- int_description: "a primitive decimal-less numeric."
45
- string_description: "a blank-space-terminated string of characters."
46
- values_description: "an enumerated type."
47
- z_description: "sleep time between attempts to read /dev/tarot. valid range (%{min}-%{max})"
48
- z_max_description: "max number of z long sleeps before giving up. valid range (%{min}-%{max})"
49
7
  errors:
50
8
  header: "%{cmd} says there was a problem."
51
9
  invalid_usage: "%{cmd} says you're not supposed to be here."
52
10
  missing_args: "%{cmd} says missing required argument(s)."
53
- missing_deck: "%{cmd} says no deck selected. use 'aro deck' to select one or 'aro deck new <name>' to create one."
11
+ missing_teck: "%{cmd} says no teck selected. use 'aro teck' to select one or 'aro teck new <name>' to create one."
54
12
  not_in_aro: "%{cmd} says you are not in aro space. that command will not work here."
55
13
  not_in_aos: "%{cmd} says you are not in aos space. that command will not work here."
14
+ not_initialized_dom: "%{cmd} says you need to initialize dom. $ aro dom init <root_username> <root_password>"
56
15
  not_initialized: "%{cmd} says you need to initialize aro. run 'aro init' to do so"
57
16
  warnings:
58
- invalid_order: "the order specified for displaying logs in invalid. using default (desc)."
17
+ invalid_order: "the order specified for displaying tlogs in invalid. using default (desc)."
59
18
  messages:
60
19
  choose_card: "choose a card."
61
- choose_deck: "choose a deck."
20
+ choose_teck: "choose a teck."
62
21
  confirmation_prompt: "input 'aroyes' to reset %{name}, or enter to cancel (cancel): "
63
22
  creating: "creating %{name}..."
64
23
  creation_attempt: "attempting to create aro table named %{name}..."
@@ -71,8 +30,8 @@ en:
71
30
  $ cd %{name}
72
31
 
73
32
  see aro --help for usage.
74
- deck_created_sucessfully: "%{name} deck created successfully"
75
- deck_selected: "%{name} deck selected in the %{room} room."
33
+ teck_created_sucessfully: "%{name} teck created successfully"
34
+ teck_selected: "%{name} teck selected in the %{room} room."
76
35
  drawing: "drawing a card from %{name}"
77
36
  drawing_from_dimension: "in the the %{dimension} dimension..."
78
37
  ruby_facot_random: |
@@ -80,12 +39,12 @@ en:
80
39
  for more information visit:
81
40
  https://github.com/arowmancy/dev_tarot
82
41
  history_drawn: "drawn cards"
83
- no_decks: |
84
- no decks created yet.
42
+ no_tecks: |
43
+ no tecks created yet.
85
44
 
86
45
  use the following command to create one:
87
46
 
88
- $ aro deck new <deck_name>
47
+ $ aro teck new <teck_name>
89
48
 
90
49
  see aro --help for usage.
91
50
  showing: "showing %{name} [count:%{count}, order:%{order}]..."
@@ -93,4 +52,4 @@ en:
93
52
  replacing_drawn: "replacing all drawn cards to %{name}..."
94
53
  resetting: "resetting %{name}'s cards..."
95
54
  understood: "%{name} says: 'understood.'"
96
- welcome: "welcome.to.the.%{name}."
55
+ welcome: "summoned %{name}"
data/sys/aos/abot.rb ADDED
@@ -0,0 +1,256 @@
1
+ =begin
2
+
3
+ abot.rb
4
+
5
+ abot.
6
+
7
+ by i2097i
8
+
9
+ =end
10
+
11
+ module Aos
12
+ class Abot
13
+ include Singleton
14
+
15
+ attr_accessor :display_lines
16
+
17
+ CMDS = {
18
+ AGODO: {
19
+ key: :agodo,
20
+ description: I18n.t("abot.commands.description.agodo"),
21
+ usage: I18n.t("abot.commands.usage.agodo"),
22
+ },
23
+ DEREZ: {
24
+ key: :derez,
25
+ description: I18n.t("abot.commands.description.derez"),
26
+ usage: I18n.t("abot.commands.usage.derez"),
27
+ },
28
+ RATE: {
29
+ key: :rate,
30
+ description: I18n.t("abot.commands.description.rate"),
31
+ usage: I18n.t("abot.commands.usage.rate"),
32
+ },
33
+ STOP: {
34
+ key: :stop,
35
+ description: I18n.t("abot.commands.description.stop"),
36
+ usage: I18n.t("abot.commands.usage.stop"),
37
+ },
38
+ START: {
39
+ key: :start,
40
+ description: I18n.t("abot.commands.description.start"),
41
+ usage: I18n.t("abot.commands.usage.start"),
42
+ },
43
+ }
44
+
45
+ def self.cron_pid_file
46
+ return "" if Aro::Dom.dom_root.nil? || Aro::Dom.room_path(:abot).nil?
47
+ File.join(Aro::Dom.dom_root, Aro::Dom.room_path(:abot), "abot.pid")
48
+ end
49
+
50
+ def self.cron
51
+ Aro::D.say("abot cron is disabled currently. you can still manage them but they do not run.")
52
+ not_currently_enabled = true
53
+ return if not_currently_enabled || File.exist?(Aos::Abot.cron_pid_file)
54
+
55
+ abot_pid = fork {
56
+ log = File.open(File.join(Aro::Dom.dom_root, Aro::Dom.room_path(:abot), "abot.log"), "w+")
57
+ STDOUT.reopen(log)
58
+ STDERR.reopen(log)
59
+ STDOUT.sync = true
60
+ loop do
61
+ Aos::Agodo.where(power: :on).each{|a|
62
+ a.godo
63
+ }
64
+ sleep(Aro::Mancy::S)
65
+ end
66
+ }
67
+ Process.detach(abot_pid)
68
+ File.open(Aos::Abot.cron_pid_file, "w+") do |f|
69
+ f.write(abot_pid)
70
+ end
71
+ end
72
+
73
+ def self.terminate
74
+ if File.exist?(Aos::Abot.cron_pid_file)
75
+ system("kill -9 #{File.read(Aos::Abot.cron_pid_file)}")
76
+ FileUtils.rm(Aos::Abot.cron_pid_file)
77
+ end
78
+ end
79
+
80
+ def self.process_cmd(args)
81
+ if args[Aro::Mancy::S].nil?
82
+ Aos::Abot.abot
83
+ return true
84
+ elsif CLI::FLAGS[:HELP].include?(args[Aro::Mancy::S].to_sym)
85
+ self.instance.display_lines = [I18n.t("abot.usage")]
86
+ return true
87
+ end
88
+
89
+ processed = false
90
+ # clear display
91
+ self.instance.display_lines = []
92
+ case args[Aro::Mancy::S].to_sym
93
+ when Aos::Abot::CMDS[:AGODO][:key]
94
+ Aos::Abot.agodo(args)
95
+ processed = true
96
+ when Aos::Abot::CMDS[:DEREZ][:key]
97
+ Aos::Abot.derez(args[Aro::Mancy::OS])
98
+ processed = true
99
+ when Aos::Abot::CMDS[:RATE][:key]
100
+ Aos::Abot.rate(args)
101
+ processed = true
102
+ when Aos::Abot::CMDS[:STOP][:key]
103
+ Aos::Abot.stop(args[Aro::Mancy::OS])
104
+ processed = true
105
+ when Aos::Abot::CMDS[:START][:key]
106
+ Aos::Abot.start(args[Aro::Mancy::OS])
107
+ processed = true
108
+ else
109
+ self.instance.display_lines = [I18n.t("abot.messages.invalid_agodo_cmd")]
110
+ end
111
+
112
+ return processed
113
+ end
114
+
115
+ def self.abot
116
+ self.instance.display_lines = Aos::Abot.base_lines
117
+ end
118
+
119
+ # create and list agodos
120
+ def self.agodo(args)
121
+ if args[Aro::Mancy::OS].nil?
122
+ # list agodos
123
+ self.instance.display_lines = Aos::Abot.agodo_lines
124
+ return
125
+ end
126
+
127
+ if !args[Aro::Mancy::OS].nil? &&
128
+ !args[Aro::Mancy::E].nil? &&
129
+ !args[Aro::Mancy::N].nil?
130
+ # create mode
131
+ # abot agodo <go> <do> <rate>
132
+ arg_go = args[Aro::Mancy::OS]
133
+ arg_do = args[Aro::Mancy::E]
134
+ arg_rate = args[Aro::Mancy::N]
135
+
136
+ agodo_record = Aos::Agodo.new
137
+ agodo_record.go = arg_go
138
+ agodo_record.do = arg_do
139
+ agodo_record.rate = arg_rate
140
+ if agodo_record.save
141
+ self.instance.display_lines << "successfully created an agodo named #{agodo_record.you.name}."
142
+ self.instance.display_lines += Aos::Abot.agodo_lines
143
+ else
144
+ self.instance.display_lines += agodo_record.errors.to_a.map(&:downcase)
145
+ end
146
+ else
147
+ self.instance.display_lines = [I18n.t("abot.messages.invalid_agodo_cmd")]
148
+ end
149
+ end
150
+
151
+ # update agodo rate
152
+ def self.rate(args)
153
+ agodo_you = Aos::You.find_by(
154
+ name: args[Aro::Mancy::OS]&.strip&.upcase
155
+ )
156
+
157
+ if !agodo_you.nil? &&
158
+ Aos::Cor.int_valid?(args[Aro::Mancy::E]&.to_i)
159
+ agodo_record = agodo_you.agodo
160
+ agodo_record.update(rate: args[Aro::Mancy::E].to_i)
161
+ self.instance.display_lines << "#{agodo_record.you.name} rate updated."
162
+ self.instance.display_lines += Aos::Abot.agodo_lines
163
+ else
164
+ self.instance.display_lines = [I18n.t("abot.messages.invalid_agodo_cmd")]
165
+ end
166
+ end
167
+
168
+ # destroy an agodo
169
+ def self.derez(agodo_name)
170
+ n = agodo_name&.strip&.upcase
171
+ agodo_you = Aos::You.find_by(name: n)
172
+ unless agodo_you.nil?
173
+ self.instance.display_lines << "derezing #{agodo_you.name} agodo."
174
+ agodo_record = agodo_you.agodo
175
+ agodo_record&.destroy
176
+ agodo_you.ilogs.destroy_all
177
+ agodo_you.destroy
178
+ requery = Aos::You.find_by(name: n)
179
+ if requery.nil? && requery&.agodo.nil?
180
+ self.instance.display_lines << "successfully destroyed #{n} agodo."
181
+ else
182
+ self.instance.display_lines << "unable to destroyed the #{n} agodo."
183
+ end
184
+ else
185
+ self.instance.display_lines = [I18n.t("abot.messages.invalid_agodo_cmd")]
186
+ end
187
+ end
188
+
189
+ # power off an agodo
190
+ def self.stop(agodo_name)
191
+ agodo_you = Aos::You.find_by(
192
+ name: agodo_name&.strip&.upcase
193
+ )
194
+ unless agodo_you.nil?
195
+ agodo_record = agodo_you.agodo
196
+ agodo_record.update(power: :off)
197
+ self.instance.display_lines << "#{agodo_record.you.name} stopped."
198
+ self.instance.display_lines += Aos::Abot.agodo_lines
199
+ else
200
+ self.instance.display_lines = [I18n.t("abot.messages.invalid_agodo_cmd")]
201
+ end
202
+ end
203
+
204
+ # power on an agodo
205
+ def self.start(agodo_name)
206
+ agodo_you = Aos::You.find_by(
207
+ name: agodo_name&.strip&.upcase
208
+ )
209
+ unless agodo_you.nil?
210
+ agodo_record = agodo_you.agodo
211
+ agodo_record.update(power: :on)
212
+
213
+ self.instance.display_lines << "#{agodo_record.you.name} started."
214
+ self.instance.display_lines += Aos::Abot.agodo_lines
215
+ else
216
+ self.instance.display_lines = [I18n.t("abot.messages.invalid_agodo_cmd")]
217
+ end
218
+ end
219
+
220
+ # abot help
221
+ def self.base_lines
222
+ # print abot commands
223
+ lines = []
224
+ lines << ""
225
+ lines << I18n.t("aos.constants.commands")
226
+ lines += Aos::Vw::Base.lines_for_cmd(Aos::Os::CMDS[:ABOT])
227
+ lines << I18n.t("aos.constants.subcommands")
228
+ Aos::Abot::CMDS.keys.each{|k|
229
+ lines += Aos::Vw::Base.lines_for_cmd(Aos::Abot::CMDS[k])
230
+ }
231
+ lines << ""
232
+
233
+ lines
234
+ end
235
+
236
+ # show agodos
237
+ def self.agodo_lines(agodos = nil)
238
+ # list input agodos
239
+ lines = []
240
+ lines << ""
241
+ agodos ||= Aos::Agodo.all
242
+ unless agodos.any?
243
+ lines << I18n.t("abot.messages.no_agodos")
244
+ else
245
+ lines << I18n.t("abot.messages.listing_agodos")
246
+ agodos.each{|a|
247
+ lines += a.you.get_lines
248
+ lines += a.get_lines
249
+ }
250
+ end
251
+ lines << ""
252
+
253
+ lines
254
+ end
255
+ end
256
+ end
data/sys/aos/amg.rb CHANGED
@@ -17,13 +17,13 @@ module Aos
17
17
  CMDS = {
18
18
  INST: {
19
19
  key: :inst,
20
- description: I18n.t("aos.amg.commands.description.inst"),
21
- usage: I18n.t("aos.amg.commands.usage.inst"),
20
+ description: I18n.t("amg.commands.description.inst"),
21
+ usage: I18n.t("amg.commands.usage.inst"),
22
22
  },
23
23
  INSTUN: {
24
24
  key: :instun,
25
- description: I18n.t("aos.amg.commands.description.instun"),
26
- usage: I18n.t("aos.amg.commands.usage.instun"),
25
+ description: I18n.t("amg.commands.description.instun"),
26
+ usage: I18n.t("amg.commands.usage.instun"),
27
27
  },
28
28
  }
29
29
 
@@ -42,51 +42,51 @@ module Aos
42
42
  case args[Aro::Mancy::S].to_sym
43
43
  when Aos::Amg::CMDS[:INST][:key]
44
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."
45
+ ilib_name = args[Aro::Mancy::OS]
46
+ ilib = Aos::Ilib.find_by(name: ilib_name)
47
+ unless ilib.nil?
48
+ if ilib.installed?
49
+ self.instance.display_lines << I18n.t("amg.messages.already_installed", name: ilib_name)
50
50
  else
51
- Aos::Amg.install(lib)
52
- if lib.reload.installed?
53
- self.instance.display_lines << "#{lib_name} installed successfully."
51
+ Aos::Amg.install(ilib)
52
+ if ilib.reload.installed?
53
+ self.instance.display_lines << I18n.t("amg.messages.install_success", name: ilib_name)
54
54
  self.instance.display_lines += self.inst_lines
55
55
  return true
56
56
  else
57
- self.instance.display_lines << "failed to install #{lib_name}."
57
+ self.instance.display_lines << I18n.t("amg.messages.install_failure", name: ilib_name)
58
58
  end
59
59
  end
60
60
  else
61
- self.instance.display_lines << "could not find #{lib_name} lib."
61
+ self.instance.display_lines << I18n.t("amg.messages.cannot_locate", name: ilib_name)
62
62
  end
63
63
  else
64
- # list installed libs
64
+ # list installed ilibs
65
65
  Aos::Amg.inst
66
66
  return true
67
67
  end
68
68
  when Aos::Amg::CMDS[:INSTUN][:key]
69
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."
70
+ ilib_name = args[Aro::Mancy::OS]
71
+ ilib = Aos::Ilib.find_by(name: ilib_name)
72
+ unless ilib.nil?
73
+ if ilib.available?
74
+ self.instance.display_lines << I18n.t("amg.messages.not_installed", name: ilib_name)
75
75
  else
76
- Aos::Amg.uninstall(lib)
77
- if lib.reload.available?
78
- self.instance.display_lines << "#{lib_name} uninstalled successfully."
76
+ Aos::Amg.uninstall(ilib)
77
+ if ilib.reload.available?
78
+ self.instance.display_lines << I18n.t("amg.messages.uninstall_success", name: ilib_name)
79
79
  self.instance.display_lines += self.instun_lines
80
80
  return true
81
81
  else
82
- self.instance.display_lines << "failed to uninstall #{lib_name}."
82
+ self.instance.display_lines << I18n.t("amg.messages.uninstall_failure", name: ilib_name)
83
83
  end
84
84
  end
85
85
  else
86
- self.instance.display_lines << "could not find #{lib_name} lib."
86
+ self.instance.display_lines << I18n.t("amg.messages.cannot_locate", name: ilib_name)
87
87
  end
88
88
  else
89
- # list available libs
89
+ # list available ilibs
90
90
  Aos::Amg.instun
91
91
  return true
92
92
  end
@@ -95,18 +95,18 @@ module Aos
95
95
  return false
96
96
  end
97
97
 
98
- def self.load(lib)
99
- Aos::Lib.find_or_create_by(name: lib)
98
+ def self.load(ilib_name)
99
+ Aos::Ilib.find_or_create_by(name: ilib_name)
100
100
  end
101
101
 
102
- def self.install(lib)
103
- return unless lib.kind_of?(Aos::Lib)
104
- lib.installed!
102
+ def self.install(ilib)
103
+ return unless ilib.kind_of?(Aos::Ilib)
104
+ ilib.installed!
105
105
  end
106
106
 
107
- def self.uninstall(lib)
108
- return unless lib.kind_of?(Aos::Lib)
109
- lib.available!
107
+ def self.uninstall(ilib)
108
+ return unless ilib.kind_of?(Aos::Ilib)
109
+ ilib.available!
110
110
  end
111
111
 
112
112
  def self.inst
@@ -137,20 +137,15 @@ module Aos
137
137
  end
138
138
 
139
139
  def self.inst_lines
140
- # list installed libs
140
+ # list installed ilibs
141
141
  lines = []
142
142
  lines << ""
143
- installed_libs = Aos::Lib.where(status: :installed)
144
- unless installed_libs.any?
145
- lines << I18n.t("aos.amg.lib.none_installed")
143
+ installed_ilibs = Aos::Ilib.where(status: :installed)
144
+ unless installed_ilibs.any?
145
+ lines << I18n.t("amg.messages.none_installed")
146
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
- }
147
+ lines << I18n.t("amg.messages.listing_installed")
148
+ lines += Aos::Amg.ilib_lines(installed_ilibs)
154
149
  end
155
150
  lines << ""
156
151
 
@@ -158,25 +153,32 @@ module Aos
158
153
  end
159
154
 
160
155
  def self.instun_lines
161
- # list installed libs
156
+ # list installed ilibs
162
157
  lines = []
163
158
  lines << ""
164
- available_libs = Aos::Lib.where(status: :available)
165
- unless available_libs.any?
166
- lines << I18n.t("aos.amg.lib.none_available")
159
+ available_ilibs = Aos::Ilib.where(status: :available)
160
+ unless available_ilibs.any?
161
+ lines << I18n.t("amg.messages.none_available")
167
162
  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
- }
163
+ lines << I18n.t("amg.messages.listing_available")
164
+ lines += Aos::Amg.ilib_lines(available_ilibs)
175
165
  end
176
166
  lines << ""
177
167
 
178
168
  lines
179
169
  end
180
170
 
171
+ def self.ilib_lines(ilibs)
172
+ lines = []
173
+ ilibs.each_with_index{|ilib, i|
174
+ lines << "[#{i + Aro::Mancy::S} of #{ilibs.count}]"
175
+ lines << I18n.t("amg.messages.ilib_name", name: ilib.name)
176
+ lines << I18n.t("amg.messages.ilib_path", path: ilib.so_path.split("/").last(Aro::Mancy::N).join("/"))
177
+ lines << I18n.t("amg.messages.ilib_usage", usage: ilib.usage)
178
+ }
179
+
180
+ lines
181
+ end
182
+
181
183
  end
182
184
  end