aro 0.2.7 → 0.2.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.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +7 -2
  3. data/README.md +8 -7
  4. data/aro.gemspec +6 -3
  5. data/bin/oss_om +14 -1
  6. data/checksums/aro-0.2.8.gem.sha512 +1 -0
  7. data/checksums/aro-0.2.9.gem.sha512 +1 -0
  8. data/craft_docker-compose.template +59 -0
  9. data/locale/en.cor.yml +15 -11
  10. data/locale/en.yml +25 -1
  11. data/sys/aro/action.rb +35 -56
  12. data/sys/aro/book.rb +150 -0
  13. data/sys/aro/db/migrate/1793913841_create_menus.rb +1 -0
  14. data/sys/aro/db/migrate/1793913861_create_menu_items.rb +1 -0
  15. data/sys/aro/designer.rb +157 -37
  16. data/sys/aro/imports.rb +78 -0
  17. data/sys/aro/library.rb +202 -0
  18. data/sys/aro/locale.rb +4 -4
  19. data/sys/aro/mancy.rb +2 -2
  20. data/sys/aro/models/concerns/tar_go_for_root_sec.rb +1 -4
  21. data/sys/aro/models/cubicus.rb +39 -0
  22. data/sys/aro/models/data_base.rb +60 -13
  23. data/sys/aro/models/directory.rb +1 -5
  24. data/sys/aro/models/file.rb +1 -1
  25. data/sys/aro/models/glyph.rb +69 -0
  26. data/sys/aro/models/menu.rb +43 -14
  27. data/sys/aro/models/menu_item.rb +6 -10
  28. data/sys/aro/models/objecticus.rb +28 -0
  29. data/sys/aro/models/perspecticus.rb +28 -0
  30. data/sys/aro/open_system/projector.rb +103 -0
  31. data/sys/aro/oss_open_menu.rb +29 -48
  32. data/sys/aro/oss_open_system.rb +117 -0
  33. data/sys/aro/p.rb +0 -11
  34. data/sys/aro/plugins.rb +106 -0
  35. data/sys/aro/settings/cor.rb +97 -54
  36. data/sys/aro/settings/git.rb +0 -25
  37. data/sys/aro/settings/ssh.rb +15 -30
  38. data/sys/aro/store.rb +34 -15
  39. data/sys/aro/v.rb +1 -1
  40. data/sys/ma_ain.rb +115 -36
  41. data/sys/reiquire.rb +1 -0
  42. data/sys/shr/prompt.rb +14 -3
  43. data/sys/shr/version.rb +1 -4
  44. data/tasks/make.rake +2 -3
  45. metadata +38 -5
  46. data/sys/aro/r.rb +0 -22
data/sys/aro/v.rb CHANGED
@@ -20,7 +20,7 @@ module Aro
20
20
  end
21
21
 
22
22
  def self.should_print?
23
- Aro::Cor.ivar(:VERBOSE).to_s == Aro::Cor::BOOLS[:TRUE].to_s && super
23
+ Aro::Cor.ivar(:VERBOSE).to_s == Aro::Cor::BOOLS[:TRUE].to_s
24
24
  end
25
25
  end
26
26
  end
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
  #
@@ -31,8 +31,8 @@ module Aro
31
31
  #
32
32
 
33
33
  EXEC_METHODS = [
34
- :exec_browse_data_bases!,
35
- :exec_settings!,
34
+ :exec_library!,
35
+ :exec_configuration!,
36
36
  :exec_quit!
37
37
  ]
38
38
 
@@ -55,28 +55,27 @@ module Aro
55
55
  attr_accessor :data_mutex, :store_mutex
56
56
  attr_accessor :stores
57
57
  # todo: unused currently. init instance with hashing algo stuff
58
- attr_accessor :valid_settings
58
+ attr_accessor :valid_security
59
59
  attr_accessor :run_mode
60
60
 
61
61
  def reign!
62
62
  begin
63
63
  # default mode is :run
64
- self.run_mode = Aro::Mancy::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
  Aro::P.say("Aro::Dom::Designer.design")
74
75
  Aro::Dom::Designer.design
75
76
  rescue RuntimeError => e
76
-
77
77
  Aro::P.say("#{e.class}! #{e.inspect}")
78
- self.class.i2097i_bookmark
79
- reign!
78
+ raise e
80
79
  end
81
80
  end
82
81
 
@@ -87,14 +86,18 @@ module Aro
87
86
  @stores = {}
88
87
  end
89
88
 
90
- def self.i2097i_bookmark
91
- return
92
- Aro::P.less("\n#{UNICODE_KEYS[:bang] * Aro::Mancy::OS} <breakpoint> #{self.name}\n\n" +
93
- Thread.current.backtrace[1..].reverse.map{|l|
94
- l.gsub("#{Reiquire.gem_dir}", "").gsub(Aro::Mancy.root_dir, "")
95
- }.last(Aro::Mancy::V).join("\n")
96
- )
97
- puts __method__
89
+ def self.sane_backtrace!
90
+ return if Aro::Cor.is_production?
91
+
92
+ backtrace = Thread.current.backtrace[Aro::Mancy::S..].reverse.map{|l|
93
+ l.gsub("#{Reiquire.gem_dir}", "").gsub(Aro::Mancy.root_dir, "")
94
+ }.last(Aro::Mancy::V).join("\n")
95
+
96
+ if Aro::Cor.ivar(:VERBOSE).to_s == :true.to_s
97
+ Aro::P.less(backtrace)
98
+ else
99
+ puts(backtrace)
100
+ end
98
101
  end
99
102
 
100
103
  def self.init!
@@ -105,8 +108,8 @@ module Aro
105
108
  end
106
109
 
107
110
  def self.is_encrypted?
108
- !Aro::Cor.ivar(:oss_om_ssh_key).nil? &&
109
- !self.instance.valid_settings.nil?
111
+ Aro::Dom::Ssh.encryption_installed? &&
112
+ !self.instance.valid_security.nil?
110
113
  end
111
114
 
112
115
  def self.domain
@@ -124,7 +127,7 @@ module Aro
124
127
  cryption_text = "#{UNICODE_KEYS[:unsecure]}#{UNICODE_KEYS[:bang]}"
125
128
  end
126
129
 
127
- mode_text = RUN_MODES[self.instance.run_mode || Aro::Mancy::O]
130
+ mode_text = Aro::Dom::Ma_ain::RUN_MODES[self.instance.run_mode]
128
131
  [
129
132
  "(#{cryption_text})[#{mode_text}: ",
130
133
  display_text
@@ -135,21 +138,30 @@ module Aro
135
138
  super(domain)
136
139
  end
137
140
 
141
+ def self.navigate_to!(menu)
142
+
143
+ raise "invalid menu!" if menu.nil? || !menu.kind_of?(Aro::Dom::Menu)
144
+ raise "invalid directory for #{menu.inspect}!" if menu.directory.nil?
145
+ data_base = menu.directory.data_base
146
+ raise "invalid data_base!" if data_base.nil?
147
+
148
+ self.open_menu(menu)
149
+ end
150
+
138
151
  def self.open!(data_base = :ma_ain)
139
152
  Aro::P.say("Aro::Dom::DataBase.open_menu(#{data_base})")
140
153
  staged_menu = nil
141
154
  begin
142
155
  staged_menu = Aro::Dom::DataBase.open_menu(data_base)
143
156
  rescue StandardError => e
144
- raise "#{self.name} error opening data_base #{data_base}! #{e.inspect}"
157
+ raise "#{self.name} error opening data_base '#{data_base}'! #{e.inspect}"
158
+ end
159
+
160
+ if data_base.to_sym == :ma_ain && self.instance.valid_security.nil?
161
+ self.instance.valid_security = staged_menu.uuid
145
162
  end
146
- self.instance.previous_menu = self.instance.current_menu
147
- self.instance.current_menu = staged_menu
148
- end
149
163
 
150
- def self.back!
151
- self.instance.current_menu = nil
152
- open!
164
+ self.open_menu(staged_menu)
153
165
  end
154
166
 
155
167
  def self.toggle_run_mode
@@ -157,31 +169,44 @@ module Aro
157
169
  end
158
170
 
159
171
  def self.running?
160
- RUN_MODES[self.instance.run_mode || Aro::Mancy::O] == :run
172
+ Aro::Dom::Ma_ain::RUN_MODES[self.instance.run_mode] == :run
161
173
  end
162
174
 
163
175
  def self.get_current_options
164
176
  options = []
165
177
 
166
- options << {back: :back, value: :back} unless self.instance.previous_menu.nil?
178
+ options << {back: :back, value: :back} unless self.instance.current_menu.uuid == self.instance.valid_security
179
+
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"
167
182
 
168
- options << {name: "#{UNICODE_KEYS[:integral]}(#{Aro::Mancy::ARO_DIRECTORY})", value: :open_menu}
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?
187
+ options << {name: "#{UNICODE_KEYS[:integral]}(#{Aro::Mancy::ARO_DIRECTORY})", value: :open_menu}
188
+ end
169
189
 
170
- options += self.instance.current_menu.menu_items.select{|mi| mi.user?}.map{|mi| mi.as_tty}
171
- 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
+ }
172
196
 
