Class: Rampage

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(script_to_run) ⇒ Rampage

Returns a new instance of Rampage.



7
8
9
# File 'lib/rampage.rb', line 7

def initialize(script_to_run)
  @path = script_to_run
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



5
6
7
# File 'lib/rampage.rb', line 5

def path
  @path
end

Instance Method Details

#runObject



11
12
13
14
15
16
17
# File 'lib/rampage.rb', line 11

def run
  file = Tempfile.new ['rampage', '.html']
  file.write `ruby #{path}`
  file.close

  Launchy.open file.path
end