Skip to content

Commit

Permalink
Merge pull request #2404 from gimmyxd/maint/fix_gem_build
Browse files Browse the repository at this point in the history
  • Loading branch information
gimmyxd committed Jun 30, 2021
2 parents 9f80962 + 48e7803 commit 1f127b1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
25 changes: 16 additions & 9 deletions agent/facter-ng.gemspec
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'pathname'

lib = File.expand_path('../lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

Expand All @@ -8,20 +10,25 @@ Gem::Specification.new do |spec|
spec.version = '4.2.2'
spec.authors = ['Puppet']
spec.email = ['team-nw@puppet.com']
spec.homepage = 'https://github.com/puppetlabs/facter'

spec.summary = 'Facter, a system inventory tool'
spec.description = 'You can prove anything with facts!'
spec.license = 'MIT'

# ruby 2.3 doesn't support `base` keyword arg
# we are building from `facter/agent` so we need to move
# one level up in the `facter` folder.
root_dir = Pathname.new(File.expand_path('..', __dir__))
dirs =
Dir[File.join(__dir__, 'bin/facter-ng')] +
Dir[File.join(__dir__, 'LICENSE')] +
Dir[File.join(__dir__, 'lib/**/*.rb')] +
Dir[File.join(__dir__, 'lib/**/*.json')] +
Dir[File.join(__dir__, 'lib/**/*.conf')] +
Dir[File.join(__dir__, 'agent/**/*')] +
Dir[File.join(__dir__, 'lib/**/*.erb')]
base = Pathname.new(__dir__)
Dir[File.join(root_dir, 'bin/facter-ng')] +
Dir[File.join(root_dir, 'LICENSE')] +
Dir[File.join(root_dir, 'lib/**/*.rb')] +
Dir[File.join(root_dir, 'lib/**/*.json')] +
Dir[File.join(root_dir, 'lib/**/*.conf')] +
Dir[File.join(root_dir, 'agent/**/*')] +
Dir[File.join(root_dir, 'lib/**/*.erb')]
base = Pathname.new(root_dir)
spec.files = dirs.map do |path|
Pathname.new(path).relative_path_from(base).to_path
end
Expand All @@ -34,7 +41,7 @@ Gem::Specification.new do |spec|

spec.add_development_dependency 'bundler', '~> 2.0'
spec.add_development_dependency 'coveralls', '~> 0.8.23'
spec.add_development_dependency 'rake', '>= 12.3.3'
spec.add_development_dependency 'rake', '~> 12.3', '>= 12.3.3'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'rubocop', '~> 0.74.0'
spec.add_development_dependency 'rubycritic', '~> 4.1.0'
Expand Down
4 changes: 3 additions & 1 deletion facter.gemspec
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'pathname'

lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

Expand Down Expand Up @@ -32,7 +34,7 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.require_paths = ['lib']

spec.add_development_dependency 'rake', '>= 12.3.3'
spec.add_development_dependency 'rake', '~> 12.3', '>= 12.3.3'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'rubocop', '~> 0.81.0'
spec.add_development_dependency 'rubocop-performance', '~> 1.5.2'
Expand Down

0 comments on commit 1f127b1

Please sign in to comment.