Class: MailReceiver::CLI
- Inherits:
-
Thor
- Object
- Thor
- MailReceiver::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/mail-receiver/cli.rb
Instance Method Summary collapse
Instance Method Details
#restart ⇒ Object
45 46 47 48 |
# File 'lib/mail-receiver/cli.rb', line 45 def restart MailReceiver::Daemon.init() MailReceiver::Daemon.restart_process end |
#start ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/mail-receiver/cli.rb', line 14 def start MailReceiver::Daemon.init() do begin rails_env = ::File.('./config/environment', [:root]) require rails_env rescue => e puts "You need run this command under GitLab root." return end Mailman.config.logger = Logger.new($stdout) Mailman.config.rails_root = [:root] Mailman.config.logger.info "Starting gitlab-mail-receiver..." Mailman::Application.run do to '%user%+%suffix%@%host%' do @receiver = MailReceiver::Receiver.new(, logger: Mailman.config.logger) @receiver.process! end end end MailReceiver::Daemon.start_process end |
#stop ⇒ Object
39 40 41 42 |
# File 'lib/mail-receiver/cli.rb', line 39 def stop MailReceiver::Daemon.init() MailReceiver::Daemon.stop_process end |
#version ⇒ Object
51 52 53 |
# File 'lib/mail-receiver/cli.rb', line 51 def version puts "gitlab-mail-receiver #{MailReceiver.version}" end |