Skip to content

Commit

Permalink
This allows running tests on the root of the project freshly checked …
Browse files Browse the repository at this point in the history
…out (bootstrap-ruby#651)

* This allows running tests on the root of the project freshly checked out

* Put move REQUIRED_RAILS_VERSION to BootstrapForm::REQUIRED_RAILS_VERSION so it can easily be required

* Require 'bootstrap_form/version' with absolute path to enable use before load path is complete

Co-authored-by: Uwe Kubosch <[email protected]>
  • Loading branch information
donv and UweKubosch authored Jul 23, 2022
1 parent 979474f commit 0a75c79
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 30 deletions.
25 changes: 4 additions & 21 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
source "http://rubygems.org"
gems = "#{__dir__}/gemfiles/common.gemfile"
eval File.read(gems), binding, gems # rubocop: disable Security/Eval

gemspec path: __dir__
require "#{__dir__}/lib/bootstrap_form/version"

# To test with different Rails versions, use the files in `./gemfiles`

group :development do
gem "htmlbeautifier"
gem "rubocop-performance", require: false
gem "rubocop-rails", require: false
gem "webpacker"
end

group :test do
gem "diffy"
gem "equivalent-xml"
gem "mocha"
gem "sqlite3"
end

group :ci do
gem "danger"
end
gem "rails", BootstrapForm::REQUIRED_RAILS_VERSION
6 changes: 2 additions & 4 deletions bootstrap_form.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

require "bootstrap_form/version"

REQUIRED_RAILS_VERSION = ">= 5.2".freeze

Gem::Specification.new do |s|
s.name = "bootstrap_form"
s.version = BootstrapForm::VERSION
Expand All @@ -27,6 +25,6 @@ Gem::Specification.new do |s|

s.required_ruby_version = ">= 2.7"

s.add_dependency("actionpack", REQUIRED_RAILS_VERSION)
s.add_dependency("activemodel", REQUIRED_RAILS_VERSION)
s.add_dependency("actionpack", BootstrapForm::REQUIRED_RAILS_VERSION)
s.add_dependency("activemodel", BootstrapForm::REQUIRED_RAILS_VERSION)
end
2 changes: 1 addition & 1 deletion gemfiles/5.2.gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
gems = "#{File.dirname __dir__}/Gemfile"
gems = "#{__dir__}/common.gemfile"
eval File.read(gems), binding, gems # rubocop: disable Security/Eval

gem "rails", "~> 5.2.0"
2 changes: 1 addition & 1 deletion gemfiles/6.0.gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
gems = "#{File.dirname __dir__}/Gemfile"
gems = "#{__dir__}/common.gemfile"
eval File.read(gems), binding, gems # rubocop: disable Security/Eval

gem "rails", "~> 6.0.0"
2 changes: 1 addition & 1 deletion gemfiles/6.1.gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
gems = "#{File.dirname __dir__}/Gemfile"
gems = "#{__dir__}/common.gemfile"
eval File.read(gems), binding, gems # rubocop: disable Security/Eval

gem "rails", "~> 6.1.0"
2 changes: 1 addition & 1 deletion gemfiles/7.0.gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
gems = "#{File.dirname __dir__}/Gemfile"
gems = "#{__dir__}/common.gemfile"
eval File.read(gems), binding, gems # rubocop: disable Security/Eval

# 7.0.0 has an issue with Ruby 3.1.
Expand Down
23 changes: 23 additions & 0 deletions gemfiles/common.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
source "http://rubygems.org"

gemspec path: File.dirname(__dir__)

# To test with different Rails versions, use the files in `./gemfiles`

group :development do
gem "htmlbeautifier"
gem "rubocop-performance", require: false
gem "rubocop-rails", require: false
gem "webpacker"
end

group :test do
gem "diffy"
gem "equivalent-xml"
gem "mocha"
gem "sqlite3"
end

group :ci do
gem "danger"
end
2 changes: 1 addition & 1 deletion gemfiles/edge.gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
gems = "#{File.dirname __dir__}/Gemfile"
gems = "#{__dir__}/common.gemfile"
eval File.read(gems), binding, gems # rubocop: disable Security/Eval

gem "rails", git: "https://github.com/rails/rails.git"
1 change: 1 addition & 0 deletions lib/bootstrap_form/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module BootstrapForm
VERSION = "5.1.0".freeze
REQUIRED_RAILS_VERSION = ">= 5.2".freeze
end

0 comments on commit 0a75c79

Please sign in to comment.