Skip to content

Commit

Permalink
Praise be to rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
hmarr committed Dec 5, 2018
1 parent 1940d6c commit 7302b6d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
27 changes: 14 additions & 13 deletions dependabot-core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,6 @@ Gem::Specification.new do |spec|
spec.require_path = "lib"
spec.files = ["CHANGELOG.md", "LICENSE", "README.md"]

if File.exist?(".gitignore")
ignores = File.readlines(".gitignore").grep(/\S+/).map(&:chomp)
if File.directory?("lib") && File.directory?("helpers")
Find.find("lib", "helpers") do |path|
if ignores.any? { |i| File.fnmatch(i, "/" + path, File::FNM_DOTMATCH) }
Find.prune
else
spec.files << path unless File.directory?(path)
end
end
end
end

spec.required_ruby_version = ">= 2.5.0"
spec.required_rubygems_version = ">= 2.7.3"

Expand All @@ -54,4 +41,18 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rubocop", "~> 0.60.0"
spec.add_development_dependency "vcr", "~> 4.0.0"
spec.add_development_dependency "webmock", "~> 3.4.0"

next unless File.exist?(".gitignore")

ignores = File.readlines(".gitignore").grep(/\S+/).map(&:chomp)

next unless File.directory?("lib") && File.directory?("helpers")

Find.find("lib", "helpers") do |path|
if ignores.any? { |i| File.fnmatch(i, "/" + path, File::FNM_DOTMATCH) }
Find.prune
else
spec.files << path unless File.directory?(path)
end
end
end
27 changes: 14 additions & 13 deletions terraform/dependabot-terraform.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,6 @@ Gem::Specification.new do |spec|
spec.require_path = "lib"
spec.files = []

if File.exist?("../.gitignore")
ignores = File.readlines("../.gitignore").grep(/\S+/).map(&:chomp)
if File.directory?("lib")
Find.find("lib") do |path|
if ignores.any? { |i| File.fnmatch(i, "/" + path, File::FNM_DOTMATCH) }
Find.prune
else
spec.files << path unless File.directory?(path)
end
end
end
end

spec.required_ruby_version = ">= 2.5.0"
spec.required_rubygems_version = ">= 2.7.3"

Expand All @@ -44,4 +31,18 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rubocop", "~> 0.60.0"
spec.add_development_dependency "vcr", "~> 4.0.0"
spec.add_development_dependency "webmock", "~> 3.4.0"

next unless File.exist?("../.gitignore")

ignores = File.readlines("../.gitignore").grep(/\S+/).map(&:chomp)

next unless File.directory?("lib")

Find.find("lib") do |path|
if ignores.any? { |i| File.fnmatch(i, "/" + path, File::FNM_DOTMATCH) }
Find.prune
else
spec.files << path unless File.directory?(path)
end
end
end
4 changes: 1 addition & 3 deletions terraform/lib/dependabot/terraform/requirement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ module Dependabot
module Terraform
class Requirement < Gem::Requirement
def self.parse(obj)
if obj.is_a?(Gem::Version)
return ["=", Version.new(obj.to_s)]
end
return ["=", Version.new(obj.to_s)] if obj.is_a?(Gem::Version)

unless (matches = PATTERN.match(obj.to_s))
msg = "Illformed requirement [#{obj.inspect}]"
Expand Down

0 comments on commit 7302b6d

Please sign in to comment.