aro 0.2.8 → 0.3.0

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/sys/aro/p.rb CHANGED
@@ -18,17 +18,6 @@ module Aro
18
18
  def self.say(message)
19
19
  super("#{Aro::Dom::Ma_ain.ps1_display || Aro::Mancy.ps1_display}#{normalize_message(message)}")
20
20
  end
21
-
22
- def self.default_select(display_text, options)
23
- Aro::P.p.select(
24
- Aro::Dom::Ma_ain.mini_hud_for(display_text),
25
- options,
26
- show_help: :always,
27
- cycle: true,
28
- per_page: 11
29
- )
30
- end
31
-
32
21
  end
33
22
  end
34
23
 
data/sys/aro/plugins.rb CHANGED
@@ -16,6 +16,8 @@ module Aro
16
16
 
17
17
  def self.choose_plugin
18
18
  ensure_plugins_dir_exists!
19
+ Aro::P.say(I18n.t("open_menu.plugins.choose_plugin_description"))
20
+ Aro::P.say(I18n.t("open_menu.plugins.choose_plugin_sample_info"))
19
21
 
20
22
  options = [
21
23
  {name: :back, value: :back}
@@ -34,7 +36,7 @@ module Aro
34
36
  raise "invalid file path! #{selected_option}" unless File.exist?(selected_option)
35
37
 
36
38
  Aro::P.say("selected plugin: #{selected_option}")
37
- confirmed = Aro::P.p.ask(
39
+ confirmed = Aro::Prompt.ask(
38
40
  I18n.t(
39
41
  "open_menu.plugins.confirm_plugin",
40
42
  file_name: File.basename(selected_option)
@@ -75,9 +77,9 @@ module Aro
75
77
  " module Dom",
76
78
  " class SamplePlugin",
77
79
  " def self.oss_om_start!(plugin_data = {})",
78
- " puts self.name",
79
- " puts __method__",
80
- " puts \"running oss_om sample plugin...\"",
80
+ " Aro::P.say(self.name)",
81
+ " Aro::P.say(__method__)",
82
+ " Aro::P.say(\"running oss_om sample plugin...\")",
81
83
  " plugin_data[\"sample_plugin_key\"] = \"hello_from_oss_om_plugin\"",
82
84
  " plugin_data",
83
85
  " end",
@@ -93,9 +95,9 @@ module Aro
93
95
  [".keep", ""],
94
96
  ["sample_plugin.rb", sample_plugin_raw]
95
97
  ].each{|a|
96
- file_path = ::File.join(plugins_dir, a[Aro::Dom::Ma_ain::O])
98
+ file_path = ::File.join(plugins_dir, a[Aro::Mancy::O])
97
99
  ::File.open(file_path, "w+") {|f|
98
- f.write(a[Aro::Dom::Ma_ain::S])
100
+ f.write(a[Aro::Mancy::S])
99
101
  } unless ::File.exist?(file_path)
100
102
  }
101
103
  end
@@ -69,7 +69,7 @@ module Aro
69
69
  when :bool
70
70
  new_value = !(ivar(selected_def_key) == :true.to_s)
71
71
  when :int, :string
72
- new_value = Aro::P.p.ask(
72
+ new_value = Aro::Prompt.ask(
73
73
  I18n.t(
74
74
  "open_menu.new_ivar_value_prompt",
75
75
  def_key: selected_def_key,
@@ -333,8 +333,6 @@ module Aro
333
333
  }
334
334
 
335
335
  def self.open!
336
- cor_menu = Aro::Dom::DataBase.open_menu(:cor)
337
- generate_cor_menu_items! if Aro::Mancy::S == cor_menu.menu_items.count
338
336
  Aro::Dom::Ma_ain.open!(:cor)
339
337
  end
340
338
 
@@ -547,28 +545,6 @@ module Aro
547
545
 
548
546
  private
549
547
 
550
- def self.generate_cor_menu_items!
551
- cor_menu = Aro::Dom::DataBase.open_menu(:cor)
552
- return unless Aro::Mancy::S == cor_menu.menu_items.count
553
-
554
- existing_item = cor_menu.menu_items.first
555
- raise "missing existing item in #{self.name}.#{__method__}!" if existing_item.nil?
556
- EXEC_METHODS.each{|method_name|
557
- menu_item = existing_item || cor_menu.generate_new_item(method_name, for_type: :system)
558
-
559
- cor_menu.rename_item(menu_item, method_name) unless existing_item.nil?
560
- menu_item.aro_file.write!(
561
- Aro::Dom::Store.build_exec_oss_om_params!(
562
- "#{:cor} #{method_name}",
563
- self,
564
- method_name
565
- )
566
- )
567
- # clear existing item var
568
- existing_item = nil unless existing_item.nil?
569
- }
570
- end
571
-
572
548
  def write_config(lines)
573
549
  File.open(Aro::Cor.cor_filepath, "w+") do |file|
574
550
  file.write(lines.join("\n"))
data/sys/aro/store.rb CHANGED
@@ -29,16 +29,12 @@ class Aro::Dom::Store
29
29
  @cache = {} # clear'd
30
30
  end
31
31
 
32
- def self.edit(aro_file, updates)
32
+ def self.save_file!(aro_file, updates)
33
33
  return if aro_file.nil?
34
34
  unless ::File.exist?(aro_file.aro_file_path)
35
35
  ::File.write(aro_file.aro_file_path, {}.to_json)
36
36
  end
37
37
 
38
- Aro::Dom::Ma_ain.sane_backtrace!
39
- puts :todo_validate_updates_or_depricate
40
- puts __method__
41
-
42
38
  store_instance = Aro::Dom::Ma_ain.instance.get_store_for(aro_file)
43
39
  updates.each{|k, v|
44
40
  store_instance.save_key_value_pair(k, v)
data/sys/ma_ain.rb CHANGED
@@ -13,7 +13,7 @@
13
13
  module Aro
14
14
  module Dom
15
15
  class Ma_ain < Aro::Mancy
16
- # inherits Singleton
16
+ include Singleton
17
17
 
18
18
  # evolution planning
19
19
  #
@@ -32,7 +32,7 @@ module Aro
32
32
 
33
33
  EXEC_METHODS = [
34
34
  :exec_library!,
35
- :exec_settings!,
35
+ :exec_configuration!,
36
36
  :exec_quit!
37
37
  ]
38
38
 
@@ -61,17 +61,16 @@ module Aro
61
61
  def reign!
62
62
  begin
63
63
  # default mode is :run
64
- self.run_mode = Aro::Dom::Ma_ain::S
64
+ self.run_mode = 1
65
65
  Aro::P.say("Aro::Dom::Oss_OpenMenu.install!")
66
66
  if Aro::Dom::Oss_OpenMenu.install!
67
67
  Aro::P.say("Aro::Dom::Oss_OpenMenu.boot!")
68
68
  Aro::Dom::Oss_OpenMenu.boot!
69
69
  else
70
70
  Aro::P.say("installation failed. exiting now...")
71
- exit
71
+ self.class.exec_quit!
72
72
  end
73
73
 
74
- self.run_mode = !Aro::Cor.is_production? ? Aro::Dom::Ma_ain::O : Aro::Dom::Ma_ain::S
75
74
  Aro::P.say("Aro::Dom::Designer.design")
76
75
  Aro::Dom::Designer.design
77
76
  rescue RuntimeError => e
@@ -128,7 +127,7 @@ module Aro
128
127
  cryption_text = "#{UNICODE_KEYS[:unsecure]}#{UNICODE_KEYS[:bang]}"
129
128
  end
130
129
 
131
- mode_text = Aro::Dom::Ma_ain::RUN_MODES[self.instance.run_mode || Aro::Mancy::O]
130
+ mode_text = Aro::Dom::Ma_ain::RUN_MODES[self.instance.run_mode]
132
131
  [
133
132
  "(#{cryption_text})[#{mode_text}: ",
134
133
  display_text
@@ -146,7 +145,7 @@ module Aro
146
145
  data_base = menu.directory.data_base
147
146
  raise "invalid data_base!" if data_base.nil?
148
147
 
149
- open_menu(menu)
148
+ self.open_menu(menu)
150
149
  end
151
150
 
152
151
  def self.open!(data_base = :ma_ain)
@@ -162,7 +161,7 @@ module Aro
162
161
  self.instance.valid_security = staged_menu.uuid
163
162
  end
164
163
 
165
- open_menu(staged_menu)
164
+ self.open_menu(staged_menu)
166
165
  end
167
166
 
168
167
  def self.toggle_run_mode
@@ -170,20 +169,30 @@ module Aro
170
169
  end
171
170
 
172
171
  def self.running?
173
- Aro::Dom::Ma_ain::RUN_MODES[self.instance.run_mode || Aro::Mancy::O] == :run
172
+ Aro::Dom::Ma_ain::RUN_MODES[self.instance.run_mode] == :run
174
173
  end
175
174
 
176
175
  def self.get_current_options
177
176
  options = []
178
177
 
179
- options << {back: :back, value: :back} unless self.instance.current_menu.uuid == self.instance.valid_security
178
+ options << {name: :back, value: :back} unless self.instance.current_menu.uuid == self.instance.valid_security
180
179
 
181
- unless Aro::Cor.ivar(:HIDE_F_OSS_OM_MENU).to_s == "true"
180
+ # show open_menu if not running or Aro::Cor ivar is set to false
181
+ hide_preference = Aro::Cor.ivar(:HIDE_F_OSS_OM_MENU).to_s == "true"
182
+
183
+ Aro::D.say("self.running?: #{self.running?}")
184
+ Aro::D.say("will show open_menu: #{hide_preference && !self.running?}")
185
+
186
+ if !hide_preference || !self.running?
182
187
  options << {name: "#{UNICODE_KEYS[:integral]}(#{Aro::Mancy::ARO_DIRECTORY})", value: :open_menu}
183
188
  end
184
189
 
185
- options += self.instance.current_menu.menu_items.select{|mi| mi.user?}.map{|mi| mi.as_tty}
186
- options += self.instance.current_menu.menu_items.select{|mi| mi.system?}.map{|mi| mi.as_tty}
190
+ options += self.instance.current_menu.menu_items.select{|mi| mi.user?}.map{|menu_item|
191
+ {name: menu_item.localized_name, value: menu_item.uuid}
192
+ }
193
+ options += self.instance.current_menu.menu_items.select{|mi| mi.system?}.map{|menu_item|
194
+ {name: menu_item.localized_name, value: menu_item.uuid}
195
+ }
187
196
 
188
197
  options
189
198
  end
@@ -192,11 +201,12 @@ module Aro
192
201
  Aro::Dom::Ma_ain.open!(:library)
193
202
  end
194
203
 
195
- def self.exec_settings!
196
- Aro::Dom::Ma_ain.open!(:settings)
204
+ def self.exec_configuration!
205
+ Aro::Dom::Ma_ain.open!(:configuration)
197
206
  end
198
207
 
199
208
  def self.exec_quit!
209
+ FDot::Based::Processor.user_exited!
200
210
  exit
201
211
  end
202
212
 
@@ -213,6 +223,12 @@ module Aro
213
223
  end
214
224
 
215
225
  def self.run_plugin!(chapter_menu_item, action_data)
226
+ if FDot::DISPLAY_MODES[:websockets] == FDot::Based::Interface.instance.display_mode
227
+ Aro::P.say("plugins cannot be run in FDot::DISPLAY_MODES[:websockets] display mode!")
228
+ Aro::P.say("they must be run directly in the FDot::DISPLAY_MODES[:terminal] display mode.")
229
+ return
230
+ end
231
+
216
232
  plugin_file_path = action_data["plugin_file_path"]
217
233
 
218
234
  raise "invalid plugin_file_path! #{plugin_file_path}" if plugin_file_path.nil? ||
@@ -224,11 +240,9 @@ module Aro
224
240
  if d.kind_of?(Hash)
225
241
  d["plugin_file_path"] = action_data["plugin_file_path"]
226
242
  d["oss_om_type"] = action_data["oss_om_type"]
227
- # self.instance.store_mutex.synchronize do
228
- chapter_menu_item.aro_file.write!({
229
- action_data: d
230
- })
231
- # end
243
+ chapter_menu_item.aro_file.write!({
244
+ action_data: d
245
+ })
232
246
  end
233
247
  }
234
248
 
@@ -240,7 +254,7 @@ module Aro
240
254
  ::File.basename(
241
255
  action_data[:plugin_file_path.to_s]
242
256
  ).to_s.downcase.split(".")[
243
- Aro::Dom::Ma_ain::O
257
+ Aro::Mancy::O
244
258
  ].split("_").map{|w| w.capitalize}.join("")
245
259
  }".constantize
246
260
 
data/sys/reiquire.rb CHANGED
@@ -60,6 +60,7 @@ module Reiquire
60
60
  [
61
61
  :active_record,
62
62
  :"active_record/schema_dumper",
63
+ :f_dot,
63
64
  :fileutils,
64
65
  :"tty-font",
65
66
  :"tty-prompt"
data/sys/shr/prompt.rb CHANGED
@@ -29,15 +29,26 @@ module Aro
29
29
  end
30
30
 
31
31
  def self.ask(message)
32
- gets message
32
+ FDot::Based.ask(message) {|new_value|
33
+ return new_value
34
+ }
33
35
  end
34
36
 
35
37
  def self.say(message)
36
- p.say(normalize_message(message))
38
+ puts normalize_message(message)
39
+ end
40
+
41
+ def self.default_select(display_text, options)
42
+ FDot::Based.tty_prompt_select(
43
+ Aro::Dom::Ma_ain.mini_hud_for(display_text),
44
+ options
45
+ ) {|selected_option|
46
+ return selected_option
47
+ }
37
48
  end
38
49
 
39
50
  def self.less(message)
40
- IO.popen("less -X", "w") { |f| f.puts(message) }
51
+ FDot::Based.less(message)
41
52
  end
42
53
 
43
54
  def self.normalize_message(message)
data/sys/shr/version.rb CHANGED
@@ -11,11 +11,7 @@
11
11
  =end
12
12
 
13
13
  module Aro
14
- VERSION = :"0.2.8"
14
+ VERSION = :"0.3.0"
15
15
  RELEASE_NOTES = [
16
- :basic_settings,
17
- :adds_library,
18
- :adds_books,
19
- :adds_oss_om_plugins
20
16
  ].join(" | ")
21
17
  end
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.8
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - i2097i
@@ -189,9 +189,28 @@ dependencies:
189
189
  - - ">="
190
190
  - !ruby/object:Gem::Version
191
191
  version: 0.5.0
192
- description: |-
193
- aro is a unix utility for designing and creating linux applications.
194
- 0.2.8 release notes: basic_settings | adds_library | adds_books | adds_oss_om_plugins
192
+ - !ruby/object:Gem::Dependency
193
+ name: f_dot
194
+ requirement: !ruby/object:Gem::Requirement
195
+ requirements:
196
+ - - "~>"
197
+ - !ruby/object:Gem::Version
198
+ version: 0.0.3
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: 0.0.3
202
+ type: :runtime
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: 0.0.3
209
+ - - ">="
210
+ - !ruby/object:Gem::Version
211
+ version: 0.0.3
212
+ description: "aro is a unix utility for designing and creating linux applications.\n0.3.0
213
+ release notes: "
195
214
  email:
196
215
  - i2097i@hotmail.com
197
216
  executables:
@@ -223,6 +242,11 @@ files:
223
242
  - checksums/aro-0.2.6.gem.sha512
224
243
  - checksums/aro-0.2.7.gem.sha512
225
244
  - checksums/aro-0.2.8.gem.sha512
245
+ - checksums/aro-0.2.9.gem.sha512
246
+ - checksums/aro-0.3.0.gem.sha512
247
+ - craft_docker-compose.template
248
+ - craft_env.template
249
+ - craft_reinstall_gems.sh
226
250
  - listen.rb
227
251
  - locale/en.cor.yml
228
252
  - locale/en.menu_items.yml
@@ -247,15 +271,20 @@ files:
247
271
  - sys/aro/models/concerns/.keep
248
272
  - sys/aro/models/concerns/tar_go_for_root_sec.rb
249
273
  - sys/aro/models/concerns/uuid.rb
274
+ - sys/aro/models/cubicus.rb
250
275
  - sys/aro/models/data_base.rb
251
276
  - sys/aro/models/directory.rb
252
277
  - sys/aro/models/file.rb
278
+ - sys/aro/models/glyph.rb
253
279
  - sys/aro/models/menu.rb
254
280
  - sys/aro/models/menu_item.rb
281
+ - sys/aro/models/objecticus.rb
282
+ - sys/aro/models/perspecticus.rb
283
+ - sys/aro/open_system/projector.rb
255
284
  - sys/aro/oss_open_menu.rb
285
+ - sys/aro/oss_open_system.rb
256
286
  - sys/aro/p.rb
257
287
  - sys/aro/plugins.rb
258
- - sys/aro/r.rb
259
288
  - sys/aro/settings/cor.rb
260
289
  - sys/aro/settings/git.rb
261
290
  - sys/aro/settings/ssh.rb
data/sys/aro/r.rb DELETED
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- =begin
4
-
5
- r.rb
6
-
7
- r logger for i2097i.
8
-
9
- by i2097i
10
-
11
- =end
12
-
13
- require_relative :"../shr/prompt".to_s
14
-
15
- module Aro
16
- class R < Aro::Prompt
17
- def self.say(message)
18
- super("#{Aro::Mancy.ps1_display(Aro::R.name)} #{normalize_message(message)}")
19
- end
20
- end
21
- end
22
-