Method: Atom::Plugger.run

Defined in:
lib/atom/plugger.rb

.run(plugins, file_path) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/atom/plugger.rb', line 9

def self.run(plugins, file_path)
  text = File.read(file_path)
  
  plugins.each do |plugin|
    classname = plugin.split('_').map(&:capitalize).join
    text = Kernel.const_get(classname).new(text).to_s
  end
  
  Atom::write_file(file_path, text)
end