INNER CODE UNIT · Ruby

compiled_template_sidekiq

seuros/capistrano-sidekiq · lib/capistrano/sidekiq.rb:8

    def compiled_template_sidekiq(from, role, config_file = 'sidekiq.yml')
      @role = role
      @config_file = config_file
      file = [
        "lib/capistrano/templates/#{from}-#{role.hostname}-#{fetch(:stage)}.rb",
        "lib/capistrano/templates/#{from}-#{role.hostname}.rb",
        "lib/capistrano/templates/#{from}-#{fetch(:stage)}.rb",
        "lib/capistrano/templates/#{from}.rb.erb",
        "lib/capistrano/templates/#{from}.rb",
        "lib/capistrano/templates/#{from}.erb",
        "config/deploy/templates/#{from}.rb.erb",
        "config/deploy/templates/#{from}.rb",
        "config/deploy/templates/#{from}.erb",
        File.expand_path("../templates/#{from}.erb", __FILE__),
        File.expand_path("../templates/#{from}.rb.erb", __FILE__)
      ].detect { |path| File.file?(path) }
      erb = File.read(file)
      StringIO.new(ERB.new(erb, trim_mode: '-').result(binding))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…