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.
data/locale/en.data.yml CHANGED
@@ -18,7 +18,7 @@ en:
18
18
  no_yous: "no yous."
19
19
  usage: |
20
20
 
21
- data [-h | --help] <command>
21
+ data [-h | --help] var_command
22
22
  aos data management.
23
23
 
24
24
  COMMANDS
data/locale/en.dom.yml CHANGED
@@ -42,5 +42,5 @@ en:
42
42
  generating_wing: "generating the %{wing} wing..."
43
43
  generating_room: "generating the %{room} room."
44
44
  initialization_complete: "%{name} initialization complete! use aos to begin."
45
- missing_root_username: "missing <root_username> argument."
46
- missing_root_password: "missing <root_password> argument."
45
+ missing_root_username: "missing var_root_username argument."
46
+ missing_root_password: "missing var_root_password argument."
data/locale/en.flie.yml CHANGED
@@ -20,7 +20,7 @@ en:
20
20
  no_fpxies: "no fpxies."
21
21
  usage: |
22
22
 
23
- flie [-h | --help] <command>
23
+ flie [-h | --help] var_command
24
24
  flie management.
25
25
 
26
26
  COMMANDS
data/locale/en.usage.yml CHANGED
@@ -1,5 +1,37 @@
1
1
  en:
2
2
  usage:
3
+ dom: |
4
+ aro dom
5
+ aos arodome management.
6
+
7
+ $ aro dom var_command
8
+
9
+ quickstart or tldr;
10
+
11
+ $ aro dom new var_name && cd var_name && aro dom init var_root_username var_root_password
12
+
13
+ COMMANDS
14
+ init
15
+ initialize and generate the arodome.
16
+ run once from the dom base directory.
17
+
18
+ params:
19
+ var_root_username: root aos username.
20
+ var var_root_password: root aos password.
21
+
22
+ usage:
23
+
24
+ $ aro dom init var_root_username var_root_password
25
+
26
+ new
27
+ create a new arodome with the specified name.
28
+
29
+ example:
30
+
31
+ $ aro dom new var_name
32
+
33
+
34
+ aro by i2097i is copyright (2025)
3
35
  main: |
4
36
  NAME
5
37
 
@@ -7,17 +39,21 @@ en:
7
39
 
8
40
  SYNOPSIS
9
41
 
10
- aro [-v | --version] [-h | --help] <command1> <command2>
42
+ aro [-v | --version] [-h | --help] [(+|-)(T|C|S|P|W)(var_numeral)] var_command
11
43
 
12
- quickstart or tldr;
44
+ quickstart or tldr; example:
45
+
46
+ $ aro create var_name && cd var_name && aro teck new var_teck_name && aro
13
47
 
14
- $ aro create <name> && cd <name> && aro teck new <teck> && aro
48
+ card lookup example:
49
+
50
+ $ aro +TXXI
15
51
 
16
52
  COMMANDS
17
53
  create
18
- create and init an aro space named <name>:
54
+ create and init an aro space named var_name:
19
55
 
20
- $ aro create <name>
56
+ $ aro create var_name
21
57
 
22
58
  init
23
59
  sets up the .aro directory that contains database and cor
@@ -28,109 +64,100 @@ en:
28
64
  cor
29
65
  aro cor management.
30
66
 
31
- $ aro cor <var_name> <var_value>
67
+ $ aro cor var_name var_value
32
68
 
33
69
  basic usage:
34
70
 
35
- pass no args
36
- print the cor.
71
+ no params prints the cor.
37
72
 
38
73
  $ aro cor
39
74
 
40
- pass <var_name>
41
- print the var named <var_name>.
75
+ param var_name prints the var named var_name.
42
76
 
43
- $ aro cor <var_name>
77
+ $ aro cor var_name
44
78
 
45
- pass <var_name> <var_value>
46
- update a var named <var_name> with <var_value>.
79
+ param var_name & param var_value updates a var named var_name with var_value.
47
80
 
48
- $ aro cor <var_name> <var_value>
81
+ $ aro cor var_name var_value
49
82
 
50
83
  teck
51
- manage tecks in the aro space.
52
-
53
- $ aro teck <commands>
54
-
55
- passing no args opens the selection menu.
84
+ aro teck commands.
56
85
 
57
- note:
58
-
59
- teck subcommands do not require typing 'teck'. for example,
86
+ $ aro teck [-h | --help]
60
87
 
