• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

payrollhero / dispatch-rider / #3007

17 Aug 2022 10:39PM UTC coverage: 85.141% (+36.1%) from 49.061%
#3007

push

web-flow
Merge pull request #80 from payrollhero/support-aws-sdk-1-2-3

Support aws-sdk v1 and v3 - Fix for Security Update Rails (CVE-2022-32224)

997 of 1171 relevant lines covered (85.14%)

5.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lib/dispatch-rider/command.rb
1
require 'daemons'
×
2
require 'pathname'
×
3
require 'optparse'
×
4

5
module DispatchRider
×
6
  class Command
×
7

8
    def initialize(options = {})
×
9
      @app_home = Pathname.new(Dir.getwd)
×
10
      @options = {
×
11
        :log_output => true,
×
12
        :dir_mode => :normal,
×
13
        :log_dir => (@app_home + "log").to_s,
×
14
        :dir => (@app_home + "log").to_s,
×
15
        :multiple => false,
×
16
        :monitor => false,
×
17
        :identifier => 0,
×
18
      }.merge(options)
×
19
    end
×
20

21
    def run(args, &block)
×
22
      process_args(args)
×
23

24
      process_name = "dispatch_rider.#{@options[:identifier]}"
×
25
      Daemons.run_proc(process_name, @options) do
×
26
        $0 = File.join(@options[:prefix], process_name) if @options[:prefix]
×
27
        Dir.chdir(@app_home.to_s) do
×
28
          block.call
×
29
        end
×
30
      end
×
31
    end
×
32

33
  private
×
34

35
    def process_args(args)
×
36
      opts = OptionParser.new do |opts|
×
37
        opts.banner = "Usage: #{File.basename($0)} [options] start|stop|restart|run"
×
38
        opts.on('-h', '--help', 'Show this message') do
×
39
          puts opts
×
40
          exit 1
×
41
        end
×
42
        opts.on('-i', '--identifier=n', 'A numeric identifier for the worker.') do |n|
×
43
          @options[:identifier] = n
×
44
        end
×
45
        opts.on('-m', '--monitor', 'Start monitor process.') do
×
46
          @options[:monitor] = true
×
47
        end
×
48
        opts.on('-p', '--prefix NAME', "String to be prefixed to worker process names") do |prefix|
×
49
          @options[:prefix] = prefix
×
50
        end
×
51
      end
×
52
      @opts = opts.parse!(args)
×
53
    end
×
54

55
  end
×
56
end
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc