Class: SiSU_Info_Remote_Host::InfoRemoteHost

Inherits:
Object
  • Object
show all
Defined in:
lib/sisu/se_remotes.rb

Direct Known Subclasses

SiSU_Env::InfoRemoteHost

Instance Method Summary collapse

Constructor Details

#initializeInfoRemoteHost

Returns a new instance of InfoRemoteHost.



61
62
63
# File 'lib/sisu/se_remotes.rb', line 61

def initialize
  @rc=SiSU_Env::GetInit.new.sisu_yaml.rc
end

Instance Method Details

#r1Object



107
108
109
110
111
# File 'lib/sisu/se_remotes.rb', line 107

def r1
  (defined? SiSU_Env::InfoRemoteHost.new.remote_host[0][:name]) \
  ? (SiSU_Env::InfoRemoteHost.new.remote_host[0][:name])
  : nil
end

#r2Object



112
113
114
115
116
# File 'lib/sisu/se_remotes.rb', line 112

def r2
  (defined? SiSU_Env::InfoRemoteHost.new.remote_host[1][:name]) \
  ? (SiSU_Env::InfoRemoteHost.new.remote_host[1][:name])
  : nil
end

#r3Object



117
118
119
120
121
# File 'lib/sisu/se_remotes.rb', line 117

def r3
  (defined? SiSU_Env::InfoRemoteHost.new.remote_host[2][:name]) \
  ? (SiSU_Env::InfoRemoteHost.new.remote_host[2][:name])
  : nil
end

#r4Object



122
123
124
125
126
# File 'lib/sisu/se_remotes.rb', line 122

def r4
  (defined? SiSU_Env::InfoRemoteHost.new.remote_host[3][:name]) \
  ? (SiSU_Env::InfoRemoteHost.new.remote_host[3][:name])
  : nil
end

#r5Object



127
128
129
130
131
# File 'lib/sisu/se_remotes.rb', line 127

def r5
  (defined? SiSU_Env::InfoRemoteHost.new.remote_host[4][:name]) \
  ? (SiSU_Env::InfoRemoteHost.new.remote_host[4][:name])
  : nil
end

#r6Object



132
133
134
135
136
# File 'lib/sisu/se_remotes.rb', line 132

def r6
  (defined? SiSU_Env::InfoRemoteHost.new.remote_host[5][:name]) \
  ? (@ls + SiSU_Env::InfoRemoteHost.new.remote_host[5][:name])
   : nil
end

#remote_hostObject

see InfoRemote remote_host_base_general



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/sisu/se_remotes.rb', line 64

def remote_host #see InfoRemote remote_host_base_general
  r=[]
  r=if (defined? @rc['remote'] \
  and @rc['remote'].is_a?(Array))
    r_array=@rc['remote']
    r_array.each_with_index do |renv,i|
      r[i]={}
      if defined? renv['user'] \
      and defined? renv['host']
      end
      r[i][:user]=renv['user']
      r[i][:host]=renv['host']
      r[i][:path]=if defined? renv['path']
        renv['path']
      else ''
      end
      r[i][:name]="#{r[i][:user]}@#{r[i][:host]}:#{r[i][:path]}"
    end
    r
  elsif (defined? @rc['remote'] \
  and @rc['remote'].is_a?(Hash) \
  and defined? @rc['remote']['user'] \
  and defined? @rc['remote']['host'])
    r[0]={}
    r[0][:user]=@rc['remote']['user']
    r[0][:host]=@rc['remote']['host']
    r[0][:path]=if defined? @rc['remote']['path']
      @rc['remote']['path']
    else ''
    end
    r[0][:name]="#{r[0][:user]}@#{r[0][:host]}:#{r[0][:path]}"
    r
  else
    r[0]={}
    r[0][:name]='.'
    r[0][:user]=''
    r[0][:host]=''
    r[0][:path]=''
    #puts "no remote host or user"
    r
  end
end

#rhostObject



106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/sisu/se_remotes.rb', line 106

def rhost
  def r1
    (defined? SiSU_Env::InfoRemoteHost.new.remote_host[0][:name]) \
    ? (SiSU_Env::InfoRemoteHost.new.remote_host[0][:name])
    : nil
  end
  def r2
    (defined? SiSU_Env::InfoRemoteHost.new.remote_host[1][:name]) \
    ? (SiSU_Env::InfoRemoteHost.new.remote_host[1][:name])
    : nil
  end
  def r3
    (defined? SiSU_Env::InfoRemoteHost.new.remote_host[2][:name]) \
    ? (SiSU_Env::InfoRemoteHost.new.remote_host[2][:name])
    : nil
  end
  def r4
    (defined? SiSU_Env::InfoRemoteHost.new.remote_host[3][:name]) \
    ? (SiSU_Env::InfoRemoteHost.new.remote_host[3][:name])
    : nil
  end
  def r5
    (defined? SiSU_Env::InfoRemoteHost.new.remote_host[4][:name]) \
    ? (SiSU_Env::InfoRemoteHost.new.remote_host[4][:name])
    : nil
  end
  def r6
    (defined? SiSU_Env::InfoRemoteHost.new.remote_host[5][:name]) \
    ? (@ls + SiSU_Env::InfoRemoteHost.new.remote_host[5][:name])
     : nil
  end
  self
end