Class: Integrity::Notifier::Script
- Inherits:
-
Notifier::Base
- Object
- Notifier::Base
- Integrity::Notifier::Script
- Defined in:
- lib/integrity/notifier/script.rb
Instance Attribute Summary collapse
-
#extra_args ⇒ Object
readonly
Returns the value of attribute extra_args.
-
#script_path ⇒ Object
readonly
Returns the value of attribute script_path.
Class Method Summary collapse
Instance Method Summary collapse
- #deliver! ⇒ Object
-
#initialize(commit, config = {}) ⇒ Script
constructor
A new instance of Script.
Constructor Details
#initialize(commit, config = {}) ⇒ Script
Returns a new instance of Script.
12 13 14 15 16 |
# File 'lib/integrity/notifier/script.rb', line 12 def initialize(commit, config={}) @script_path = config.delete("script_path") || '/bin/echo' @extra_args = config.delete("extra_args") || '' super(commit, config) end |
Instance Attribute Details
#extra_args ⇒ Object (readonly)
Returns the value of attribute extra_args.
6 7 8 |
# File 'lib/integrity/notifier/script.rb', line 6 def extra_args @extra_args end |
#script_path ⇒ Object (readonly)
Returns the value of attribute script_path.
6 7 8 |
# File 'lib/integrity/notifier/script.rb', line 6 def script_path @script_path end |
Class Method Details
.to_haml ⇒ Object
8 9 10 |
# File 'lib/integrity/notifier/script.rb', line 8 def self.to_haml File.read(File.dirname(__FILE__) + "/config.haml") end |
Instance Method Details
#deliver! ⇒ Object
18 19 20 |
# File 'lib/integrity/notifier/script.rb', line 18 def deliver! `#{script_path} #{commit.successful? ? "pass" : "fail"} #{extra_args}` end |