Class: JSBeauty::Command
- Inherits:
-
Object
- Object
- JSBeauty::Command
- Defined in:
- lib/jsbeauty/command.rb
Constant Summary collapse
- PATH =
File.("../../../ext/js-beautifier/js-beautifier", __FILE__)
Instance Method Summary collapse
-
#initialize(files, options = {}) ⇒ Command
constructor
A new instance of Command.
- #run ⇒ Object
Constructor Details
#initialize(files, options = {}) ⇒ Command
Returns a new instance of Command.
5 6 7 8 9 10 11 12 |
# File 'lib/jsbeauty/command.rb', line 5 def initialize(files, = {}) @files = files @options = if @files.empty? raise ArgumentError, "missing file" end end |
Instance Method Details
#run ⇒ Object
14 15 16 |
# File 'lib/jsbeauty/command.rb', line 14 def run system("#{PATH} #{} #{files_for_cmd}") end |