Skip to content

Commit

Permalink
Merge pull request #228 from Invoca/STORY-18706_update_to_gem_best_pr…
Browse files Browse the repository at this point in the history
…actices

Gem CI Best Practices
  • Loading branch information
ttstarck authored Jul 11, 2024
2 parents 8e32a50 + 1fd6e0e commit 7602e2e
Show file tree
Hide file tree
Showing 15 changed files with 51 additions and 32 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [2.7, '3.0', 3.1, 3.2]
ruby: [3.1, 3.2, 3.3]
gemfile:
- Gemfile
- gemfiles/rails_6_0.gemfile
- gemfiles/rails_6_1.gemfile
- gemfiles/rails_7_0.gemfile
- gemfiles/rails_7_1.gemfile

env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.5
3.1.6
12 changes: 2 additions & 10 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# frozen_string_literal: true

appraise 'rails-6-0' do
gem 'rails', '~> 6.0.0', '< 6.1'
end
require "appraisal/matrix"

appraise 'rails-6-1' do
gem 'rails', '~> 6.1.0', '< 6.2'
end

appraise 'rails-7-0' do
gem 'rails', '~> 7.0.0', '< 8'
end
appraisal_matrix(rails: "6.0")
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ source "https://rubygems.org"
gemspec

gem 'appraisal'
gem 'appraisal-matrix'
gem 'bigdecimal'
gem 'minitest', '~> 5.1'
gem 'minitest-reporters'
Expand Down
7 changes: 5 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PATH
remote: .
specs:
large_text_field (1.1.0)
large_text_field (1.2.0)
invoca-utils (~> 0.3)
rails (>= 5.2)
rails (>= 6.0)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -72,6 +72,8 @@ GEM
bundler
rake
thor (>= 0.14.0)
appraisal-matrix (0.2.0)
appraisal (~> 2.2)
ast (2.4.2)
bigdecimal (3.1.4)
builder (3.2.4)
Expand Down Expand Up @@ -211,6 +213,7 @@ PLATFORMS

DEPENDENCIES
appraisal
appraisal-matrix
bigdecimal
large_text_field!
minitest (~> 5.1)
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ This gem allows any model to be associated with multiple named text fields. Each
characters. Defining new fields on models does not require database migrations. All text fields are stored in a
central table that is polymorphically associated with the model, but they act like a column on the same model.

## Dependencies
* Ruby >= 2.7
* Rails >= 6.0

## How do I use it?
In you Gemfile add:

Expand Down
3 changes: 2 additions & 1 deletion gemfiles/rails_6_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
source "https://rubygems.org"

gem "appraisal"
gem "appraisal-matrix"
gem "bigdecimal"
gem "minitest", "~> 5.1"
gem "minitest-reporters"
Expand All @@ -16,6 +17,6 @@ gem "shoulda", "~> 3.5"
gem "shoulda-matchers", "~> 3.0"
gem "test-unit", "~> 3.3"
gem "warning", require: false
gem "rails", "~> 6.0.0", "< 6.1"
gem "rails", "~> 6.0.0"

gemspec path: "../"
3 changes: 2 additions & 1 deletion gemfiles/rails_6_1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
source "https://rubygems.org"

gem "appraisal"
gem "appraisal-matrix"
gem "bigdecimal"
gem "minitest", "~> 5.1"
gem "minitest-reporters"
Expand All @@ -16,6 +17,6 @@ gem "shoulda", "~> 3.5"
gem "shoulda-matchers", "~> 3.0"
gem "test-unit", "~> 3.3"
gem "warning", require: false
gem "rails", "~> 6.1.0", "< 6.2"
gem "rails", "~> 6.1.0"

gemspec path: "../"
3 changes: 2 additions & 1 deletion gemfiles/rails_7_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
source "https://rubygems.org"

gem "appraisal"
gem "appraisal-matrix"
gem "bigdecimal"
gem "minitest", "~> 5.1"
gem "minitest-reporters"
Expand All @@ -16,6 +17,6 @@ gem "shoulda", "~> 3.5"
gem "shoulda-matchers", "~> 3.0"
gem "test-unit", "~> 3.3"
gem "warning", require: false
gem "rails", "~> 7.0.0", "< 8"
gem "rails", "~> 7.0.0"

gemspec path: "../"
22 changes: 22 additions & 0 deletions gemfiles/rails_7_1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "appraisal"
gem "appraisal-matrix"
gem "bigdecimal"
gem "minitest", "~> 5.1"
gem "minitest-reporters"
gem "mysql2"
gem "pry"
gem "rr", "~> 1.1"
gem "rubocop", require: false
gem "rubocop-minitest", require: false
gem "rubocop-rails", require: false
gem "shoulda", "~> 3.5"
gem "shoulda-matchers", "~> 3.0"
gem "test-unit", "~> 3.3"
gem "warning", require: false
gem "rails", "~> 7.1.0"

gemspec path: "../"
4 changes: 2 additions & 2 deletions large_text_field.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Gem::Specification.new do |spec|
Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]
end

spec.required_ruby_version = '>= 2.7.5'
spec.required_ruby_version = '>= 3.1'

spec.add_dependency "invoca-utils", "~> 0.3"
spec.add_dependency "rails", ">= 5.2"
spec.add_dependency "rails", ">= 6.0"
end
2 changes: 1 addition & 1 deletion lib/large_text_field/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module LargeTextField
VERSION = "1.1.0"
VERSION = "1.2.0"
end
3 changes: 1 addition & 2 deletions test/dummy/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# Ignored
end

Bundler.require(*Rails.groups)
require "large_text_field"

module Dummy
Expand Down Expand Up @@ -48,7 +47,7 @@ class Application < Rails::Application
# Enable escaping HTML in JSON.
config.active_support.escape_html_entities_in_json = true

if Rails::VERSION::STRING.to_f >= 6.1
if Rails.gem_version >= "6.1" && Rails.gem_version < "7"
# Migrate to the new connection handling behavior.
# See: https://guides.rubyonrails.org/active_record_multiple_databases.html#migrate-to-the-new-connection-handling
config.active_record.legacy_connection_handling = false
Expand Down
12 changes: 6 additions & 6 deletions test/dummy/db/schema.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true

# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
Expand All @@ -12,16 +10,18 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20_160_217_033_529) do
create_table "large_text_fields", id: :integer, charset: "utf8", force: :cascade do |t|
ActiveRecord::Schema.define(version: 2016_02_17_033529) do

create_table "large_text_fields", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.string "field_name", null: false
t.text "value", size: :medium
t.integer "owner_id", null: false
t.string "owner_type", null: false
t.index %w[owner_type owner_id field_name], name: "large_text_field_by_owner_field", unique: true
t.index ["owner_type", "owner_id", "field_name"], name: "large_text_field_by_owner_field", unique: true
end

create_table "libraries", id: :integer, charset: "utf8", force: :cascade do |t|
create_table "libraries", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.string "name", null: false
end

end
2 changes: 2 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

require File.expand_path('dummy/config/environment.rb', __dir__)

require "minitest"
require "minitest/autorun"
require "minitest/unit"
require "pry"
require "rails/test_help"
Expand Down

0 comments on commit 7602e2e

Please sign in to comment.