Sha256: 0c59ff011d8515fbb9811ea1afa65e419a54a58a27ba9d324049f7bb81a46466

Contents?: true

Size: 1.38 KB

Versions: 14

Compression:

Stored size: 1.38 KB

Contents

module Eco
  module API
    class Session
      class Config
        class SFTP < BaseConfig

          def configured?
            required = host && user && (key_file || password)
            !!required
          end

          def host=(value)
            self["host"] = value
          end

          def host
            self["host"]
          end

          def user=(value)
            self["user"] = value
          end

          def user
            self["user"]
          end

          def password=(var)
            self["password"] = var
          end

          def password
            self["password"]
          end

          def key_file=(key)
            self["key_file"] = key
          end

          def key_file
            self["key_file"]
          end

          def base_path=(path)
            self["base_path"] = path
          end

          def base_path
            self["base_path"]
          end

          def enviro_subpaths=(hash)
            self["enviro_subpaths"] = hash
          end

          def enviro_subpaths
            self["enviro_subpaths"]
          end

          def enviro_subpath
            enviro_subpaths[config.active_enviro]
          end

          def remote_folder
            [base_path, enviro_subpath].compact.join("/")
          end
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
eco-helpers-2.1.12 lib/eco/api/session/config/sftp.rb
eco-helpers-2.1.11 lib/eco/api/session/config/sftp.rb
eco-helpers-2.1.10 lib/eco/api/session/config/sftp.rb
eco-helpers-2.1.9 lib/eco/api/session/config/sftp.rb
eco-helpers-2.1.8 lib/eco/api/session/config/sftp.rb
eco-helpers-2.1.7 lib/eco/api/session/config/sftp.rb
eco-helpers-2.1.6 lib/eco/api/session/config/sftp.rb
eco-helpers-2.1.5 lib/eco/api/session/config/sftp.rb
eco-helpers-2.1.4 lib/eco/api/session/config/sftp.rb
eco-helpers-2.1.3 lib/eco/api/session/config/sftp.rb
eco-helpers-2.1.2 lib/eco/api/session/config/sftp.rb
eco-helpers-2.1.1 lib/eco/api/session/config/sftp.rb
eco-helpers-2.0.68 lib/eco/api/session/config/sftp.rb
eco-helpers-2.0.67 lib/eco/api/session/config/sftp.rb