61
- $ aro teck show
88
+ dom
89
+ aos arodome management.
62
90
 
63
- is the same thing as:
91
+ $ aro dom [-h | --help]
64
92
 
65
- $ aro show
66
93
 
67
- SUBCOMMANDS
68
- draw
69
- draw a random card from the current teck.
94
+ aro by i2097i is copyright (2025)
95
+ teck: |
96
+ aro teck
97
+ manage tecks in the aro space.
70
98
 
71
- explore
72
- allows user to browse each card in the current teck.
99
+ $ aro teck var_command
73
100
 
74
- new
75
- create a new teck with the specified name.
101
+ passing no params opens the selection menu.
76
102
 
77
- example:
103
+ note:
78
104
 
79
- $ aro teck new <name>
105
+ teck subcommands do not require typing 'teck'. for example,
80
106
 
81
- replace
82
- replaces all drawn cards FIFO and puts them on the bottom of
83
- the teck. this will preserve all card orientations.
107
+ $ aro teck show
84
108
 
85
- reset
86
- completely reset the teck. replace all drawn and reset order.
87
- all orientations will be set to upright. you must enter 'aroyes'
88
- to continue.
109
+ is the same thing as:
89
110
 
90
- show
91
- displays the current teck's log record(s).
111
+ $ aro show
92
112
 
93
- the default behavior is to display only the most recent log record.
113
+ COMMANDS
114
+ draw
115
+ draw a random card from the current teck.
94
116
 
95
- note:
96
-
97
- 'less' is automatically used to view text output log count > 1
117
+ explore
118
+ allows user to browse each card in the current teck.
98
119
 
99
- OPTIONS
120
+ new
121
+ create a new teck with the specified name.
100
122
 
101
- [-n | --count] specify number of teck tlogs to show.
123
+ example:
102
124
 
103
- default is 1 (latest/current state)
125
+ $ aro teck new var_name
104
126
 
105
- passing 'all' display all tlogs
127
+ replace
128
+ replaces all drawn cards FIFO and puts them on the bottom of
129
+ the teck. this will preserve all card orientations.
106
130
 
107
- [-o | --order] specify the output order of the log records.
131
+ reset
132
+ completely reset the teck. replace all drawn and reset order.
133
+ all orientations will be set to upright. you must enter 'aroyes'
134
+ to continue.
108
135
 
109
- default is 'desc'
136
+ show
137
+ displays the current teck's log record(s).
110
138
 
111
- possible values: ['asc', 'desc']
139
+ the default behavior is to display only the most recent log record.
112
140
 
113
- shuffle
114
- shuffles the current teck and generates a log record.
141
+ note:
115
142
 
116
- dom
117
- aos arodome management.
143
+ 'less' is automatically used to view text output log count > 1
118
144
 
119
- $ aro dom <commands>
145
+ OPTIONS
120
146
 
121
- SUBCOMMANDS
122
- init <username> <password>
123
- generate the arodome
124
- new
125
- create a new arodome with the specified name.
147
+ [-n | --count] specify number of teck tlogs to show.
126
148
 
127
- example:
149
+ default is 1 (latest/current state)
128
150
 
129
- $ aro dom new <name>
151
+ passing 'all' display all tlogs
130
152
 
153
+ [-o | --order] specify the output order of the log records.
131
154
 
155
+ default is 'desc'
132
156
 
157
+ possible values: ['asc', 'desc']
133
158
 
159
+ shuffle
160
+ shuffles the current teck and generates a log record.
134
161
 
135
162
 
136
- aro by i2097i is copyright (2025)
163
+ aro by i2097i is copyright (2025)
data/locale/en.yml CHANGED
@@ -8,10 +8,11 @@ en:
8
8
  header: "%{cmd} says there was a problem."
9
9
  invalid_usage: "%{cmd} says you're not supposed to be here."
10
10
  missing_args: "%{cmd} says missing required argument(s)."
11
- missing_teck: "%{cmd} says no teck selected. use 'aro teck' to select one or 'aro teck new <name>' to create one."
11
+ missing_teck: "%{cmd} says no teck selected. use 'aro teck' to select one or 'aro teck new var_name' to create one."
12
+ not_found: "%{cmd} not found."
12
13
  not_in_aro: "%{cmd} says you are not in aro space. that command will not work here."
13
14
  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>"
