Sha256: ba62bf90a6f1cc30690775313e8372e27c140668ab9f705e55ffd75f0f72344c

Contents?: true

Size: 776 Bytes

Versions: 30

Compression:

Stored size: 776 Bytes

Contents

require 'yaml'

module Rundock
  module Builder
    class DefaultSshBuilder < Base
      PRESET_SSH_OPTIONS_DEFAULT_FILE_PATH = "#{Gem::Specification.find_by_path('rundock').full_gem_path}/default_ssh.yml"

      def initialize(options)
        super(options)
      end

      def build
        opts = {}

        if @options[:default_ssh_opts] && FileTest.exist?(@options[:default_ssh_opts])
          def_ssh_file = @options[:default_ssh_opts]
        else
          def_ssh_file = PRESET_SSH_OPTIONS_DEFAULT_FILE_PATH
        end

        File.open(def_ssh_file) do |f|
          YAML.load_documents(f) do |y|
            y.each do |k, v|
              opts["#{k}_ssh_default".to_sym] = v
            end
          end
        end

        opts
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
rundock-0.5.4 lib/rundock/builder/default_ssh_builder.rb
rundock-0.5.3 lib/rundock/builder/default_ssh_builder.rb
rundock-0.5.2 lib/rundock/builder/default_ssh_builder.rb
rundock-0.5.0 lib/rundock/builder/default_ssh_builder.rb
rundock-0.4.16 lib/rundock/builder/default_ssh_builder.rb
rundock-0.4.15 lib/rundock/builder/default_ssh_builder.rb
rundock-0.4.14 lib/rundock/builder/default_ssh_builder.rb
rundock-0.4.13 lib/rundock/builder/default_ssh_builder.rb
rundock-0.4.12 lib/rundock/builder/default_ssh_builder.rb
rundock-0.4.11 lib/rundock/builder/default_ssh_builder.rb
rundock-0.4.10 lib/rundock/builder/default_ssh_builder.rb
rundock-0.4.8 lib/rundock/builder/default_ssh_builder.rb
rundock-0.4.7 lib/rundock/builder/default_ssh_builder.rb
rundock-0.4.6 lib/rundock/builder/default_ssh_builder.rb
rundock-0.4.4 lib/rundock/builder/default_ssh_builder.rb
rundock-0.4.3 lib/rundock/builder/default_ssh_builder.rb
rundock-0.4.2 lib/rundock/builder/default_ssh_builder.rb
rundock-0.4.1 lib/rundock/builder/default_ssh_builder.rb
rundock-0.4.0 lib/rundock/builder/default_ssh_builder.rb
rundock-0.3.0 lib/rundock/builder/default_ssh_builder.rb