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.



59
60
61
# File 'lib/sisu/se_remotes.rb', line 59

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

Instance Method Details

#r1Object



105
106
107
108
109
# File 'lib/sisu/se_remotes.rb', line 105

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

#r2Object



110
111
112
113
114
# File 'lib/sisu/se_remotes.rb', line 110

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

#r3Object



115
116
117
118
119
# File 'lib/sisu/se_remotes.rb', line 115

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

#r4Object



120
121
122
123
124
# File 'lib/sisu/se_remotes.rb', line 120

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

#r5Object



125
126
127
128
129
# File 'lib/sisu/se_remotes.rb', line 125

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

#r6Object



130
131
132
133
134
# File 'lib/sisu/se_remotes.rb', line 130

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



62
63
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
# File 'lib/sisu/se_remotes.rb', line 62

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



104
105
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
# File 'lib/sisu/se_remotes.rb', line 104

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