15
+ not_initialized_dom: "%{cmd} says you need to initialize dom. $ aro dom init var_root_username var_root_password"
15
16
  not_initialized: "%{cmd} says you need to initialize aro. run 'aro init' to do so"
16
17
  warnings:
17
18
  invalid_order: "the order specified for displaying tlogs in invalid. using default (desc)."
@@ -44,7 +45,7 @@ en:
44
45
 
45
46
  use the following command to create one:
46
47
 
47
- $ aro teck new <teck_name>
48
+ $ aro teck new var_name
48
49
 
49
50
  see aro --help for usage.
50
51
  showing: "showing %{name} [count:%{count}, order:%{order}]..."
data/sys/aos/abot.rb CHANGED
@@ -78,6 +78,7 @@ module Aos
78
78
  end
79
79
 
80
80
  def self.process_cmd(args)
81
+ args = Aos::Os.sanitize_you(args)
81
82
  if args[Aro::Mancy::S].nil?
82
83
  Aos::Abot.abot
83
84
  return true
@@ -118,6 +119,7 @@ module Aos
118
119
 
119
120
  # create and list agodos
120
121
  def self.agodo(args)
122
+ args = Aos::Os.sanitize_you(args)
121
123
  if args[Aro::Mancy::OS].nil?
122
124
  # list agodos
123
125
  self.instance.display_lines = Aos::Abot.agodo_lines
@@ -128,7 +130,7 @@ module Aos
128
130
  !args[Aro::Mancy::E].nil? &&
129
131
  !args[Aro::Mancy::N].nil?
130
132
  # create mode
131
- # abot agodo <go> <do> <rate>
133
+ # abot agodo var_go var_do var_rate
132
134
  arg_go = args[Aro::Mancy::OS]
133
135
  arg_do = args[Aro::Mancy::E]
134
136
  arg_rate = args[Aro::Mancy::N]
@@ -138,10 +140,9 @@ module Aos
138
140
  agodo_record.do = arg_do
139
141
  agodo_record.rate = arg_rate
140
142
  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
+ self.instance.display_lines = ["successfully created an agodo named #{agodo_record.you.name}."] + Aos::Abot.agodo_lines
143
144
  else
144
- self.instance.display_lines += agodo_record.errors.to_a.map(&:downcase)
145
+ self.instance.display_lines = agodo_record.errors.to_a.map(&:downcase)
145
146
  end
146
147
  else
147
148
  self.instance.display_lines = [I18n.t("abot.messages.invalid_agodo_cmd")]
@@ -158,8 +159,7 @@ module Aos
158
159
  Aos::Cor.int_valid?(args[Aro::Mancy::E]&.to_i)
159
160
  agodo_record = agodo_you.agodo
160
161
  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
162
+ self.instance.display_lines = ["#{agodo_record.you.name} rate updated."] + Aos::Abot.agodo_lines
163
163
  else
164
164
  self.instance.display_lines = [I18n.t("abot.messages.invalid_agodo_cmd")]
165
165
  end
@@ -170,17 +170,18 @@ module Aos
170
170
  n = agodo_name&.strip&.upcase
171
171
  agodo_you = Aos::You.find_by(name: n)
172
172
  unless agodo_you.nil?
173
- self.instance.display_lines << "derezing #{agodo_you.name} agodo."
173
+ lines = ["derezing #{agodo_you.name} agodo."]
174
174
  agodo_record = agodo_you.agodo
175
175
  agodo_record&.destroy
176
176
  agodo_you.ilogs.destroy_all
177
177
  agodo_you.destroy
178
178
  requery = Aos::You.find_by(name: n)
179
179
  if requery.nil? && requery&.agodo.nil?
180
- self.instance.display_lines << "successfully destroyed #{n} agodo."
180
+ lines << "successfully destroyed #{n} agodo."
181
181
  else
182
- self.instance.display_lines << "unable to destroyed the #{n} agodo."
182
+ lines << "unable to destroyed the #{n} agodo."
183
183
  end
184
+ self.instance.display_lines = lines
184
185
  else
185
186
  self.instance.display_lines = [I18n.t("abot.messages.invalid_agodo_cmd")]
186
187
  end
@@ -194,8 +195,7 @@ module Aos
194
195
  unless agodo_you.nil?
195
196
  agodo_record = agodo_you.agodo
196
197
  agodo_record.update(power: :off)
