File: gen_init.rb

package info (click to toggle)
thin 1.6.3-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 448 kB
  • ctags: 390
  • sloc: ruby: 1,819; ansic: 1,740; sh: 82; makefile: 9
file content (25 lines) | stat: -rw-r--r-- 630 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/ruby -w

require 'erb'
require 'gem2deb/dh_ruby'
if RUBY_VERSION.match(/1.8/)
  require 'ftools'
  ftools_klass = File
else
  require 'fileutils'
  ftools_klass = FileUtils
end
class Command
  def self.script
    "/usr/bin/thin"
  end
end
INITD_PATH="/etc/init.d/thin"
rubies = {}
Gem2Deb::DhRuby::SUPPORTED_RUBY_VERSIONS.each{|x,y| x = x.sub(/^ruby/, ""); rubies[x] = y;}
rubies.keys.each do |x|
  ftools_klass.makedirs(File.join("debian", "thin", "etc", "thin" + x))
end
File.open(File.dirname(__FILE__) + '/thin.init', 'w') do |f|
  f << ERB.new(File.read("lib/thin/controllers/service.sh.erb")).result(binding)
end