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.2.11 lib/rundock/builder/default_ssh_builder.rb
rundock-0.2.10 lib/rundock/builder/default_ssh_builder.rb
rundock-0.2.9 lib/rundock/builder/default_ssh_builder.rb
rundock-0.2.8 lib/rundock/builder/default_ssh_builder.rb
rundock-0.2.7 lib/rundock/builder/default_ssh_builder.rb
rundock-0.2.6 lib/rundock/builder/default_ssh_builder.rb
rundock-0.2.5 lib/rundock/builder/default_ssh_builder.rb
rundock-0.2.4 lib/rundock/builder/default_ssh_builder.rb
rundock-0.2.3 lib/rundock/builder/default_ssh_builder.rb
rundock-0.2.2 lib/rundock/builder/default_ssh_builder.rb