Run a command through the thin command-line script.
Send the command to the thin script
# File lib/thin/command.rb, line 24
24: def run
25: shell_cmd = shellify
26: trace shell_cmd
27: trap('INT') {} # Ignore INT signal to pass CTRL+C to subprocess
28: Open3.popen3(shell_cmd) do |stdin, stdout, stderr|
29: log stdout.gets until stdout.eof?
30: log stderr.gets until stderr.eof?
31: end
32: end
Turn into a runnable shell command
# File lib/thin/command.rb, line 35
35: def shellify
36: shellified_options = @options.inject([]) do |args, (name, value)|
37: option_name = name.to_s.tr("_", "-")
38: case value
39: when NilClass,
40: TrueClass then args << "--#{option_name}"
41: when FalseClass
42: when Array then value.each { |v| args << "--#{option_name}=#{v.inspect}" }
43: else args << "--#{option_name}=#{value.inspect}"
44: end
45: args
46: end
47:
48: raise ArgumentError, "Path to thin script can't be found, set Command.script" unless self.class.script
49:
50: "#{self.class.script} #{@name} #{shellified_options.compact.join(' ')}"
51: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.