Class: TriggerEvent
- Inherits:
-
Object
- Object
- TriggerEvent
- Defined in:
- lib/trigger_event.rb
Instance Attribute Summary collapse
-
#commit ⇒ Object
Returns the value of attribute commit.
-
#fwk ⇒ Object
Returns the value of attribute fwk.
Instance Method Summary collapse
-
#initialize(argv) ⇒ TriggerEvent
constructor
A new instance of TriggerEvent.
- #validate_object ⇒ Object
Constructor Details
#initialize(argv) ⇒ TriggerEvent
8 9 10 11 12 13 14 15 16 |
# File 'lib/trigger_event.rb', line 8 def initialize(argv) data = argv.first json = JSON.parse(data) # p json msg = json['commits'].first['message'] /【([a-zA-Z0-9]*)】/.match(msg) @fwk = $1 @commit = json['after'] end |
Instance Attribute Details
#commit ⇒ Object
Returns the value of attribute commit.
6 7 8 |
# File 'lib/trigger_event.rb', line 6 def commit @commit end |
#fwk ⇒ Object
Returns the value of attribute fwk.
5 6 7 |
# File 'lib/trigger_event.rb', line 5 def fwk @fwk end |
Instance Method Details
#validate_object ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/trigger_event.rb', line 18 def validate_object p @fwk p @commit if @fwk.nil? || @commit.nil? p "no framework or commit founds" return nil end return @fwk,@commit end |