Class: Eve::BaseRegistry
- Defined in:
- lib/registry/base_registry.rb
Constant Summary collapse
- @@cmd_data =
{ "export" => [], "import" => [], "sleep" => [], "ruby" => [], }
Class Method Summary collapse
- .available ⇒ Object
-
.call_export(app, result, filename, display_messages) ⇒ Object
———— CALLER METHODS ————.
- .call_import(app, result, filename, display_messages) ⇒ Object
- .call_ruby(app, result, call, display_messages) ⇒ Object
- .call_sleep(app, result, duration, display_messages) ⇒ Object
Methods inherited from Registry
Class Method Details
.available ⇒ Object
12 13 14 |
# File 'lib/registry/base_registry.rb', line 12 def self.available @@cmd_data end |
.call_export(app, result, filename, display_messages) ⇒ Object
CALLER METHODS
20 21 22 23 24 25 26 |
# File 'lib/registry/base_registry.rb', line 20 def self.call_export(app,result,filename,) filename = "./eve.cmd" if filename == "" || filename.nil? result[:data] = filename IO.write(filename,app.cmds.join("\n")) app..print_exported_commands(filename) if result end |
.call_import(app, result, filename, display_messages) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/registry/base_registry.rb', line 28 def self.call_import(app,result,filename,) filename = "./eve.cmd" if filename == "" || filename.nil? result[:data] = filename result[:track_cmd] = false app..print_importing_commands(filename) if count = 0 IO.readlines(filename).each do |raw| script = raw.strip next if script == "" || script[0] == "#" count += 1 app.cmd(script,,true) end app..print_importing_complete(filename,count) if result end |
.call_ruby(app, result, call, display_messages) ⇒ Object
52 53 54 55 56 |
# File 'lib/registry/base_registry.rb', line 52 def self.call_ruby(app,result,call,) result[:data] = eval(call) app..print_ruby_call(call,result[:data]) if result end |
.call_sleep(app, result, duration, display_messages) ⇒ Object
44 45 46 47 48 49 50 |
# File 'lib/registry/base_registry.rb', line 44 def self.call_sleep(app,result,duration,) in_secs = WatchMe::Timer.to_seconds(duration) result[:data] = in_secs app..print_sleep(in_secs) if Kernel.sleep(in_secs) result end |