Class: Ruboty::Hubot::Script
- Inherits:
-
Object
- Object
- Ruboty::Hubot::Script
- Defined in:
- lib/ruboty/hubot/script.rb
Instance Method Summary collapse
-
#initialize(source_path) ⇒ Script
constructor
A new instance of Script.
- #to_s ⇒ Object
Constructor Details
#initialize(source_path) ⇒ Script
Returns a new instance of Script.
7 8 9 10 11 12 13 |
# File 'lib/ruboty/hubot/script.rb', line 7 def initialize(source_path) if File.extname(source_path).downcase == '.coffee' @source = CoffeeScript.compile(File.read(source_path), bare: true) else @source = File.read(source_path) end end |
Instance Method Details
#to_s ⇒ Object
15 16 17 |
# File 'lib/ruboty/hubot/script.rb', line 15 def to_s @source.to_s end |