Class | FPM::Package::Gem |
In: |
lib/fpm/package/gem.rb
lib/fpm/package/gem.rb |
Parent: | FPM::Package |
A rubygems package.
This does not currently support ‘output‘
The following attributes are supported:
P_RE_LEADIN | = | '^[#=]{0,3}\s?' | Regular expression to accept a gem changelog line, and store date & version, if any, in named capture groups. Supports formats suggested by keepachangelog.com and github.com/tech-angels/vandamme as well as other similar formats that actually occur in the wild. Build it in pieces for readability, and allow version and date in either order. Whenever you change this, add a row to the test case in spec/fpm/package/gem_spec.rb. Don‘t even try to handle dates that lack four-digit years. Building blocks: | |
P_RE_VERSION_ | = | '[\w\.-]+\.[\w\.-]+[a-zA-Z0-9]' | ||
P_RE_SEPARATOR | = | '\s[-=/(]?\s?' | ||
P_RE_DATE1 | = | '\d{4}-\d{2}-\d{2}' | ||
P_RE_DATE2 | = | '\w+ \d{1,2}(?:st|nd|rd|th)?,\s\d{4}' | ||
P_RE_DATE3 | = | '\w+\s+\w+\s+\d{1,2},\s\d{4}' | ||
P_RE_DATE | = | "(?<date>#{P_RE_DATE1}|#{P_RE_DATE2}|#{P_RE_DATE3})" | ||
P_RE_URL | = | '\(https?:[-\w/.%]*\)' | ||
P_RE_GTMAGIC | = | '\[\]' | ||
P_RE_VERSION | = | "\\[?(?:Version |v)?(?<version>#{P_RE_VERSION_})\\]?(?:#{P_RE_URL}|#{P_RE_GTMAGIC})?" | ||
P_RE_VERSION_DATE | = | "#{P_RE_LEADIN}#{P_RE_VERSION}#{P_RE_SEPARATOR}#{P_RE_DATE}" | The final RE‘s: | |
P_RE_DATE_VERSION | = | "#{P_RE_LEADIN}#{P_RE_DATE}#{P_RE_SEPARATOR}#{P_RE_VERSION}" | ||
P_RE_LEADIN | = | '^[#=]{0,3}\s?' | Regular expression to accept a gem changelog line, and store date & version, if any, in named capture groups. Supports formats suggested by keepachangelog.com and github.com/tech-angels/vandamme as well as other similar formats that actually occur in the wild. Build it in pieces for readability, and allow version and date in either order. Whenever you change this, add a row to the test case in spec/fpm/package/gem_spec.rb. Don‘t even try to handle dates that lack four-digit years. Building blocks: | |
P_RE_VERSION_ | = | '[\w\.-]+\.[\w\.-]+[a-zA-Z0-9]' | ||
P_RE_SEPARATOR | = | '\s[-=/(]?\s?' | ||
P_RE_DATE1 | = | '\d{4}-\d{2}-\d{2}' | ||
P_RE_DATE2 | = | '\w+ \d{1,2}(?:st|nd|rd|th)?,\s\d{4}' | ||
P_RE_DATE3 | = | '\w+\s+\w+\s+\d{1,2},\s\d{4}' | ||
P_RE_DATE | = | "(?<date>#{P_RE_DATE1}|#{P_RE_DATE2}|#{P_RE_DATE3})" | ||
P_RE_URL | = | '\(https?:[-\w/.%]*\)' | ||
P_RE_GTMAGIC | = | '\[\]' | ||
P_RE_VERSION | = | "\\[?(?:Version |v)?(?<version>#{P_RE_VERSION_})\\]?(?:#{P_RE_URL}|#{P_RE_GTMAGIC})?" | ||
P_RE_VERSION_DATE | = | "#{P_RE_LEADIN}#{P_RE_VERSION}#{P_RE_SEPARATOR}#{P_RE_DATE}" | The final RE‘s: | |
P_RE_DATE_VERSION | = | "#{P_RE_LEADIN}#{P_RE_DATE}#{P_RE_SEPARATOR}#{P_RE_VERSION}" |
Sanitize package name. This prefixes the package name with ‘rubygem’ (but depends on the attribute :gem_package_name_prefix