173
197
  options
174
198
  end
175
199
 
176
- def self.exec_browse_data_bases!
177
- Aro::Dom::Ma_ain.open!(:browse_data_bases)
200
+ def self.exec_library!
201
+ Aro::Dom::Ma_ain.open!(:library)
178
202
  end
179
203
 
180
- def self.exec_settings!
181
- Aro::Dom::Ma_ain.open!(:settings)
204
+ def self.exec_configuration!
205
+ Aro::Dom::Ma_ain.open!(:configuration)
182
206
  end
183
207
 
184
208
  def self.exec_quit!
209
+ FDot::Based::Processor.user_exited!
185
210
  exit
186
211
  end
187
212
 
@@ -197,6 +222,60 @@ module Aro
197
222
  return Aro::Dom::Ma_ain.instance.stores[aro_file.uuid]
198
223
  end
199
224
 
225
+ def self.run_plugin!(chapter_menu_item, action_data)
226
+ plugin_file_path = action_data["plugin_file_path"]
227
+
228
+ raise "invalid plugin_file_path! #{plugin_file_path}" if plugin_file_path.nil? ||
229
+ !::File.exist?(plugin_file_path)
230
+
231
+ new_action_data = action_data.dup
232
+
233
+ data_callback = Proc.new{|d|
234
+ if d.kind_of?(Hash)
235
+ d["plugin_file_path"] = action_data["plugin_file_path"]
236
+ d["oss_om_type"] = action_data["oss_om_type"]
237
+ # self.instance.store_mutex.synchronize do
238
+ chapter_menu_item.aro_file.write!({
239
+ action_data: d
240
+ })
241
+ # end
242
+ end
243
+ }
244
+
245
+ require action_data["plugin_file_path"]
246
+ plugin_thread_action_data = action_data.dup
247
+ plugin_const = nil
248
+ begin
249
+ plugin_const = "Aro::Dom::#{
250
+ ::File.basename(
251
+ action_data[:plugin_file_path.to_s]
252
+ ).to_s.downcase.split(".")[
253
+ Aro::Mancy::O
254
+ ].split("_").map{|w| w.capitalize}.join("")
255
+ }".constantize
256
+
257
+ raise "must respond_to :oss_om_start!" unless plugin_const.respond_to?(:oss_om_start!)
258
+
259
+ if plugin_const.respond_to?(:configure_plugin_callback)
260
+ plugin_const.configure_plugin_callback(data_callback)
261
+ data_callback.call(plugin_const.oss_om_start!(plugin_thread_action_data))
262
+ new_action_data = nil
263
+ else
264
+ new_action_data = plugin_const.oss_om_start!(plugin_thread_action_data)
265
+ end
266
+ rescue StandardError => e
267
+ Aro::P.say("plugin thread threw an error: #{e}")
268
+ new_action_data = nil
269
+ end
270
+
271
+ data_callback.call(new_action_data) unless new_action_data.nil?
272
+ end
273
+
274
+ private
275
+
276
+ def self.open_menu(menu)
277
+ self.instance.current_menu = menu
278
+ end
200
279
  end
201
280
  end
202
281
  end
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,10 +11,7 @@
11
11
  =end
12
12
 
13
13
  module Aro
14
- VERSION = :"0.2.7"
14
+ VERSION = :"0.2.9"
15
15
  RELEASE_NOTES = [
16
- :galvinizes_foss_om_utility,
17
- :creates_foss_om_foundation,
18
- :removes_tecks
19
16
  ].join(" | ")
