aro 0.1.8 → 0.1.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 345792256f8f05280325a6624e2b48f4dffbd0215edd29e166d299c9b43a1824
4
- data.tar.gz: ede644cd354d9a8e51ec0081284122546266d1e74ddc7af263eddf7f97e150fc
3
+ metadata.gz: af49f44ed33c7342314aa4ac3a1672dcbe0a4e505bcc6f32e261f328e739f08d
4
+ data.tar.gz: 1c36315bc47db635417b7752617ba4810b5ee9703fcbc4e3da7cc42dbff9ffef
5
5
  SHA512:
6
- metadata.gz: af57fefc8b44ce65dea0f8b94e1d2a6de610875b15a1d3682d5a07d9fcd8537b54f94461da569b877269933fbe4c27c0e84770118b7221904bf8ec0364e27fdf
7
- data.tar.gz: 8a4a5bd92dd6056a3af2e76760912e2785d2bf95c535a0046302e9d67fa4e227c974f1f607125c9723d8912b7bd28d1c1cc2056fbc66186dfd81ee203f54025f
6
+ metadata.gz: 47bb0ac3b11da4fb079a67cbe4c8dab4b86726238f2b218eec6b6ac44865d3f97c2a640c59f0ee00e809c9530d86edf9c09cf051150f5e1946149fc17cdd07a1
7
+ data.tar.gz: 7f3fb149a031c91c3429018ed1704e2a819b480492a32bf832317b7f3b79279a5e04697036f935789a9ce078ab3832eb2be769c907a3469412cbcc05ba09ab14
data/bin/aos CHANGED
@@ -12,6 +12,11 @@
12
12
 
13
13
  require :aro.to_s
14
14
 
15
+ unless Aro::Dom.in_arodom?
16
+ Aos::S.say(I18n.t("cli.errors.not_in_aos" , cmd: Aos::Os.name))
17
+ exit(CLI::EXIT_CODES[:GENERAL_ERROR])
18
+ end
19
+
15
20
  if CLI::ARGV0 == CLI::CMDS[:AOS][:WATCH]
16
21
  Aos::watch
17
22
  else CLI::ARGV0 == CLI::CMDS[:AOS][:RUN] || CLI::ARGV0.nil?
data/bin/aro CHANGED
@@ -34,8 +34,11 @@ when CLI::CMDS[:ARO][:INIT]
34
34
  Aro::Mancy.init
35
35
  else
36
36
  unless Aro::Mancy.game.nil? || CLI::FLAGS[:HELP].include?(CLI::ARGV0)
37
- Aro::P.say(I18n.t("cli.messages.welcome", name: "#{Aro::Mancy.name}.game"))
38
- Aro::Mancy.game.show
37
+ unless ARGV.include?(:aos.to_s)
38
+ Aro::P.say(I18n.t("cli.messages.welcome", name: "#{Aro::Mancy.name}.game"))
39
+ Aro::Mancy.game.show
40
+ end
41
+
39
42
  exit(CLI::EXIT_CODES[:SUCCESS])
40
43
  end
41
44
 
@@ -0,0 +1 @@
1
+ 696d446a043f8261f31ec9750bccbe8749b00d119aa42ab98e164826df266e8b7f7260a88ca2223b36ad14fe6907d5f6305e238c10dc1bfa2cb31450007d911a
@@ -3,8 +3,8 @@ class CreateDecks < ActiveRecord::Migration[8.1]
3
3
  def self.up
4
4
  create_table :decks do |t|
5
5
  t.string :name
6
- t.string :cards
7
- t.string :drawn
6
+ t.string :cards, null: false, default: ""
7
+ t.string :drawn, null: false, default: ""
8
8
 
9
9
  t.timestamps
10
10
  end
data/listen.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require :listen.to_s
2
2
 
