Skip to content

Commit

Permalink
Simplify and clean up scripts/test-gem-install
Browse files Browse the repository at this point in the history
Rather than remove all files and conditionally guard against
version.rb load errors, just include the required files for testing
in the gem and test against the installed directory.
  • Loading branch information
stanhu committed Jul 19, 2023
1 parent 6985843 commit 0bec72c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
13 changes: 6 additions & 7 deletions re2.gemspec
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
begin
require File.expand_path(File.join(File.dirname(__FILE__), "lib/re2/version"))
rescue LoadError
puts "WARNING: Could not load RE2::VERSION"
end
require_relative 'lib/re2/version'

Gem::Specification.new do |s|
s.name = "re2"
s.summary = "Ruby bindings to re2."
s.description = 'Ruby bindings to re2, "an efficient, principled regular expression library".'
s.version = defined?(RE2::VERSION) ? RE2::VERSION : "0.0.0"
s.version = RE2::VERSION
s.authors = ["Paul Mucur"]
s.homepage = "https://github.com/mudge/re2"
s.extensions = ["ext/re2/extconf.rb"]
s.license = "BSD-3-Clause"
s.required_ruby_version = ">= 2.7.0"
s.files = [
".rspec",
"dependencies.yml",
"ext/re2/extconf.rb",
"ext/re2/re2.cc",
"Gemfile",
"lib/re2.rb",
"lib/re2/scanner.rb",
"lib/re2/string.rb",
"lib/re2/version.rb",
"LICENSE.txt",
"README.md",
"Rakefile"
"Rakefile",
"re2.gemspec"
]
s.test_files = [
"spec/spec_helper.rb",
Expand Down
3 changes: 2 additions & 1 deletion scripts/test-gem-install
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ fi

bundle install --local || bundle install

rm -rf lib ext # ensure we don't use the local files
cd $(dirname `gem which re2`)
cd ..
rake spec

0 comments on commit 0bec72c

Please sign in to comment.