class Packaging::Configuration

Attributes

documentation_minimal[RW]

Minimal documentation coverage to pass check:doc Default value is 0.

exclude_files[RW]

array of files excluded for packaging

include_files[RW]

array of files included for packaging (useful for e.g. for generated file not in git @note recommended way is to generate in spec and not before package @example generate css from sass (where sass:update is task to generate it)

Packaging::Configuration.instance.include_files './**/*.css'
Rake::Task(:'package-local').prerequisites << "sass:update"
maintenance_mode[RW]

Specify if project is in maintenance mode. If so, then it create maintenance request instead of pull request

obs_api[RW]

path to OBS api, useful if package is build in own instance of build service. By default api.opensuse.org

obs_project[RW]

project name in OBS

obs_sr_project[RW]

Project name in BS where submit request should go

obs_target[RW]

obs build target, by default opensuse factory

package_dir[W]

custom directory where is package created, by default ‘package’

package_name[W]

custom package name, by default directory name

skip_license_check[RW]

additional list of regex to skip license check

version[W]

manul version specification, by default look for file version (case insensitive)

Public Class Methods

new() click to toggle source
# File lib/packaging/configuration.rb, line 28
def initialize
  @exclude_files = []
  @include_files = []
  @obs_api = "https://api.opensuse.org/"
  @obs_target = "openSUSE_Factory"
  @skip_license_check = []
  @maintenance_mode = false
  @documentation_minimal = 0
end

Public Instance Methods

package_dir() click to toggle source
# File lib/packaging/configuration.rb, line 72
def package_dir
  @package_dir ||= "package"
end
package_name() click to toggle source
# File lib/packaging/configuration.rb, line 68
def package_name
  @package_name ||= Dir.pwd.split("/").last
end
summary() click to toggle source

configuration summary @return [Array<String>] human readable summary

# File lib/packaging/configuration.rb, line 86
def summary
  [
    "Package directory: #{package_dir}",
    "OBS instance:      #{obs_api}",
    "OBS project:       #{obs_project}",
    "OBS package name:  #{package_name}",
    "OBS build target:  #{build_dist}",
    "OBS submit target: #{obs_sr_project}"
  ]
end
version() click to toggle source
# File lib/packaging/configuration.rb, line 76
def version
  return @version if @version
  # try find version file
  versions = Dir.glob("version", File::FNM_CASEFOLD)
  return @version = File.read(versions.first).strip unless versions.empty?
  raise "cannot find version" #TODO more heuristic
end