lib/knife-spork/plugins/irccat.rb in knife-spork-1.3.1 vs lib/knife-spork/plugins/irccat.rb in knife-spork-1.3.2

- old
+ new

@@ -6,10 +6,14 @@ name :irccat TEMPLATES = { :upload => '#BOLD#PURPLECHEF:#NORMAL %{organization}%{current_user} uploaded #TEAL%{cookbooks}#NORMAL', :promote => '#BOLD#PURPLECHEF:#NORMAL %{organization}%{current_user} promoted #TEAL%{cookbooks}#NORMAL to %{environment} %{gist}', + :environmentfromfile => '#BOLD#PURPLECHEF:#NORMAL %{organization}%{current_user} uploaded environment #TEAL%{object_name}#NORMAL %{gist}', + :environmentedit => '#BOLD#PURPLECHEF:#NORMAL %{organization}%{current_user} edited environment #TEAL%{object_name}#NORMAL %{gist}', + :environmentcreate => '#BOLD#PURPLECHEF:#NORMAL %{organization}%{current_user} created environment #TEAL%{object_name}#NORMAL %{gist}', + :environmentdelete => '#BOLD#PURPLECHEF:#NORMAL %{organization}%{current_user} deleted environment #TEAL%{object_name}#NORMAL %{gist}', :rolefromfile => '#BOLD#PURPLECHEF:#NORMAL %{organization}%{current_user} uploaded role #TEAL%{object_name}#NORMAL %{gist}', :roleedit => '#BOLD#PURPLECHEF:#NORMAL %{organization}%{current_user} edited role #TEAL%{object_name}#NORMAL %{gist}', :rolecreate => '#BOLD#PURPLECHEF:#NORMAL %{organization}%{current_user} created role #TEAL%{object_name}#NORMAL %{gist}', :roledelete => '#BOLD#PURPLECHEF:#NORMAL %{organization}%{current_user} deleted role #TEAL%{object_name}#NORMAL %{gist}', :databagedit => '#BOLD#PURPLECHEF:#NORMAL %{organization}%{current_user} edited data bag item #TEAL%{object_name}:%{object_secondary_name}#NORMAL %{gist}', @@ -46,9 +50,49 @@ :cookbooks => cookbooks.collect{ |c| "#{c.name}@#{c.version}" }.join(", "), :environment => environment.name, :gist => env_gist }) end + end + + def after_environmentfromfile + environment_gist = object_gist("environment", object_name, object_difference) if config.gist and !object_difference.empty? + irccat(template(:environmentfromfile) % { + :organization => organization, + :current_user => current_user, + :object_name => object_name, + :gist => environment_gist + }) + end + + def after_environmentedit + environment_gist = object_gist("environment", object_name, object_difference) if config.gist and !object_difference.empty? + irccat(template(:environmentedit) % { + :organization => organization, + :current_user => current_user, + :object_name => object_name, + :gist => environment_gist + }) + end + + def after_environmentcreate + environment_gist = object_gist("environment", object_name, object_difference) if config.gist and !object_difference.empty? + irccat(template(:environmentcreate) % { + :organization => organization, + :current_user => current_user, + :object_name => object_name, + :gist => environment_gist + }) + end + + def after_environmentdelete + environment_gist = object_gist("environment", object_name, object_difference) if config.gist and !object_difference.empty? + irccat(template(:environmentdelete) % { + :organization => organization, + :current_user => current_user, + :object_name => object_name, + :gist => environment_gist + }) end def after_rolefromfile role_gist = object_gist("role", object_name, object_difference) if config.gist and !object_difference.empty? irccat(template(:rolefromfile) % {