197
- self.instance.display_lines << "#{agodo_record.you.name} stopped."
198
- self.instance.display_lines += Aos::Abot.agodo_lines
198
+ self.instance.display_lines = ["#{agodo_record.you.name} stopped."] + Aos::Abot.agodo_lines
199
199
  else
200
200
  self.instance.display_lines = [I18n.t("abot.messages.invalid_agodo_cmd")]
201
201
  end
@@ -210,8 +210,7 @@ module Aos
210
210
  agodo_record = agodo_you.agodo
211
211
  agodo_record.update(power: :on)
212
212
 
213
- self.instance.display_lines << "#{agodo_record.you.name} started."
214
- self.instance.display_lines += Aos::Abot.agodo_lines
213
+ self.instance.display_lines = ["#{agodo_record.you.name} started."] + Aos::Abot.agodo_lines
215
214
  else
216
215
  self.instance.display_lines = [I18n.t("abot.messages.invalid_agodo_cmd")]
217
216
  end
data/sys/aos/aos.rb CHANGED
@@ -240,9 +240,9 @@ module Aos
240
240
  return if @view.nil?
241
241
 
242
242
  Dir.chdir(self.you.reload.pwd) do
243
- if Aro::Mancy.in_aro?
244
- Aro::Mancy.init
243
+ if Aro::Mancy.in_aro? && !Aos::Os.osify(self.you.pwd).include?(Aro::Dom.room_path(:abot))
245
244
  if Aro::Mancy.is_initialized? && !Aro::Mancy.teck.nil?
245
+ Aro::Mancy.init
246
246
  Aro::Mancy.teck.show
247
247
  end
248
248
  else
@@ -371,29 +371,30 @@ module Aos
371
371
  `#{args.join(" ")}`
372
372
  end
373
373
 
374
- def process_cmd(cmd)
375
- # load config
376
- Aos::Cor.instance.load
377
- load_you!
378
- Dir.chdir(self.you.reload.pwd) do
379
- send_to_system_call = main(cmd)
380
- nothing = nil
381
- unless cmd.nil? || cmd.empty?
382
- nothing = handle_aro_override(cmd.split(" "))
383
- self.you.generate_ilog(cmd)
384
- end
385
- if send_to_system_call && nothing.nil?
386
- nothing = `#{cmd}`
387
- end
374
+ Mutex.new.synchronize do
375
+ def process_cmd(cmd)
376
+ Aos::Cor.instance.cor_path = nil
377
+ Aos::Cor.instance.load
378
+ Dir.chdir(self.you.reload.pwd) do
379
+ send_to_system_call = main(cmd)
380
+ nothing = nil
381
+ unless cmd.nil? || cmd.empty?
382
+ nothing = handle_aro_override(cmd.split(" "))
383
+ self.you.generate_ilog(cmd)
384
+ end
385
+ if send_to_system_call && nothing.nil?
386
+ nothing = `#{cmd}`
387
+ end
388
388
 
389
- unless nothing.nil?
390
- Aos::Os.say(nothing)
391
- else
392
- render
389
+ unless nothing.nil?
390
+ Aos::Os.say(nothing)
391
+ else
392
+ render
393
+ end
393
394
  end
394
- end
395
395
 
396
- CLI::EXIT_CODES[:SUCCESS]
396
+ CLI::EXIT_CODES[:SUCCESS]
397
+ end
397
398
  end
398
399
 
399
400
  def configure_readline(env)
@@ -429,14 +430,15 @@ module Aos
429
430
  cmd = nil
430
431
 
431
432
  loop do
432
- configure_readline :aos
433
- break unless self.running && cmd = Readline.readline(calc_ps1)
434
- IO.console.erase_screen(Aro::Mancy::S)
435
433
  height, width = IO.console.winsize
436
434
  IO.console.goto(height, Aro::Mancy::O)
437
435
  process_cmd(cmd)
436
+ break unless self.running && cmd = Readline.readline(calc_ps1)
437
+ IO.console.erase_screen(Aro::Mancy::S)
438
+ configure_readline :aos
438
439
  end
439
440
 
441
+
440
442
  out
441
443
  end
442
444
 
@@ -546,12 +548,15 @@ module Aos
546
548
  self.you.home!
547
549
  else
548
550
  room_path = Aro::Dom.room_path(arg)
551
+ Aro::D.say("#{__method__}#{Aos::Os::A}room_path: #{room_path}")
549
552
  if !self.you.root? &&
