aro 0.2.7 → 0.2.8

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/store.rb CHANGED
@@ -35,16 +35,14 @@ class Aro::Dom::Store
35
35
  ::File.write(aro_file.aro_file_path, {}.to_json)
36
36
  end
37
37
 
38
- Aro::Dom::Ma_ain.i2097i_bookmark
38
+ Aro::Dom::Ma_ain.sane_backtrace!
39
39
  puts :todo_validate_updates_or_depricate
40
40
  puts __method__
41
41
 
42
-
43
42
  store_instance = Aro::Dom::Ma_ain.instance.get_store_for(aro_file)
44
43
  updates.each{|k, v|
45
-
46
44
  store_instance.save_key_value_pair(k, v)
47
- Aro::P.say([
45
+ Aro::D.say([
48
46
  "reading in #{k} after setting to #{v} in #{aro_file.aro_file_path}",
49
47
  "got value => #{store_instance.safe_get_key(k)}"
50
48
  ])
@@ -55,33 +53,58 @@ class Aro::Dom::Store
55
53
  set_key(k, v)
56
54
  end
57
55
 
58
- def save_exec_oss_om_params!(oss_om_const, oss_om_method, label)
56
+ def save_exec_oss_om_params!(
57
+ label,
58
+ oss_om_const,
59
+ oss_om_method,
60
+ oss_om_params = [],
61
+ oss_om_data = {}
62
+ )
59
63
  Aro::P.say(__method__)
60
64
  Aro::Dom::Ma_ain.instance.store_mutex.synchronize do
61
- built = self.class.build_exec_oss_om_params!(oss_om_const, oss_om_method, label)
65
+ built = self.class.build_exec_oss_om_params!(
66
+ label,
67
+ oss_om_const,
68
+ oss_om_method,
69
+ oss_om_params,
70
+ oss_om_data
71
+ )
62
72
  built.each{|k, v| self.set_key(k, v)}
63
73
  end
64
74
  end
65
75
 
66
- def self.build_exec_oss_om_params!(oss_om_const, oss_om_method, label)
76
+ def self.build_exec_oss_om_params!(
77
+ label,
78
+ oss_om_const,
79
+ oss_om_method,
80
+ oss_om_params = [],
81
+ oss_om_data = {}
82
+ )
67
83
  Aro::P.say(__method__)
68
84
  # {
69
85
  # action_name:,
70
86
  # action_key: Aro::Dom::Action::TYPES[:OSS_OM][:key],
71
87
  # action_params: {
72
88
  # aro_class_name:,
73
- # aro_class_method:
89
+ # aro_class_method:,
90
+ # aro_call_params:,
74
91
  # }
92
+ # action_data:
75
93
  # }
76
- raise "invalid oss_om_const!" unless Aro::Dom::Oss_OpenMenu::EXEC_CLASSES.include?(oss_om_const.name)
94
+ raise "invalid oss_om_const! #{oss_om_const}" unless Aro::Dom::Oss_OpenMenu::EXEC_CLASSES.include?(oss_om_const.name)
77
95
  raise "invalid oss_om_method! #{oss_om_method}" unless oss_om_const.methods.include?(oss_om_method.to_sym)
96
+
97
+ # todo: validate oss_om_params && oss_om_data
98
+
78
99
  {
79
100
  action_name: label,
80
101
  action_key: :exec_oss_om,
81
102
  action_params: {
82
103
  aro_class_name: oss_om_const.name,
83
- aro_class_method: oss_om_method
84
- }
104
+ aro_class_method: oss_om_method,
105
+ aro_call_params: oss_om_params || []
106
+ },
107
+ action_data: oss_om_data.stringify_keys
85
108
  }
86
109
  end
87
110
 
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
@@ -31,7 +31,7 @@ module Aro
31
31
  #
32
32
 
33
33
  EXEC_METHODS = [
34
- :exec_browse_data_bases!,
34
+ :exec_library!,
35
35
  :exec_settings!,
36
36
  :exec_quit!
37
37
  ]
@@ -55,13 +55,13 @@ 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 = Aro::Dom::Ma_ain::S
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!")
@@ -70,13 +70,13 @@ module Aro
70
70
  Aro::P.say("installation failed. exiting now...")
71
71
  exit
72
72
  end
73
+
74
+ self.run_mode = !Aro::Cor.is_production? ? Aro::Dom::Ma_ain::O : Aro::Dom::Ma_ain::S
73
75
  Aro::P.say("Aro::Dom::Designer.design")
74
76
  Aro::Dom::Designer.design
75
77
  rescue RuntimeError => e
76
-
77
78
  Aro::P.say("#{e.class}! #{e.inspect}")
78
- self.class.i2097i_bookmark
79
- reign!
79
+ raise e
80
80
  end
81
81
  end
82
82
 
@@ -87,14 +87,18 @@ module Aro
87
87
  @stores = {}
88
88
  end
89
89
 
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__
90
+ def self.sane_backtrace!
91
+ return if Aro::Cor.is_production?
92
+
93
+ backtrace = Thread.current.backtrace[Aro::Mancy::S..].reverse.map{|l|
94
+ l.gsub("#{Reiquire.gem_dir}", "").gsub(Aro::Mancy.root_dir, "")
95
+ }.last(Aro::Mancy::V).join("\n")
96
+
97
+ if Aro::Cor.ivar(:VERBOSE).to_s == :true.to_s
98
+ Aro::P.less(backtrace)
99
+ else
100
+ puts(backtrace)
101
+ end
98
102
  end
99
103
 
100
104
  def self.init!
@@ -105,8 +109,8 @@ module Aro
105
109
  end
106
110
 
107
111
  def self.is_encrypted?
108
- !Aro::Cor.ivar(:oss_om_ssh_key).nil? &&
109
- !self.instance.valid_settings.nil?
112
+ Aro::Dom::Ssh.encryption_installed? &&
113
+ !self.instance.valid_security.nil?
110
114
  end
111
115
 
112
116
  def self.domain
@@ -124,7 +128,7 @@ module Aro
124
128
  cryption_text = "#{UNICODE_KEYS[:unsecure]}#{UNICODE_KEYS[:bang]}"
125
129
  end
126
130
 
127
- mode_text = RUN_MODES[self.instance.run_mode || Aro::Mancy::O]
131
+ mode_text = Aro::Dom::Ma_ain::RUN_MODES[self.instance.run_mode || Aro::Mancy::O]
128
132
  [
129
133
  "(#{cryption_text})[#{mode_text}: ",
130
134
  display_text
@@ -135,21 +139,30 @@ module Aro
135
139
  super(domain)
136
140
  end
137
141
 
142
+ def self.navigate_to!(menu)
143
+
144
+ raise "invalid menu!" if menu.nil? || !menu.kind_of?(Aro::Dom::Menu)
145
+ raise "invalid directory for #{menu.inspect}!" if menu.directory.nil?
146
+ data_base = menu.directory.data_base
147
+ raise "invalid data_base!" if data_base.nil?
148
+
149
+ open_menu(menu)
150
+ end
151
+
138
152
  def self.open!(data_base = :ma_ain)
139
153
  Aro::P.say("Aro::Dom::DataBase.open_menu(#{data_base})")
140
154
  staged_menu = nil
141
155
  begin
142
156
  staged_menu = Aro::Dom::DataBase.open_menu(data_base)
143
157
  rescue StandardError => e
144
- raise "#{self.name} error opening data_base #{data_base}! #{e.inspect}"
158
+ raise "#{self.name} error opening data_base '#{data_base}'! #{e.inspect}"
145
159
  end
146
- self.instance.previous_menu = self.instance.current_menu
147
- self.instance.current_menu = staged_menu
148
- end
149
160
 
150
- def self.back!
151
- self.instance.current_menu = nil
152
- open!
161
+ if data_base.to_sym == :ma_ain && self.instance.valid_security.nil?
162
+ self.instance.valid_security = staged_menu.uuid
163
+ end
164
+
165
+ open_menu(staged_menu)
153
166
  end
154
167
 
155
168
  def self.toggle_run_mode
@@ -157,15 +170,17 @@ module Aro
157
170
  end
158
171
 
159
172
  def self.running?
160
- RUN_MODES[self.instance.run_mode || Aro::Mancy::O] == :run
173
+ Aro::Dom::Ma_ain::RUN_MODES[self.instance.run_mode || Aro::Mancy::O] == :run
161
174
  end
162
175
 
163
176
  def self.get_current_options
164
177
  options = []
165
178
 
166
- options << {back: :back, value: :back} unless self.instance.previous_menu.nil?
179
+ options << {back: :back, value: :back} unless self.instance.current_menu.uuid == self.instance.valid_security
167
180
 
168
- options << {name: "#{UNICODE_KEYS[:integral]}(#{Aro::Mancy::ARO_DIRECTORY})", value: :open_menu}
181
+ unless Aro::Cor.ivar(:HIDE_F_OSS_OM_MENU).to_s == "true"
182
+ options << {name: "#{UNICODE_KEYS[:integral]}(#{Aro::Mancy::ARO_DIRECTORY})", value: :open_menu}
183
+ end
169
184
 
170
185
  options += self.instance.current_menu.menu_items.select{|mi| mi.user?}.map{|mi| mi.as_tty}
171
186
  options += self.instance.current_menu.menu_items.select{|mi| mi.system?}.map{|mi| mi.as_tty}
@@ -173,8 +188,8 @@ module Aro
173
188
  options
174
189
  end
175
190
 
176
- def self.exec_browse_data_bases!
177
- Aro::Dom::Ma_ain.open!(:browse_data_bases)
191
+ def self.exec_library!
192
+ Aro::Dom::Ma_ain.open!(:library)
178
193
  end
179
194
 
180
195
  def self.exec_settings!
@@ -197,6 +212,60 @@ module Aro
197
212
  return Aro::Dom::Ma_ain.instance.stores[aro_file.uuid]
198
213
  end
199
214
 
215
+ def self.run_plugin!(chapter_menu_item, action_data)
216
+ plugin_file_path = action_data["plugin_file_path"]
217
+
218
+ raise "invalid plugin_file_path! #{plugin_file_path}" if plugin_file_path.nil? ||
219
+ !::File.exist?(plugin_file_path)
220
+
221
+ new_action_data = action_data.dup
222
+
223
+ data_callback = Proc.new{|d|
224
+ if d.kind_of?(Hash)
225
+ d["plugin_file_path"] = action_data["plugin_file_path"]
226
+ 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
232
+ end
233
+ }
234
+
235
+ require action_data["plugin_file_path"]
236
+ plugin_thread_action_data = action_data.dup
237
+ plugin_const = nil
238
+ begin
239
+ plugin_const = "Aro::Dom::#{
240
+ ::File.basename(
241
+ action_data[:plugin_file_path.to_s]
242
+ ).to_s.downcase.split(".")[
243
+ Aro::Dom::Ma_ain::O
244
+ ].split("_").map{|w| w.capitalize}.join("")
245
+ }".constantize
246
+
247
+ raise "must respond_to :oss_om_start!" unless plugin_const.respond_to?(:oss_om_start!)
248
+
249
+ if plugin_const.respond_to?(:configure_plugin_callback)
250
+ plugin_const.configure_plugin_callback(data_callback)
251
+ data_callback.call(plugin_const.oss_om_start!(plugin_thread_action_data))
252
+ new_action_data = nil
253
+ else
254
+ new_action_data = plugin_const.oss_om_start!(plugin_thread_action_data)
255
+ end
256
+ rescue StandardError => e
257
+ Aro::P.say("plugin thread threw an error: #{e}")
258
+ new_action_data = nil
259
+ end
260
+
261
+ data_callback.call(new_action_data) unless new_action_data.nil?
262
+ end
263
+
264
+ private
265
+
266
+ def self.open_menu(menu)
267
+ self.instance.current_menu = menu
268
+ end
200
269
  end
201
270
  end
202
271
  end
data/sys/shr/version.rb CHANGED
@@ -11,10 +11,11 @@
11
11
  =end
12
12
 
13
13
  module Aro
14
- VERSION = :"0.2.7"
14
+ VERSION = :"0.2.8"
15
15
  RELEASE_NOTES = [
16
- :galvinizes_foss_om_utility,
17
- :creates_foss_om_foundation,
18
- :removes_tecks
16
+ :basic_settings,
17
+ :adds_library,
18
+ :adds_books,
19
+ :adds_oss_om_plugins
19
20
  ].join(" | ")
20
21
  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.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - i2097i
@@ -189,7 +189,9 @@ 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
+ 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
193
195
  email:
194
196
  - i2097i@hotmail.com
195
197
  executables:
@@ -220,6 +222,7 @@ files:
220
222
  - checksums/aro-0.2.5.gem.sha512
221
223
  - checksums/aro-0.2.6.gem.sha512
222
224
  - checksums/aro-0.2.7.gem.sha512
225
+ - checksums/aro-0.2.8.gem.sha512
223
226
  - listen.rb
224
227
  - locale/en.cor.yml
225
228
  - locale/en.menu_items.yml
@@ -227,6 +230,7 @@ files:
227
230
  - locale/en.yml
228
231
  - sys/aro.rb
229
232
  - sys/aro/action.rb
233
+ - sys/aro/book.rb
230
234
  - sys/aro/d.rb
231
235
  - sys/aro/db.rb
232
236
  - sys/aro/db/migrate/.DS_Store
@@ -236,6 +240,8 @@ files:
236
240
  - sys/aro/db/migrate/1793913841_create_menus.rb
237
241
  - sys/aro/db/migrate/1793913861_create_menu_items.rb
238
242
  - sys/aro/designer.rb
243
+ - sys/aro/imports.rb
244
+ - sys/aro/library.rb
239
245
  - sys/aro/locale.rb
240
246
  - sys/aro/mancy.rb
241
247
  - sys/aro/models/concerns/.keep
@@ -248,6 +254,7 @@ files:
248
254
  - sys/aro/models/menu_item.rb
249
255
  - sys/aro/oss_open_menu.rb
250
256
  - sys/aro/p.rb
257
+ - sys/aro/plugins.rb
251
258
  - sys/aro/r.rb
252
259
  - sys/aro/settings/cor.rb
253
260
  - sys/aro/settings/git.rb
@@ -261,7 +268,7 @@ files:
261
268
  - sys/shr/version.rb
262
269
  - tasks/console.rake
263
270
  - tasks/make.rake
264
- homepage: https://github.com/i2097i/aro
271
+ homepage: https://github.com/f-oss-om-foundation/aro
265
272
  licenses:
266
273
  - MIT
267
274
  metadata: {}
@@ -281,5 +288,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
281
288
  requirements: []
282
289
  rubygems_version: 3.6.9
283
290
  specification_version: 4
284
- summary: galvinizes_foss_om_utility | creates_foss_om_foundation | removes_tecks
291
+ summary: aro is a unix utility for designing and creating linux applications.
285
292
  test_files: []