Model: Source - mschnitzer/open-build-service-api GitHub Wiki
The Source
model always represents one single source file in a package container.
Class Name: OpenBuildServiceAPI::Source
Instance Attributes:
name
(String): the name of that source filemd5_hash
(String): the md5 hash of that source filesize
(Filesize): the file size of that source fileupdated_at
(Time): the last modified date of that source file
Relations
package
(OpenBuildServiceAPI::Package): A relation to the package that owns this source file
#to_s
Instance Method: Converts an instance of OpenBuildServiceAPI::Source
into a string. The return value is always the name of the source file.
Return Value: String
Example:
project = obs_api.project.find!('home:mschnitzer')
package = project.packages.find!('rubygem-passenger')
puts "Source file name: #{package.sources.find('rubygem-passenger.spec')}"
#content
Instance Method: Fetches the content of the source and returns it.
Return Value: String
Example:
project = obs_api.project.find!('home:mschnitzer')
package = project.packages.find!('rubygem-passenger')
puts package.sources.find('rubygem-passenger.spec').content
#delete!
Instance Method: Deletes the current source file from the remote API server.
Return Value: Boolean
(true)
Example:
project = obs_api.project.find!('home:mschnitzer')
package = project.packages.find!('rubygem-passenger')
package.sources.find('rubygem-passenger.spec').delete!