Skip to content

Commit

Permalink
Use appraisal
Browse files Browse the repository at this point in the history
  • Loading branch information
hunchr committed Nov 4, 2024
1 parent 4f9e43e commit 783a449
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 368 deletions.
33 changes: 26 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,41 @@ name: ci
on: push

jobs:
check:
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [2.7, 3.3]
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ${{ matrix.ruby }}

- name: Install Dependencies
uses: ruby/setup-ruby@v1.197.0
run: bundle && bundle exec appraisal install && cd spec/dummy && bundle

- name: Run tests
run: bundle exec appraisal bin/check

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: 3.3

- name: Setup Hotsheet
run: bundle && cd spec/dummy && bundle
- name: Install Dependencies
run: bundle

- name: Run linters
run: bin/fastcheck

- name: Run tests
run: bin/check
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/test/dummy/log/*.log
/test/dummy/storage/
/test/dummy/tmp/
/gemfiles

/Gemfile.lock
.rspec_status
3 changes: 2 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ inherit_gem:
renuocop: config/base.yml

AllCops:
Exclude: [gemfiles/**/*, spec/dummy/db/schema.rb]
SuggestExtensions: false
TargetRubyVersion: 3.1.4
TargetRubyVersion: 2.7.0
13 changes: 13 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

appraise "rails-6" do
gem "rails", "6.0.0"
end

appraise "rails-7" do
gem "rails", "7.0.0"
end

appraise "rails-8" do
gem "rails", "8.0.0.rc2"
end
4 changes: 1 addition & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

source "https://rubygems.org"

# Specify your gem's dependencies in hotsheet.gemspec
gemspec

group :development, :test do
gem "puma"
gem "appraisal"
gem "renuocop", require: false
gem "rspec"
gem "rake"
end
12 changes: 2 additions & 10 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,9 @@

require "bundler/setup"
require "bundler/gem_tasks"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec)
APP_RAKEFILE = File.expand_path("spec/dummy/Rakefile", __dir__)

require "rubocop/rake_task"

RuboCop::RakeTask.new

APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
load "rails/tasks/engine.rake"

load "rails/tasks/statistics.rake"

task default: %i[spec rubocop]
task default: :stats
33 changes: 14 additions & 19 deletions hotsheet.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,28 @@ Gem::Specification.new do |spec|
spec.name = "hotsheet"
spec.version = Hotsheet::VERSION
spec.authors = ["Renuo AG"]
spec.email = [
"ignacio.sfeir@renuo.ch", "simon.isler@renuo.ch", "eduard.munteanu@renuo.ch", "chris.hunziker@renuo.ch"
]
spec.email = %w[ignacio.sfeir@renuo.ch simon.isler@renuo.ch eduard.munteanu@renuo.ch chris.hunziker@renuo.ch]
spec.license = "MIT"

spec.summary = "Manage your database with a simple and familiar web interface"
spec.description = "This gem allows you to mount a view to manage your database using a" \
"table view where you can edit DB records inline."
spec.homepage = "https://github.com/renuo/hotsheet"
spec.metadata = {
"homepage_uri" => spec.homepage,
"source_code_uri" => spec.homepage,
"changelog_uri" => "#{spec.homepage}/blob/main/CHANGELOG.md",
"documentation_uri" => "#{spec.homepage}/blob/main/README.md",
"rubygems_mfa_required" => "true"
}

spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = spec.homepage
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/main/CHANGELOG.md"
spec.metadata["documentation_uri"] = "#{spec.homepage}/blob/main/README.md"
spec.metadata["rubygems_mfa_required"] = "true"

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
spec.files = Dir.chdir(__dir__) do
`git ls-files -z`.split("\x0").reject do |f|
(File.expand_path(f) == __FILE__) ||
f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor Gemfile])
end
end
spec.require_paths = ["lib"]
spec.files = Dir.chdir __dir__ do
`git ls-files -z`.split("\x0").reject { _1.match %r{^(.git|bin|spec)/} }
end

spec.required_ruby_version = ">= 3.1.4"
spec.add_dependency "rails", ">= 7.2.1"
spec.required_ruby_version = ">= 2.7.0"
spec.add_dependency "rails", ">= 6.0.0"
spec.add_dependency "sprockets-rails"
spec.add_dependency "stimulus-rails"
spec.add_dependency "turbo-rails"
Expand Down
2 changes: 2 additions & 0 deletions lib/hotsheet.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

require "sprockets/railtie"
require "turbo-rails"

require "hotsheet/configuration"
require "hotsheet/engine"
require "hotsheet/version"
Expand Down
4 changes: 2 additions & 2 deletions lib/hotsheet/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ class Configuration

config_accessor(:models) { {} }

def model(name, &)
def model(name, &block)
model_config = ModelConfig.new
yield model_config
yield model_config if block
models[name.to_s] = model_config
end

Expand Down
1 change: 1 addition & 0 deletions spec/dummy/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
/storage
/tmp

/Gemfile.lock
/config/master.key
5 changes: 0 additions & 5 deletions spec/dummy/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@
source "https://rubygems.org"

gem "hotsheet", path: "../.."
gem "importmap-rails"
gem "puma"
gem "rails", github: "rails/rails", branch: "main"
gem "sqlite3"
gem "turbo-rails"

group :development, :test do
gem "better_errors"
gem "binding_of_caller"
gem "debug"
gem "faker", require: false
gem "renuocop", require: false
gem "rspec-rails", require: false
end
Loading

0 comments on commit 783a449

Please sign in to comment.