Project

General

Profile

« Previous | Next » 

Revision ed09e1e5

Added by Marc Dequènes over 14 years ago

  • ID ed09e1e54f715adf2b319596f79ede9fcbf91c8f

[cleanup] better class/modules names for a few items

View differences:

bin/postman
module CyborgHood
module PostmanHome
include CHTranslation
include I18nTranslation
bindtextdomain("cyborghood_postman", {:path => Config::L10N_DIR, :charset => "UTF-8"})
# not yet ready to be a real Cyborg
class Postman #< Cyborg
include CHTranslation
include I18nTranslation
def initialize
# load config
......
result_msg += " (#{report.error.untranslated})" unless report.ok?
logger.info result_msg
i18n = I18n.instance
i18n = I18nController.instance
i18n.set_language_for_user(report.user)
unless report.ok?
......
end
class CommandRunner
include CHTranslation
include I18nTranslation
def self.run(order)
result_list = []
lib/cyborghood/base.rb
require 'cyborghood/language'
module CyborgHood
include CHTranslation
include I18nTranslation
bindtextdomain("cyborghood", {:path => Config::L10N_DIR, :charset => "UTF-8"})
# severities: :grave :unrecoverable :processable :ignorable
lib/cyborghood/imap.rb
@params = params
end
class Message
class IMAPMessage
def initialize(imap, message_id)
@imap = imap
@message_id = message_id
......
imap.search(["ALL"], "UTF-8").each do |message_id|
logger.debug "*** Fetched mail ##{message_id}"
yield Message.new(imap, message_id)
yield IMAPMessage.new(imap, message_id)
end
imap.expunge
lib/cyborghood/language.rb
module CyborgHood
class I18n
class I18nController
include Singleton
include GetText
......
end
end
class CHMessage
class I18nMessage
attr_reader :translated, :untranslated, :parts
def initialize(translated, untranslated, parts)
......
end
end
module CHTranslation
module I18nTranslation
def self.included(base)
base.class_eval("include GetText")
......
end
def create_tm(method, message, parts)
CHMessage.new(self.send(method, message), message, parts)
I18nMessage.new(self.send(method, message), message, parts)
end
module_function :_, :n_, :s_, :ns_, :np_
lib/cyborghood/mail.rb
class Mail < Delegator
include ActionMailer::Quoting
include ActionMailer::Utils
include CHTranslation
include I18nTranslation
MAX_DRIFT_TIME = 3600
lib/cyborghood/order.rb
end
class Order
include CHTranslation
include I18nTranslation
attr_reader :error, :user, :commands, :shared_parameters
def initialize(params = {})

Also available in: Unified diff