550
553
  room_path.include?(Aro::Dom::ROOT.to_s)
554
+ Aro::D.say("#{__method__}#{Aos::Os::A}invalid")
551
555
  self.display_lines = ["invalid access to #{room_path}. doing nothing."]
552
556
  elsif !room_path.empty?
553
557
  handled = true
554
558
  if room_path == Aro::Dom::HOME.to_s
559
+ Aro::D.say("#{__method__}#{Aos::Os::A}home!")
555
560
  self.you.home!
556
561
  else
557
562
  Aro::D.say("#{__method__}#{Aos::Os::A}#{room_path}")
@@ -601,7 +606,7 @@ module Aos
601
606
  Aos::Os.say(["#{Aos::Os} is exiting..."])
602
607
  begin
603
608
  Aos::Abot.terminate
604
- Aos::Os.terminateq
609
+ # Aos::Os.terminateq
605
610
  rescue StandardError => e
606
611
  Aro::D.say(e)
607
612
  end
data/sys/aos/cor.rb CHANGED
@@ -421,6 +421,7 @@ module Aos
421
421
  Mutex.new.synchronize do
422
422
  def self.get_cor_path
423
423
  if self.instance.cor_path.nil?
424
+ Aos::Db.load
424
425
  if Aro::Dom.in_arodom?
425
426
  Aos::Os.instance.load_you!
426
427
  if Aos::Os.instance.you.root? ||
@@ -457,7 +458,7 @@ module Aos
457
458
  Aos::Cor.ivar(:ENV) == Aos::Cor::ENVS[:TEST].to_s
458
459
  end
459
460
 
460
- def self.display_configuration
461
+ def self.discon
461
462
  height = Aos::Cor.ivar(:HEIGHT).to_i
462
463
  width = Aos::Cor.ivar(:WIDTH).to_i
463
464
  if !Aro::Dom.in_arodom? ||
@@ -487,7 +488,7 @@ module Aos
487
488
  k = Aos::Cor::DEF.keys.filter{|k| k == args[Aro::Mancy::S]&.upcase&.to_sym}&.first
488
489
  unless k.nil?
489
490
  unless args[Aro::Mancy::OS].nil?
490
- # config <var_name> <var_value>
491
+ # config var_name var_value
491
492
  Aos::Cor.set_ivar(args[Aro::Mancy::S], args[Aro::Mancy::OS])
492
493
  end
493
494
 
@@ -677,7 +678,7 @@ module Aos
677
678
  end
678
679
 
679
680
  def lines_div
680
- ["#" * Aro::Mancy::NUMERALS[:XXI].pow(Aro::Mancy::OS)]
681
+ ["".ljust(Aro::Mancy::NUMERALS[:XLII] * Aro::Mancy::OS, "#")]
681
682
  end
682
683
 
683
684
  def lines_newline_comment
@@ -694,13 +695,12 @@ module Aos
694
695
 
695
696
  def lines_config_header
696
697
  [
697
- "# this #{Aos::Os} cor configuration file",
698
- "# was auto generated by the #{Aos::Cor.name}."
698
+ "# #{Aos::Os} cor configuration file generated by #{Aos::Cor.name}."
699
699
  ]
700
700
  end
701
701
 
702
702
  def lines_var_section_div
703
- ["# VARIABLE SECTION!"]
703
+ ["# Aos::Cor::DEF"]
704
704
  end
705
705
 
706
706
  def lines_def_type_description
@@ -712,16 +712,13 @@ module Aos
712
712
  }
713
713
  lines += lines_newline_comment_os
714
714
  lines << "# Aos::Cor::DEF"
715
- lines << "# define & expose an aos cor bash api via ENV variables."
716
- lines << "# there are two types of bash vars in aos."
715
+ lines << "# define and expose an aos cor bash api via ENV variables."
716
+ lines << "# there are two types of cor vars in aos."
717
717
  lines << "# 1) in vars (ivars). "
718
- lines << "# => ivars enter aos from this file during aos init."
719
- lines << "# => cor validates them and uses them unless unvalid."
720
- lines << "# => otherwise aos will use the defaults listed below."
718
+ lines << "# => write variables from this file."
719
+ lines << "# => they are validated and used unless unvalid."
721
720
  lines << "# 2) out vars (ovars)."