20
17
  end
data/tasks/make.rake CHANGED
@@ -1,5 +1,4 @@
1
- desc "rake install && rspec"
1
+ desc "rake install && rake build:checksum && bundle info aro"
2
2
  task :make do
3
- exec "rake install && bundle info aro"
4
- #exec "rake install && rspec --backtrace"
3
+ exec "rake install && rake build:checksum && bundle info aro"
5
4
  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.7
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - i2097i
@@ -189,7 +189,28 @@ dependencies:
189
189
  - - ">="
190
190
  - !ruby/object:Gem::Version
191
191
  version: 0.5.0
192
- description: aro is a unix utility for designing and creating linux applications.
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.2
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: 0.0.2
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.2
209
+ - - ">="
210
+ - !ruby/object:Gem::Version
211
+ version: 0.0.2
212
+ description: "aro is a unix utility for designing and creating linux applications.\n0.2.9
213
+ release notes: "
193
214
  email:
194
215
  - i2097i@hotmail.com
195
216
  executables:
@@ -220,6 +241,9 @@ files:
220
241
  - checksums/aro-0.2.5.gem.sha512
221
242
  - checksums/aro-0.2.6.gem.sha512
222
243
  - checksums/aro-0.2.7.gem.sha512
244
+ - checksums/aro-0.2.8.gem.sha512
245
+ - checksums/aro-0.2.9.gem.sha512
246
+ - craft_docker-compose.template
223
247
  - listen.rb
224
248
  - locale/en.cor.yml
225
249
  - locale/en.menu_items.yml
@@ -227,6 +251,7 @@ files:
227
251
  - locale/en.yml
228
252
  - sys/aro.rb
229
253
  - sys/aro/action.rb
254
+ - sys/aro/book.rb
230
255
  - sys/aro/d.rb
231
256
  - sys/aro/db.rb
232
257
  - sys/aro/db/migrate/.DS_Store
@@ -236,19 +261,27 @@ files:
236
261
  - sys/aro/db/migrate/1793913841_create_menus.rb
237
262
  - sys/aro/db/migrate/1793913861_create_menu_items.rb
238
263
  - sys/aro/designer.rb
264
+ - sys/aro/imports.rb
265
+ - sys/aro/library.rb
239
266
  - sys/aro/locale.rb
240
267
  - sys/aro/mancy.rb
241
268
  - sys/aro/models/concerns/.keep
242
269
  - sys/aro/models/concerns/tar_go_for_root_sec.rb
243
270
  - sys/aro/models/concerns/uuid.rb
271
+ - sys/aro/models/cubicus.rb
244
272
  - sys/aro/models/data_base.rb
245
273
  - sys/aro/models/directory.rb
246
274
  - sys/aro/models/file.rb
275
+ - sys/aro/models/glyph.rb
247
276
  - sys/aro/models/menu.rb
248
277
  - sys/aro/models/menu_item.rb
278
+ - sys/aro/models/objecticus.rb
279
+ - sys/aro/models/perspecticus.rb
280
+ - sys/aro/open_system/projector.rb
249
281
  - sys/aro/oss_open_menu.rb
282
+ - sys/aro/oss_open_system.rb
250
283
  - sys/aro/p.rb
251
- - sys/aro/r.rb
284
+ - sys/aro/plugins.rb
252
285
  - sys/aro/settings/cor.rb
253
286
  - sys/aro/settings/git.rb
254
287
  - sys/aro/settings/ssh.rb
@@ -261,7 +294,7 @@ files:
261
294
  - sys/shr/version.rb
262
295
  - tasks/console.rake
263
296
  - tasks/make.rake
264
- homepage: https://github.com/i2097i/aro
297
+ homepage: https://github.com/f-oss-om-foundation/aro
265
298
  licenses:
266
299
  - MIT
267
300
  metadata: {}
@@ -281,5 +314,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
281
314
  requirements: []
282
315
  rubygems_version: 3.6.9
283
316
  specification_version: 4
284
- summary: galvinizes_foss_om_utility | creates_foss_om_foundation | removes_tecks
317
+ summary: aro is a unix utility for designing and creating linux applications.
285
318
  test_files: []
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
-