Compare commits
3 Commits
main
...
issue/1949
| Author | SHA1 | Date |
|---|---|---|
|
|
ac0ecdd101 | |
|
|
afc7c6f434 | |
|
|
0a07c00639 |
|
|
@ -22,10 +22,6 @@ Gem::Specification.new do |spec|
|
||||||
|
|
||||||
spec.required_ruby_version = '>= 1.9.3'
|
spec.required_ruby_version = '>= 1.9.3'
|
||||||
|
|
||||||
# For parsing JSON (required for some Python support, etc)
|
|
||||||
# http://flori.github.com/json/doc/index.html
|
|
||||||
spec.add_dependency("json", ">= 1.7.7", "< 3.0") # license: Ruby License
|
|
||||||
|
|
||||||
# For logging
|
# For logging
|
||||||
# https://github.com/jordansissel/ruby-cabin
|
# https://github.com/jordansissel/ruby-cabin
|
||||||
spec.add_dependency("cabin", ">= 0.6.0") # license: Apache 2
|
spec.add_dependency("cabin", ">= 0.6.0") # license: Apache 2
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ require "fileutils"
|
||||||
require "fpm/package/dir"
|
require "fpm/package/dir"
|
||||||
require 'tempfile' # stdlib
|
require 'tempfile' # stdlib
|
||||||
require 'pathname' # stdlib
|
require 'pathname' # stdlib
|
||||||
require 'rexml/document' # stdlib
|
|
||||||
|
|
||||||
# Use an OS X pkg built with pkgbuild.
|
# Use an OS X pkg built with pkgbuild.
|
||||||
#
|
#
|
||||||
|
|
@ -103,6 +102,7 @@ class FPM::Package::OSXpkg < FPM::Package
|
||||||
|
|
||||||
# Extract name and version from PackageInfo XML
|
# Extract name and version from PackageInfo XML
|
||||||
def extract_info(package)
|
def extract_info(package)
|
||||||
|
require 'rexml/document'
|
||||||
build_path("expand").tap do |path|
|
build_path("expand").tap do |path|
|
||||||
doc = REXML::Document.new File.open(File.join(path, "PackageInfo"))
|
doc = REXML::Document.new File.open(File.join(path, "PackageInfo"))
|
||||||
pkginfo_elem = doc.elements["pkg-info"]
|
pkginfo_elem = doc.elements["pkg-info"]
|
||||||
|
|
|
||||||
|
|
@ -421,7 +421,11 @@ module FPM::Util
|
||||||
# to invoke ERB.new correctly and without printed warnings.
|
# to invoke ERB.new correctly and without printed warnings.
|
||||||
# References: https://github.com/jordansissel/fpm/issues/1894
|
# References: https://github.com/jordansissel/fpm/issues/1894
|
||||||
# Honestly, I'm not sure if Gem::Version is correct to use in this situation, but it works.
|
# Honestly, I'm not sure if Gem::Version is correct to use in this situation, but it works.
|
||||||
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.1.0")
|
|
||||||
|
# on older versions of Ruby, RUBY_VERSION is a frozen string, and
|
||||||
|
# Gem::Version.new calls String#strip! which throws an exception.
|
||||||
|
# so we have to call String#dup to get an unfrozen copy.
|
||||||
|
if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new("3.1.0")
|
||||||
# Ruby 3.0.x and older
|
# Ruby 3.0.x and older
|
||||||
return ERB.new(template_code, nil, "-")
|
return ERB.new(template_code, nil, "-")
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue