class KnifeSpork::Plugins::StatusNet

Public Instance Methods

after_databagcreate() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 58
def after_databagcreate
  statusnet "#{organization}#{current_user} created data bag #{object_name}"
end
after_databagdelete() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 62
def after_databagdelete
  statusnet "#{organization}#{current_user} deleted data bag #{object_name}"
end
after_databagedit() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 54
def after_databagedit
  statusnet "#{organization}#{current_user} edited data bag item #{object_name}:#{object_secondary_name}"
end
after_databagfromfile() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 70
def after_databagfromfile
  statusnet "#{organization}#{current_user} uploaded data bag item #{object_name}:#{object_secondary_name}"
end
after_databagitemdelete() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 66
def after_databagitemdelete
  statusnet "#{organization}#{current_user} deleted data bag item #{object_name}:#{object_secondary_name}"
end
after_delete() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 14
def after_delete
  statusnet "#{organization}#{current_user} deleted the following cookbooks: #{misc_output}"
end
after_environmentcreate() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 30
def after_environmentcreate
  statusnet "#{organization}#{current_user} created environment #{object_name}"
end
after_environmentdelete() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 34
def after_environmentdelete
  statusnet "#{organization}#{current_user} deleted environment #{object_name}"
end
after_environmentedit() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 26
def after_environmentedit
  statusnet "#{organization}#{current_user} edited environment #{object_name}"
end
after_environmentfromfile() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 22
def after_environmentfromfile
  statusnet "#{organization}#{current_user} uploaded environment #{object_name}"
end
after_nodecreate() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 82
def after_nodecreate
  statusnet "#{organization}#{current_user} created node #{object_name}"
end
after_nodedelete() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 78
def after_nodedelete
  statusnet "#{organization}#{current_user} deleted node #{object_name}"
end
after_nodeedit() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 74
def after_nodeedit
  statusnet "#{organization}#{current_user} edited node #{object_name}"
end
after_nodefromfile() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 86
def after_nodefromfile
  statusnet "#{organization}#{current_user} uploaded node #{object_name}"
end
after_noderunlistadd() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 90
def after_noderunlistadd
  statusnet "#{organization}#{current_user} added run_list items to #{object_name}: #{object_secondary_name}"
end
after_noderunlistremove() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 94
def after_noderunlistremove
  statusnet "#{organization}#{current_user} removed run_list items from #{object_name}: #{object_secondary_name}"
end
after_noderunlistset() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 98
def after_noderunlistset
  statusnet "#{organization}#{current_user} set the run_list for #{object_name} to #{object_secondary_name}"
end
after_promote_remote() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 18
def after_promote_remote
  statusnet "#{organization}#{current_user} promoted the following cookbooks:\n#{cookbooks.collect{ |c| "  #{c.name}@#{c.version}" }.join("\n")} to #{environments.collect{ |e| "#{e.name}" }.join(", ")}"
end
after_rolecreate() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 46
def after_rolecreate
  statusnet "#{organization}#{current_user} created role #{object_name}"
end
after_roledelete() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 50
def after_roledelete
  statusnet "#{organization}#{current_user} deleted role #{object_name}"
end
after_roleedit() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 42
def after_roleedit
  statusnet "#{organization}#{current_user} edited role #{object_name}"
end
after_rolefromfile() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 38
def after_rolefromfile
  statusnet "#{organization}#{current_user} uploaded role #{object_name}"
end
after_upload() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 10
def after_upload
  statusnet "#{organization}#{current_user} uploaded the following cookbooks:\n#{cookbooks.collect{ |c| "  #{c.name}@#{c.version}" }.join("\n")}"
end
perform() click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 8
def perform; end

Private Instance Methods

statusnet(message) click to toggle source
# File lib/knife-spork/plugins/statusnet.rb, line 104
def statusnet(message)
  safe_require 'curb'

  begin
    c = Curl::Easy.new(config.url)
    c.http_auth_types = :basic
    c.username = config.username
    c.password = config.password
    c.post_body = message
    c.perform
  rescue Exception => e
    ui.error 'Something went wrong sending to StatusNet.'
    ui.error e.to_s
  end
end