Class: ICli::AbstractHost

Inherits:
Object
  • Object
show all
Defined in:
lib/proutils/icli/abstract_host.rb

Overview

Base class for all hosts.

Direct Known Subclasses

Gforge

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ AbstractHost

New RubyForge tasks.



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/proutils/icli/abstract_host.rb', line 41

def initialize(options)
  options = options.dup.rekey

  @dryrun  = options[:dryrun]
  @trace   = options[:trace]

  #@domain   = options[:domain] || default_domain
  @uri   = URI.parse("http://" + domain)

  @username = options[:username]
  @password = options[:password]

  mkdir_p(File.dirname(COOKIEJAR))
  @cookie_jar = COOKIEJAR

  options
end

Instance Attribute Details

#passwordObject (readonly)

Returns the value of attribute password.



33
34
35
# File 'lib/proutils/icli/abstract_host.rb', line 33

def password
  @password
end

#uriObject (readonly)

URI = http:// + domain name TODO Deal with https, and possible other protocols too.



28
29
30
# File 'lib/proutils/icli/abstract_host.rb', line 28

def uri
  @uri
end

#usernameObject (readonly)

Many sites will require logging in so these are available by for use even if they arn’t used.



32
33
34
# File 'lib/proutils/icli/abstract_host.rb', line 32

def username
  @username
end

Instance Method Details

#domainObject

Domain name of host. Must be overriden by adapter.



36
37
38
# File 'lib/proutils/icli/abstract_host.rb', line 36

def domain
  raise "Missing Domain"
end