722
- lines << "# => ovars are read-only vars that aos cor exposes to bash."
723
- lines << "# => this is useful because it provides a bash interface"
724
- lines << "# => which can be used to write programs on top of aos."
721
+ lines << "# => read-only variables that aos cor exposes to bash."
725
722
  end
726
723
 
727
724
  def lines_var(k, v, mem_v = nil)
data/sys/aos/db.rb CHANGED
@@ -19,12 +19,10 @@ module Aos
19
19
  SQL_FILE = :"aos.sql"
20
20
 
21
21
  def self.load(password = nil)
22
- Aos::Db.configure_logger
23
22
  Mutex.new.synchronize do
24
23
  if Aro::Dom.in_arodom?
24
+ Aos::Db.configure_logger
25
25
  self.instance.set_up_aos(password)
26
- else
27
- Aro::P.say(I18n.t("cli.errors.not_in_aro" , cmd: Aro::Dom.name))
28
26
  end
29
27
  end
30
28
  end
@@ -9,7 +9,6 @@
9
9
  =end
10
10
 
11
11
  require :base64.to_s
12
- require_relative :"./base_model".to_s
13
12
 
14
13
  class Aos::Agodo < ActiveRecord::Base
15
14
  belongs_to :you
@@ -22,7 +21,7 @@ class Aos::Agodo < ActiveRecord::Base
22
21
 
23
22
  def godo
24
23
  godos_per_minute = Aro::Mancy::NUMERALS[:LX].to_f / rate.to_f
25
-
24
+ # todo: this is awful
26
25
  if Time.now - updated_at >= godos_per_minute
27
26
  system("#{:aos} #{self.go} #{Aos::Os::YOU_FLAG} #{self.you.name}")
28
27
  system("#{:aos} #{self.do.gsub("_", " ")} #{Aos::Os::YOU_FLAG} #{self.you.name}")
@@ -8,8 +8,6 @@
8
8
 
9
9
  =end
10
10
 
11
- require_relative :"./base_model".to_s
12
-
13
11
  module Aos
14
12
  class Fpxy < ActiveRecord::Base
15
13
  # table_name :fpxies
@@ -10,8 +10,6 @@
10
10
 
11
11
  # installed lib modules section
12
12
 
13
- require_relative :"./base_model".to_s
14
-
15
13
  module CRS
16
14
  SO_FILE = :"libcrs.so".to_s
17
15
  SO_PATH = File.join(
@@ -8,8 +8,6 @@
8
8
 
9
9
  =end
10
10
 
11
- require_relative :"./base_model".to_s
12
-
13
11
  module Aos
14
12
  class Ilog < ActiveRecord::Base
15
13
  belongs_to :you
@@ -8,13 +8,12 @@
8
8
 
9
9
  =end
10
10
 
11
- require_relative :"./base_model".to_s
12
-
13
11
  module Aos
14
12
  class You < ActiveRecord::Base
15
13
  has_many :ilogs
16
14
  has_one :agodo
17
15
  has_many :fpxies
16
+
18
17
  before_validation :set_pwd
19
18
  before_create :create_home_directory
20
19
  after_update :clear_aos_display
@@ -39,6 +38,7 @@ module Aos
39
38
  name: self.name,
40
39
  home: self.home,
41
40
  pwd: self.pwd,
41
+ stream_bytes: File.stat(stream_file).size
42
42
  }
43
43
  end
44
44
 
@@ -72,7 +72,7 @@ module Aos
72
72
  end
73
73
 
74
74
  def stream(lines)
75
- File.open(File.join(self.home, Aos::You::ARO_SRT_FILE.to_s), "a+") do |aro_srt|
75
+ File.open(stream_file, "a+") do |aro_srt|
76
76
  aro_srt.write(lines.join("\n"))
77
77
  aro_srt.write("\n")
78
78
  end
@@ -84,6 +84,10 @@ module Aos
84
84
  self.pwd = Dir.pwd if self.pwd.nil?
85
85
  end
86
86
 
87
+ def stream_file
88
+ File.join(self.home, Aos::You::ARO_SRT_FILE.to_s)
89
+ end
90
+
87
91
  def create_home_directory
88
92
  return if root? || agodo? || Dir.exist?(File.join(Aro::Dom.room_path(Aro::Dom::HOME), self.name))
89
93
  Aro::Dom.instance.generate_room(Aro::Dom::D::LAYOUT[:HOME], {name: self.name.to_sym})