Class: Skylight::Util::Deploy::EmptyDeploy Private

Inherits:
Object
  • Object
show all
Defined in:
lib/skylight/util/deploy.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Direct Known Subclasses

DefaultDeploy, GitDeploy, HerokuDeploy

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ EmptyDeploy

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of EmptyDeploy.



18
19
20
21
# File 'lib/skylight/util/deploy.rb', line 18

def initialize(config)
  @config = config
  @timestamp = Time.now.to_i
end

Instance Attribute Details

#configObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



16
17
18
# File 'lib/skylight/util/deploy.rb', line 16

def config
  @config
end

#timestampObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



16
17
18
# File 'lib/skylight/util/deploy.rb', line 16

def timestamp
  @timestamp
end

Instance Method Details

#descriptionObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



31
32
33
# File 'lib/skylight/util/deploy.rb', line 31

def description
  nil
end

#git_shaObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



27
28
29
# File 'lib/skylight/util/deploy.rb', line 27

def git_sha
  nil
end

#idObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



23
24
25
# File 'lib/skylight/util/deploy.rb', line 23

def id
  git_sha
end

#to_query_hashObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



35
36
37
38
39
40
41
42
43
# File 'lib/skylight/util/deploy.rb', line 35

def to_query_hash
  hash = {
    timestamp: timestamp,
    deploy_id: id.to_s[0..100] # Keep this sane
  }
  hash[:git_sha] = git_sha.to_s[0..40] if git_sha # A valid SHA will never exceed 40
  hash[:description] = description[0..255] if description # Avoid massive descriptions
  hash
end