lib/omnibus/packagers/pkg.rb in omnibus-5.4.0 vs lib/omnibus/packagers/pkg.rb in omnibus-5.5.0
- old
+ new
@@ -17,15 +17,15 @@
module Omnibus
class Packager::PKG < Packager::Base
# @return [Hash]
SCRIPT_MAP = {
# Default Omnibus naming
- preinst: 'preinstall',
- postinst: 'postinstall',
+ preinst: "preinstall",
+ postinst: "postinstall",
# Default PKG naming
- preinstall: 'preinstall',
- postinstall: 'postinstall',
+ preinstall: "preinstall",
+ postinstall: "postinstall",
}.freeze
id :pkg
setup do
@@ -34,11 +34,11 @@
# Create the scripts directory
create_directory(scripts_dir)
# Render the license
- render_template(resource_path('license.html.erb'),
+ render_template(resource_path("license.html.erb"),
destination: "#{resources_dir}/license.html",
variables: {
name: project.name,
friendly_name: project.friendly_name,
maintainer: project.maintainer,
@@ -46,11 +46,11 @@
package_name: project.package_name,
}
)
# Render the welcome template
- render_template(resource_path('welcome.html.erb'),
+ render_template(resource_path("welcome.html.erb"),
destination: "#{resources_dir}/welcome.html",
variables: {
name: project.name,
friendly_name: project.friendly_name,
maintainer: project.maintainer,
@@ -58,11 +58,11 @@
package_name: project.package_name,
}
)
# "Render" the assets
- copy_file(resource_path('background.png'), "#{resources_dir}/background.png")
+ copy_file(resource_path("background.png"), "#{resources_dir}/background.png")
end
build do
write_scripts
@@ -185,11 +185,11 @@
# installer UI.
#
# @return [void]
#
def build_component_pkg
- command = <<-EOH.gsub(/^ {8}/, '')
+ command = <<-EOH.gsub(/^ {8}/, "")
pkgbuild \\
--identifier "#{safe_identifier}" \\
--version "#{safe_version}" \\
--scripts "#{scripts_dir}" \\
--root "#{project.install_dir}" \\
@@ -211,11 +211,11 @@
# installer.
#
# @return [void]
#
def write_distribution_file
- render_template(resource_path('distribution.xml.erb'),
+ render_template(resource_path("distribution.xml.erb"),
destination: "#{staging_dir}/Distribution",
mode: 0600,
variables: {
friendly_name: project.friendly_name,
identifier: safe_identifier,
@@ -230,19 +230,19 @@
# product that is shipped to end users.
#
# @return [void]
#
def build_product_pkg
- command = <<-EOH.gsub(/^ {8}/, '')
+ command = <<-EOH.gsub(/^ {8}/, "")
productbuild \\
--distribution "#{staging_dir}/Distribution" \\
--resources "#{resources_dir}" \\
EOH
- command << %Q( --sign "#{signing_identity}" \\\n) if signing_identity
- command << %Q( "#{final_pkg}")
- command << %Q(\n)
+ command << %Q{ --sign "#{signing_identity}" \\\n} if signing_identity
+ command << %Q{ "#{final_pkg}"}
+ command << %Q{\n}
Dir.chdir(staging_dir) do
shellout!(command)
end
end
@@ -263,11 +263,11 @@
#
def safe_base_package_name
if project.package_name =~ /\A[[:alnum:]-]+\z/
project.package_name.dup
else
- converted = project.package_name.downcase.gsub(/[^[:alnum:]+]/, '')
+ converted = project.package_name.downcase.gsub(/[^[:alnum:]+]/, "")
log.warn(log_key) do
"The `name' component of Mac package names can only include " \
"alphabetical characters (a-z, A-Z), numbers (0-9), and -. Converting " \
"`#{project.package_name}' to `#{converted}'."
@@ -285,11 +285,11 @@
# @return [String]
#
def safe_identifier
return identifier if identifier
- maintainer = project.maintainer.gsub(/[^[:alnum:]+]/, '').downcase
+ maintainer = project.maintainer.gsub(/[^[:alnum:]+]/, "").downcase
"test.#{maintainer}.pkg.#{safe_base_package_name}"
end
#
# This is actually just the regular build_iternation, but it felt lonely
@@ -309,10 +309,10 @@
#
def safe_version
if project.build_version =~ /\A[a-zA-Z0-9\.\+\-]+\z/
project.build_version.dup
else
- converted = project.build_version.gsub(/[^a-zA-Z0-9\.\+\-]+/, '-')
+ converted = project.build_version.gsub(/[^a-zA-Z0-9\.\+\-]+/, "-")
log.warn(log_key) do
"The `version' component of Mac package names can only include " \
"alphabetical characters (a-z, A-Z), numbers (0-9), dots (.), " \
"plus signs (+), and dashes (-). Converting " \