3
- listener = Listen.to(*[:sys.to_s, :bin.to_s, :spec.to_s, :locale.to_s], only: /[\.rb\.yml]/) {|modified, added, removed|
3
+ listener = Listen.to(*[:sys.to_s, :bin.to_s, :spec.to_s, :locale.to_s, :db.to_s], only: /[\.rb\.yml]/) {|modified, added, removed|
4
4
  # puts modified
5
5
  # puts added
6
6
  # puts removed
data/locale/en.aos.yml CHANGED
@@ -4,8 +4,9 @@ en:
4
4
  description:
5
5
  cd: "change directory. no args navigates to arodom root."
6
6
  config: "open settings."
7
- config_set: "set a ivar config variable to a specified value."
7
+ config_set: "sets an ivar to a specified value. the prefix '%{prefix}' can be omitted."
8
8
  exit: "exit."
9
+ ls: "list files and folders in the pwd including hidden files."
9
10
  ls: "list files and folders in the pwd."
10
11
  pwd: "show pwd."
11
12
  usage:
@@ -13,6 +14,7 @@ en:
13
14
  config: "$ config"
14
15
  config_set: "$ config set <var_name> <var_value>"
15
16
  exit: "$ exit"
17
+ ls: "$ ll"
16
18
  ls: "$ ls"
17
19
  pwd: "$ pwd"
18
20
  constants:
@@ -25,3 +27,5 @@ en:
25
27
  game:
26
28
  title: "aro"
27
29
  description: "enter commands to play."
30
+ is_the: "welcome to the %{name} game room."
31
+ designed_for: "originally designed for %{description}"
@@ -2,4 +2,4 @@
2
2
  en:
3
3
  cngelog:
4
4
  1765093549_rename_display_column: "rename(ivar): ARO_CONFIG_DISPLAY_COLUMN -> ARO_CONFIG_WIDTH"
5
- 1765094034_add_height_env_var: "add(ivar): ARO_CONFIG_HEIGHT"
5
+ 1765094034_add_height_env_var: "add(ivar): ARO_CONFIG_HEIGHT"
data/locale/en.dom.yml ADDED
@@ -0,0 +1,42 @@
1
+ en:
2
+ dom:
3
+ wings:
4
+ welcome:
5
+ description: "sign up process."
6
+ games:
7
+ description: "aro game rooms."
8
+ know:
9
+ description: "information space."
10
+ setup:
11
+ description: "user configuration space."
12
+ rooms:
13
+ waite:
14
+ description: "sign up."
15
+ winner:
16
+ description: "win."
17
+ abpps:
18
+ description: "artificial beings."
19
+ hbpps:
20
+ description: "human beings."
21
+ shpps:
22
+ description: "human and artificial beings."
23
+ vipps:
24
+ description: "only dev_tarot users. no ruby_facots allowed."
25
+ library:
26
+ description: "definition management."
27
+ temple:
28
+ description: "mindfulness management."
29
+ settings:
30
+ description: "user settings and configuration."
31
+ errors:
32
+ directory_exists: "unable to create arodome at %{name}. file or directory already exists."
33
+ failed_already_in_arodom: "unable to create an arodome because you are already in arodom."
34
+ failed_in_aro_space: "unable to create an arodome inside of aro space."
35
+ failed_already_initialized: "arodome is already initialized. doing nothing."
36
+ messages:
37
+ arodome_created: "%{name} arodome created. enter the following commands to begin: $ cd %{name}"
38
+ creating_arodome: "creating arodome named %{name}"
39
+ generating_wings: "generating wings..."
40
+ generating_wing: "generating the %{wing} wing..."
41
+ generating_room: "generating the %{room} room."
42
+ initialization_complete: "%{name} initialization complete! use aos to begin."
data/locale/en.usage.yml CHANGED
@@ -22,14 +22,25 @@ en:
22
22
  this runs by default after create and has no effect if init is complete.
23
23
 
24
24
  config
25
- config management (ex: update preferences)
26
- todo:
25
+ aro config management.
26
+
27
+ $ aro config <commands>
28
+
29
+ passing no args opens prints the current config.
30
+
31
+ SUBCOMMANDS
32
+ set
33
+ sets an ivar to a specified value. the aro var prefix can be omitted.
34
+
35
+ $ config set <var_name> <var_value>
27
36
 
28
37
  deck
29
- manage decks in the current room
38
+ manage decks in the current room.
30
39
 
31
40
  $ aro deck <commands>
32
41
 
42
+ passing no args opens the selection menu.
43
+
33
44
  note:
34
45
 
35
46
  deck subcommands do not require typing 'deck'. for example,
data/locale/en.yml CHANGED
@@ -16,7 +16,6 @@ en:
16
16
  I2097I_description: "read-only env var for i2097i."
17
17
  YES_description: "read-only env var for 'aroyes'."
18
18
  ALL_description: "read-only env var for 'all'."
19
- def_type: "CLI::Config::DEF_TYPES"
20
19
  dimension:
21
20
  description: "selected dimension of aro space."
22
21
  dev_tarot_description: "reads from /dev/tarot device if available."
@@ -25,39 +24,34 @@ en:
25
24
  description: "aro output format."
26
25
  text_description: "show aro responses in text format (default)"
27
26
  json_description: "show aro responses in json format."
28
-
29
27
  height_description: "display height. valid range: (${min}-${max})"
30
28
  width_description: "display width. valid range: (${min}-${max})"
31
-
32
29
  env:
33
30
  description: "aro run environment."
34
31
  development_description: "basic development logs and features."
35
32
  production_description: "game logging only."
36
33
  test_description: "logging and features tailored for tests."
37
-
34
+ verbose_description: "enable verbose logging in development env."
38
35
  generate: "generating default config file at %{name}."
39
36
  source: "installing ivars from %{name}..."
40
-
41
37
  maximum: "max"
42
38
  minimum: "min"
43
39
  possible_values: "possible values"
44
-
45
40
  type:
46
41
  bool_description: "true or false."
47
42
  int_description: "a primitive decimal-less numeric."
48
43
  string_description: "a blank-space-terminated string of characters."
49
44
  values_description: "an enumerated type."
50
-
51
45
  z_description: "sleep time between attempts to read /dev/tarot. valid range (%{min}-%{max})"
52
46
  z_max_description: "max number of z long sleeps before giving up. valid range (%{min}-%{max})"
53
47
  errors:
54
- # , cmd: Aro::Mancy::I2097I))
55
- header: "$%{cmd}: !error."
56
- invalid_usage: "$%{cmd}: !says you're not supposed to be here."
57
- missing_args: "$%{cmd}: !says missing required argument(s)."
58
- missing_deck: "$%{cmd}: !no deck selected. use 'aro deck' to select one or 'aro deck new <name>' to create one."
59
- not_in_aro: "$%{cmd}: !you are not in aro space. that command will not work here."
60
- not_initialized: "$%{cmd}: you need to initialize aro. run 'aro init' to do so"
48
+ header: "%{cmd} says there was a problem."
49
+ invalid_usage: "%{cmd} says you're not supposed to be here."
50
+ missing_args: "%{cmd} says missing required argument(s)."
51
+ missing_deck: "%{cmd} says no deck selected. use 'aro deck' to select one or 'aro deck new <name>' to create one."
52
+ not_in_aro: "%{cmd} says you are not in aro space. that command will not work here."
53
+ not_in_aos: "%{cmd} says you are not in aos space. that command will not work here."
54
+ not_initialized: "%{cmd} says you need to initialize aro. run 'aro init' to do so"
61
55
  warnings:
62
56
  invalid_order: "the order specified for displaying logs in invalid. using default (desc)."
63
57
  messages:
@@ -92,7 +86,7 @@ en:
92
86
  see aro --help for usage.
93
87
  showing: "showing %{name} [count:%{count}, order:%{order}]..."
94
88
  shuffling: "shuffling %{name}'s cards..."
95
- replacing_drawn: "all drawn cards to %{name}..."
89
+ replacing_drawn: "replacing all drawn cards to %{name}..."
96
90
  resetting: "resetting %{name}'s cards..."
97
91
  understood: "%{name} says: 'understood.'"
98
92
  welcome: "welcome.to.the.%{name}."
data/sys/aos/aos.rb CHANGED
@@ -13,23 +13,24 @@ require :aro.to_s
13
13
  module Aos
14
14
 
15
15
  def self.run
16
+ Aos::Db.new
16
17
  Aos::Os::boot(Aos::you)
17
- Aos::Os.instance.run
18
+ begin
19
+ Aos::Os.instance.run
20
+ rescue Interrupt => e
21
+ Aos::run
22
+ end
18
23
  end
19
24
 
20
25
  def self.watch
26
+ Aos::Db.new
21
27
  Aos::Os::boot(Aos::you)
22
28
  Aos::Os::instance.render
23
29
  end
24
30
 
25
31
  def self.you
26
- Aos::Db.new
27
32
  you = Aos::You.where(name: :you).first
28
- if you.nil?
29
- you = Aos::You.new(name: :you, pwd: Dir.pwd)
30
- you.save
31
- end
32
-
33
+ you = Aos::You.create(name: :you, pwd: Dir.pwd) if you.nil?
33
34
  you
34
35
  end
35
36
 
@@ -38,7 +39,10 @@ module Aos
38
39
 
39
40
  attr_accessor :you, :running, :view
40
41
 
41
- PS1 = "@#{Aos::Os}$"
42
+ A = :"@"
43
+ STAR = :"*"
44
+ PS1 = :">[#{Aos::Os}]>: "
45
+ DATE_FORMAT = "%A %d %b %Y %I:%M:%S %p"
42
46
 
43
47
  CMDS = {
44
48
  CD: {
@@ -53,7 +57,7 @@ module Aos
53
57
  cmds: {
54
58
  SET: {
55
59
  key: :set,
56
- description: I18n.t("aos.commands.description.config_set"),
60
+ description: I18n.t("aos.commands.description.config_set", prefix: CLI::Config::ARO_CONFIG_PREFIX),
57
61
  usage: I18n.t("aos.commands.usage.config_set"),
58
62
  }
59
63
  }
@@ -68,6 +72,11 @@ module Aos
68
72
  description: I18n.t("aos.commands.description.ls"),
69
73
  usage: I18n.t("aos.commands.usage.ls"),
70
74
  },
75
+ LL: {
76
+ key: :ll,
77
+ description: I18n.t("aos.commands.description.ll"),
78
+ usage: I18n.t("aos.commands.usage.ll"),
79
+ },
71
80
  PWD: {
72
81
  key: :pwd,
73
82
  description: I18n.t("aos.commands.description.pwd"),
@@ -80,120 +89,194 @@ module Aos
80
89
  self.instance.load_view
81
90
  end
82
91
 
83
- def load_view
84
- view_name = Aos::Os.osify(you.pwd).split("/").last || :dom.to_s
85
- view_cls = (Aos::Vi.name + "::#{view_name.capitalize}").constantize
86
- Aro::D.say("loading view #{view_cls}")
87
- self.view = view_cls
88
- end
89
-
90
92
  def render
91
93
  return if view.nil?
92
-
93
- view.show(you)
94
+ Dir.chdir(you.pwd) do
95
+ view.show(you)
96
+ end
94
97
  end
95
98
 
96
99
  def run
100
+ # run loop exit condition
97
101
  self.running = true
98
102
 
99
- # begin game loop
100
- while running do
101
- # get input
102
- cmd = Aos::S.p.ask(Aos::Os::PS1)
103
+ # set aos pwd
104
+ Dir.chdir(you.pwd)
105
+
106
+ # configure Readline
107
+ # Readline.completion_append_character = "/"
108
+ Readline.completion_proc = Proc.new{|str|
109
+ # todo: the reserved_words search is working but the || case is not
110
+ Aro::Dom::D.reserved_words.grep(/^#{Regexp.escape(str)}/) ||
111
+ Dir[Dir.pwd + str + Aos::Os::STAR.to_s].grep(/^#{Regexp.escape(str)}/)
112
+ }
103
113
 
104
- # default to passthrough
105
- passthrough = true
114
+ # begin game loop
115
+ while running && cmd = Readline.readline(calc_ps1, true)
116
+ next if cmd.nil?
106
117
 
107
118
  # get args
108
119
  args = cmd.split(" ")
109
120
 
110
- # search for room path
111
- room_path = Aro::Dom.room_path(args[0])
112
- if !room_path.empty?
113
- you.update(pwd: File.join(
114
- File.dirname(Aro::Dom.ethergeist_path),
115
- room_path
116
- ))
117
- Dir.chdir(you.pwd)
118
- next
121
+ next if handle_room_path(args[Aro::Mancy::O]) || handle_aro_override(args)
122
+
123
+ passthrough = !is_aos_command?(args[Aro::Mancy::O])
124
+
125
+ # process commands
126
+ case args[Aro::Mancy::O].to_sym
127
+ when Aos::Os::CMDS[:CONFIG][:key]
128
+ # config
129
+ handle_config(args)
130
+ when Aos::Os::CMDS[:LS][:key]
131
+ # ls
132
+ handle_ls(args)
133
+ when Aos::Os::CMDS[:LL][:key]
134
+ # ll
135
+ handle_ll(args)
136
+ when Aos::Os::CMDS[:PWD][:key]
137
+ # pwd
138
+ handle_pwd(args)
139
+ when Aos::Os::CMDS[:EXIT][:key]
140
+ # exit
141
+ handle_exit(args)
142
+ when Aos::Os::CMDS[:CD][:key]
143
+ # cd
144
+ handle_cd(args)
119
145
  end
120
146
 
121
- # determine if command is Aos::Os::CMDS
122
- if Aos::Os::CMDS.values.map{|v| v[:key]}.include?(args[0].to_sym)
123
- Dir.chdir(you.pwd)
124
- passthrough = false
125
- end
147
+ Aos::S.say(system(cmd)) if passthrough
148
+ end
126
149
 
127
- # config commands
128
-
129
- if args[0].to_sym == Aos::Os::CMDS[:CONFIG][:key]
130
- if args[1].nil?
131
- # show settings
132
- you.update(pwd:
133
- File.join(
134
- File.dirname(Aro::Dom.ethergeist_path),
135
- Aro::Dom::SETUP.to_s,
136
- Aro::Dom::SETTINGS.to_s
137
- )
138
- )
139
- else
140
- Aos::S.say("not implemented.")
141
- end
142
- elsif args[0] == Aos::Os::CMDS[:LS][:key].to_s
143
- Aos::S.say(Dir[File.join(Dir.pwd, "*/")].map{|p| "@/" + Aos::Os::osify(p)}.join("\n"))
144
- elsif args[0] == Aos::Os::CMDS[:PWD][:key].to_s
145
- osified = "@/" + Aos::Os::osify(you.pwd)
146
- Aos::S.say(osified)
147
- elsif args[0] == Aos::Os::CMDS[:EXIT][:key].to_s
148
- Aos::S.say("exiting...")
149
- self.running = false
150
- elsif args[0] == Aos::Os::CMDS[:CD][:key].to_s
151
-
152
- if args[1].nil? || args[1] == "~/"
153
- # no arg takes you to arodom root
154
- you.update(pwd: File.dirname(Aro::Dom.ethergeist_path))
155
- else
156
- if args[1].include?("..")
157
- # going up
158
- if File.dirname(Aro::Dom.ethergeist_path) == you.pwd
159
- Aos::S.say("within #{Aos::Os}, one cannot leave the #{Aro::Dom}.")
160
- else
161
- # todo: support dots in paths
162
- # this only supports moving one level up
163
-
164
- pwd_arr = you.pwd.split("/")
165
- new_pwd = (pwd_arr.first(pwd_arr.length - 1)).join("/")
166
-
167
- you.update(pwd: new_pwd)
168
- end
169
- elsif !args[1].nil?
170
- if args[1][0] != "/" && Dir.exist?(args[1])
171
- you.update(pwd: File.join(you.pwd, args[1]))
172
- else
173
- Aos::S.say("that directory is invalid.")
174
- end
175
- end
176
- end
177
- end
150
+ CLI::EXIT_CODES[:SUCCESS]
151
+ end
178
152
 
179
- if passthrough
180
- system(cmd)
181
- end
153
+ def load_view
154
+ view_name = Aos::Os.osify(you.pwd).split("/").last || :dom.to_s
155
+ view_cls = nil
156
+ begin
157
+ view_cls = (Aos::Vi.name + "::#{view_name.capitalize}").constantize
158
+ rescue
159
+ view_cls = Aos::Vi::Base
182
160
  end
183
161
 
184
- CLI::EXIT_CODES[:SUCCESS]
162
+ Aro::D.say("loading view #{view_cls}")
163
+ self.view = view_cls
185
164
  end
186
165
 
187
- def self.osify(path)
188
- # strips off non-arodom part of path
189
- # Aos::Os::osify()
166
+ def calc_ps1
167
+ you_pwd = Aos::Os::osify(you.pwd)
168
+ "#{Aos::Os::PS1}#{you_pwd.empty? ? "" : "#{you_pwd}:"}$ "
169
+ end
190
170
 
171
+ def self.osify(path)
172
+ return path unless Aro::Dom.in_arodom?
191
173
  path_arr = path.split("/")
192
- Aro::Dom::dom_root.split("/").each{|rdp|
193
- path_arr.delete(rdp)
194
- }
195
-
174
+ Aro::Dom::dom_root.split("/").each{|rdp| path_arr.delete(rdp)}
196
175
  path_arr.join("/")
197
176
  end
177
+
178
+ def is_aos_command?(arg)
179
+ # determine if command is Aos::Os::CMDS
180
+ # passthrough to system if command is not in Aos::Os::CMDS
181
+ Aos::Os::CMDS.values.map{|v| v[:key]}.include?(arg.to_sym)
182
+ end
183
+
184
+ def handle_room_path(arg)
185
+ # search for reserved room path
186
+ handled = false
187
+ room_path = Aro::Dom.room_path(arg)
188
+ if !room_path.empty?
189
+ handled = true
190
+ you.update(pwd: File.join(
191
+ File.dirname(Aro::Dom.ethergeist_path),
192
+ room_path
193
+ ))
194
+ end
195
+ handled
196
+ end
197
+
198
+ def handle_aro_override(args)
199
+ # run all aro commands in aos context
200
+ handled = false
201
+ if args[0].include?(:aro.to_s)
202
+ # passthrough aro cmd with aos appended
203
+ handled = true
204
+ system("#{args.join(" ")} #{:aos.to_s}")
205
+ end
206
+ handled
207
+ end
208
+
209
+ def handle_config(args)
210
+ if args[1].nil?
211
+ # show settings
212
+ you.update(pwd:
213
+ File.join(
214
+ File.dirname(Aro::Dom.ethergeist_path),
215
+ Aro::Dom::SETUP.to_s,
216
+ Aro::Dom::SETTINGS.to_s
217
+ )
218
+ )
219
+ else
220
+ CLI::Config.process_config_command(args)
221
+ end
222
+ end
223
+
224
+ def handle_ls(args)
225
+ Aos::S.say(Dir[File.join(Dir.pwd, (args[1] || "") + Aos::Os::STAR.to_s)].map{|p| "/" + Aos::Os::osify(p)}.join("\n"))
226
+ end
227
+
228
+ def handle_ll(args)
229
+ Aos::S.say(Dir.glob(File.join(Dir.pwd, (args[1] || "") + Aos::Os::STAR.to_s), File::FNM_DOTMATCH).map{|p| "/" + Aos::Os::osify(p)}.join("\n"))
230
+ end
231
+
232
+ def handle_pwd(args)
233
+ osified = "/" + Aos::Os::osify(you.pwd)
234
+ Aos::S.say(osified)
235
+ end
236
+
237
+ def handle_exit(args)
238
+ Aos::S.say("#{Aos::Os} is exiting...")
239
+ self.running = false
240
+ end
241
+
242
+ def handle_cd(args)
243
+ if args[1].nil? || args[1] == "~/"
244
+ # no arg takes you to arodom root
245
+ you.update(pwd: File.dirname(Aro::Dom.ethergeist_path))
246
+ else
247
+ if args[1].include?(Aro::Dom::DOTT.to_s)
248
+ # going up
249
+ if File.dirname(Aro::Dom.ethergeist_path) == you.pwd
250
+ Aos::S.say("within #{Aos::Os}, one cannot leave the #{Aro::Dom}.")
251
+ else
252
+ # todo: support dots in paths
253
+ # this only supports moving one level up
254
+
255
+ pwd_arr = you.pwd.split("/")
256
+ new_pwd = (pwd_arr.first(pwd_arr.length - 1)).join("/")
257
+
258
+ you.update(pwd: new_pwd)
259
+ end
260
+ else
261
+ # this particular block needs to be better
262
+ if args[1][0] == "/"
263
+ Aro::V.say("handling cd to root (/) arg...")
264
+ Aro::V.say(Aro::Dom::dom_root)
265
+ Aro::V.say(args[1][1..])
266
+ args[1] = args[1][1..]
267
+ new_pwd = File.join(Aro::Dom.dom_root, args[1])
268
+ if Dir.exist?(new_pwd)
269
+ you.update(pwd: new_pwd)
270
+ end
271
+ elsif Dir.exist?(args[1]) && args[1] != Aro::Dom::DOT.to_s
272
+ new_pwd = File.join(you.pwd, args[1])
273
+ Aro::V.say("new_pwd: #{new_pwd}")
274
+ you.update(pwd: new_pwd)
275
+ else
276
+ Aos::S.say("that directory is invalid.")
277
+ end
278
+ end
279
+ end
280
+ end
198
281
  end
199
282
  end
data/sys/aos/db.rb CHANGED
@@ -17,12 +17,11 @@ module Aos
17
17
 
18
18
  def initialize
19
19
  # ActiveRecord::Base.logger = Logger.new(STDOUT)
20
- unless Aro::Dom.in_arodom?
20
+ if Aro::Dom.in_arodom?
21
+ set_up_aos
22
+ else
21
23
  Aro::P.say(I18n.t("cli.errors.not_in_aro" , cmd: Aro::Dom.name))
22
- return
23
24
  end
24
-
25
- set_up_aos
26
25
  end
27
26
 
28
27
  def self.base_aro_dir
@@ -42,8 +41,8 @@ module Aos
42
41
  FileUtils.mkdir(Aos::Db.base_aro_dir)
43
42
  end
44
43
 
45
- Aro::D.say("creating database: #{db_config_filepath}")
46
44
  unless File.exist?(db_config_filepath)
45
+ Aro::D.say("creating database: #{db_config_filepath}")
47
46
  # create database config yaml file
48
47
  c = {
49
48
  adapter: :sqlite3.to_s,