This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env ruby | |
| require 'logger' | |
| require 'rest_client' | |
| $stdout.sync = true | |
| $stdin.sync = true | |
| path = "/usr/local/var/log/ejabberd/auth.log" | |
| file = File.open(path, File::WRONLY | File::APPEND | File::CREAT) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # .create() | |
| before_validation | |
| validate | |
| after_validation | |
| before_save | |
| before_create | |
| after_create | |
| after_save | |
| # .save | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #Stories are embedded docs in a Feed | |
| class Feed | |
| include MongoMapper::Document | |
| many :stories | |
| end | |
| class Story | |
| include MongoMapper::EmbeddedDocument | |
| key :title, String | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # put this in /lib/resque.rb | |
| require 'mail' | |
| module Emailer | |
| class Send | |
| @queue = :issue_mailer | |
| def self.perform(addressee, subject, body) |