Skip to content

Commit

Permalink
Merge pull request #226 from activeadmin/fix_gem_build_warnings
Browse files Browse the repository at this point in the history
Fix `gem build` warning about unbounded dep
  • Loading branch information
javierjulio authored Sep 4, 2020
2 parents 306c0db + 98342a7 commit 2f358a9
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: ruby
sudo: false
before_install:
- gem update --system 3.1.3
- gem update --system 3.2.0.rc.1
- gem install bundler:2.1.4
rvm:
- 2.5.8
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PATH
specs:
arbre (1.3.0)
activesupport (>= 3.0.0, < 6.1)
ruby2_keywords (>= 0.0.2)
ruby2_keywords (>= 0.0.2, < 1.0)

GEM
remote: http://rubygems.org/
Expand Down
2 changes: 1 addition & 1 deletion arbre.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ Gem::Specification.new do |s|
s.required_ruby_version = '>= 2.5'

s.add_dependency("activesupport", ">= 3.0.0", "< 6.1")
s.add_dependency("ruby2_keywords", ">= 0.0.2")
s.add_dependency("ruby2_keywords", ">= 0.0.2", "< 1.0")
end
16 changes: 15 additions & 1 deletion spec/gemspec_spec.lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,21 @@
end

it "has no warnings" do
expect(build[1]).not_to include("WARNING")
output = build[1]

if RUBY_ENGINE == "jruby"
annoying_jruby_warnings = [
/WARNING: An illegal reflective access operation has occurred/,
/WARNING: Illegal reflective access by org.jruby.ext.openssl.SecurityHelper \(file:.*\/jopenssl\.jar\) to field java\.security\.MessageDigest\.provider/,
/WARNING: Please consider reporting this to the maintainers of org\.jruby\.ext\.openssl\.SecurityHelper/,
/WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations/,
/WARNING: All illegal access operations will be denied in a future release/
]

output = output.split("\n").reject { |line| annoying_jruby_warnings.any? { |warning| warning.match?(line) } }.join("\n")
end

expect(output).not_to include("WARNING"), output
end

it "succeeds" do
Expand Down
14 changes: 13 additions & 1 deletion tasks/lint.rake
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ require 'rubocop/rake_task'
RuboCop::RakeTask.new

desc "Lints ActiveAdmin code base"
task lint: ["rubocop", "lint:missing_trailing_carriage_return"]
task lint: ["rubocop", "lint:missing_trailing_carriage_return", "lint:rspec"]

namespace :lint do
desc "Check for missing trailing new lines"
Expand All @@ -66,4 +66,16 @@ namespace :lint do

MissingTrailingCarriageReturn.new.run
end

desc "RSpec specs for linting project files"
task :rspec do
puts "Linting project files..."

sh(
"bundle",
"exec",
"rspec",
*Dir.glob("spec/*.lint.rb")
)
end
end

0 comments on commit 2f358a9

Please sign in to comment.