-
Notifications
You must be signed in to change notification settings - Fork 0
Model: Source
Manuel Schnitzer edited this page Jun 26, 2019
·
6 revisions
The Source model always represents one single source file in a package container.
Class Name: OpenBuildServiceAPI::Source
-
name(String): the name of that source file -
md5_hash(String): the md5 hash of that source file -
size(Filesize): the file size of that source file -
updated_at(Time): the last modified date of that source file
-
package(OpenBuildServiceAPI::Package): A relation to the package that owns this source file
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')}"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').contentDeletes 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!