Class: Travis::CLI::Setup::Service
- Inherits:
-
Object
- Object
- Travis::CLI::Setup::Service
show all
- Defined in:
- lib/travis/cli/setup/service.rb
Direct Known Subclasses
Anynines, Appfog, Artifacts, Biicode, CloudControl, CloudFiles, CloudFoundry, Cloud_66, CodeDeploy, Deis, Divshot, ElasticBeanstalk, EngineYard, GCS, Hackage, Heroku, Modulus, NPM, Ninefold, Nodejitsu, OpenShift, OpsWorks, PyPI, Releases, RubyGems, S3, SauceConnect
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(command) ⇒ Service
Returns a new instance of Service.
29
30
31
|
# File 'lib/travis/cli/setup/service.rb', line 29
def initialize(command)
@command = command
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &block) ⇒ Object
33
34
35
|
# File 'lib/travis/cli/setup/service.rb', line 33
def method_missing(*args, &block)
@command.send(*args, &block)
end
|
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
27
28
29
|
# File 'lib/travis/cli/setup/service.rb', line 27
def command
@command
end
|
Class Method Details
.description(description = nil) ⇒ Object
11
12
13
14
15
|
# File 'lib/travis/cli/setup/service.rb', line 11
def self.description(description = nil)
@description ||= ""
@description = description if description
@description
end
|
.known_as?(name) ⇒ Boolean
23
24
25
|
# File 'lib/travis/cli/setup/service.rb', line 23
def self.known_as?(name)
normalized_name(service_name) == normalized_name(name)
end
|
.normalized_name(string) ⇒ Object
7
8
9
|
# File 'lib/travis/cli/setup/service.rb', line 7
def self.normalized_name(string)
string.to_s.downcase.gsub(/[^a-z\d]/, '')
end
|
.service_name(service_name = nil) ⇒ Object
17
18
19
20
21
|
# File 'lib/travis/cli/setup/service.rb', line 17
def self.service_name(service_name = nil)
@service_name ||= normalized_name(name[/[^:]+$/])
@service_name = service_name if service_name
@service_name
end
|