Class: Editus::Script::Reader

Inherits:
Object
  • Object
show all
Defined in:
lib/editus/script.rb

Class Method Summary collapse

Class Method Details

.read(path) ⇒ Object



101
102
103
104
105
106
107
108
109
110
# File 'lib/editus/script.rb', line 101

def self.read path
  return unless File.exist?(path)

  load(path)
  filename = File.basename(path, ".rb")
  internal = Internal.find_or_create filename
  internal.content = File.read(path)
  internal.path = path
  true
end