Class: InchCI::Worker::Project::Build::SaveBuildData::BuildData

Inherits:
Object
  • Object
show all
Defined in:
lib/inch_ci/worker/project/build/save_build_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ BuildData

Returns a new instance of BuildData.


131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/inch_ci/worker/project/build/save_build_data.rb', line 131

def initialize(data)
  @data = data
  @status = @data['status']
  @trigger = @data['trigger']
  @repo_url = @data['repo_url']
  @branch_name = @data['branch_name']
  @revision_uid = @data['revision_uid']
  @revision_message = @data['revision_message']
  @revision_author_name = @data['revision_author_name']
  @revision_author_email = @data['revision_author_email']
  @revision_authored_at = @data['revision_authored_at']
  @tag_uid = @data['tag']
  @started_at = @data['started_at']
  @finished_at = @data['finished_at']
  @objects = @data['objects']
  @inch_version = data['inch_version']
end

Instance Attribute Details

#branch_nameObject (readonly)

Returns the value of attribute branch_name


123
124
125
# File 'lib/inch_ci/worker/project/build/save_build_data.rb', line 123

def branch_name
  @branch_name
end

#finished_atObject (readonly)

Returns the value of attribute finished_at


125
126
127
# File 'lib/inch_ci/worker/project/build/save_build_data.rb', line 125

def finished_at
  @finished_at
end

#inch_versionObject (readonly)

Returns the value of attribute inch_version


127
128
129
# File 'lib/inch_ci/worker/project/build/save_build_data.rb', line 127

def inch_version
  @inch_version
end

#objectsObject (readonly)

Returns the value of attribute objects


125
126
127
# File 'lib/inch_ci/worker/project/build/save_build_data.rb', line 125

def objects
  @objects
end

#repo_urlObject (readonly)

Returns the value of attribute repo_url


123
124
125
# File 'lib/inch_ci/worker/project/build/save_build_data.rb', line 123

def repo_url
  @repo_url
end

#revision_author_emailObject (readonly)

Returns the value of attribute revision_author_email


126
127
128
# File 'lib/inch_ci/worker/project/build/save_build_data.rb', line 126

def revision_author_email
  @revision_author_email
end

#revision_author_nameObject (readonly)

Returns the value of attribute revision_author_name


126
127
128
# File 'lib/inch_ci/worker/project/build/save_build_data.rb', line 126

def revision_author_name
  @revision_author_name
end

#revision_authored_atObject (readonly)

Returns the value of attribute revision_authored_at


126
127
128
# File 'lib/inch_ci/worker/project/build/save_build_data.rb', line 126

def revision_authored_at
  @revision_authored_at
end

#revision_messageObject (readonly)

Returns the value of attribute revision_message


124
125
126
# File 'lib/inch_ci/worker/project/build/save_build_data.rb', line 124

def revision_message
  @revision_message
end

#revision_uidObject (readonly)

Returns the value of attribute revision_uid


124
125
126
# File 'lib/inch_ci/worker/project/build/save_build_data.rb', line 124

def revision_uid
  @revision_uid
end

#started_atObject (readonly)

Returns the value of attribute started_at


125
126
127
# File 'lib/inch_ci/worker/project/build/save_build_data.rb', line 125

def started_at
  @started_at
end

#statusObject

Returns the value of attribute status


129
130
131
# File 'lib/inch_ci/worker/project/build/save_build_data.rb', line 129

def status
  @status
end

#stderrObject

Returns the value of attribute stderr


129
130
131
# File 'lib/inch_ci/worker/project/build/save_build_data.rb', line 129

def stderr
  @stderr
end

#tag_uidObject (readonly)

Returns the value of attribute tag_uid


124
125
126
# File 'lib/inch_ci/worker/project/build/save_build_data.rb', line 124

def tag_uid
  @tag_uid
end

#triggerObject (readonly)

Returns the value of attribute trigger


125
126
127
# File 'lib/inch_ci/worker/project/build/save_build_data.rb', line 125

def trigger
  @trigger
end

Instance Method Details

#badge_in_readme?Boolean

Returns:

  • (Boolean)

149
150
151
# File 'lib/inch_ci/worker/project/build/save_build_data.rb', line 149

def badge_in_readme?
  @data['badge_in_readme']
end

#latest_revision?Boolean

Returns true if the currently built revision should be treated as the latest revision in the branch.

Returns:

  • (Boolean)

155
156
157
# File 'lib/inch_ci/worker/project/build/save_build_data.rb', line 155

def latest_revision?
  @data['latest_revision']
end

#project_uidObject


159
160
161
# File 'lib/inch_ci/worker/project/build/save_build_data.rb', line 159

def project_uid
  "#{@data['service_name']}:#{@data['user_name']}/#{@data['repo_name']}"
end

#success?Boolean

Returns:

  • (Boolean)

163
164
165
# File 'lib/inch_ci/worker/project/build/save_build_data.rb', line 163

def success?
  status == 'success'
end