Skip to content

Commit

Permalink
Unify rails & ruby support (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
andriusch authored Dec 22, 2022
1 parent 8c6e674 commit bdf1abc
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 50 deletions.
3 changes: 1 addition & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
.github/workflows/ci.yml @toptal/coresmiths-team
.github/workflows/main.yml @toptal/coresmiths-team
* @toptal/coresmiths-team
29 changes: 0 additions & 29 deletions .github/workflows/main.yml

This file was deleted.

25 changes: 22 additions & 3 deletions .github/workflows/ci.yml → .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: CI
on: [push, pull_request]
name: Ruby
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
rspec:
strategy:
Expand All @@ -12,10 +16,25 @@ jobs:
- { ruby: '2.6', rails: '5.2' }
- { ruby: '2.7', rails: '6.0' }
- { ruby: '3.0', rails: '6.1' }
- { ruby: '3.0', rails: '7.0' }
- { ruby: '3.1', rails: '7.0' }
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails.${{ matrix.rails }}.gemfile
services:
postgres:
image: postgres
env:
POSTGRES_USER: granite
POSTGRES_PASSWORD: granite
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ inherit_from: .rubocop_todo.yml

AllCops:
DisplayCopNames: true
TargetRubyVersion: 2.2.10
TargetRubyVersion: 2.3.0

Lint/AmbiguousBlockAssociation:
Enabled: false
Expand Down
28 changes: 14 additions & 14 deletions granite-form.gemspec
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
require File.expand_path('../lib/granite/form/version', __FILE__)

Gem::Specification.new do |gem|
gem.authors = ['pyromaniac']
gem.email = ['[email protected]']
gem.description = 'Making object from any hash or hash array'
gem.summary = 'Working with hashes in AR style'
gem.homepage = ''
gem.authors = ['Toptal Engineering']
gem.description = 'Making object from any hash or hash array'
gem.summary = 'Working with hashes in AR style'
gem.homepage = 'https://github.com/toptal/granite-form'

gem.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.name = 'granite-form'
gem.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.name = 'granite-form'
gem.require_paths = ['lib']
gem.version = Granite::Form::VERSION
gem.required_ruby_version = '>= 2.3.0'
gem.version = Granite::Form::VERSION

gem.add_development_dependency 'actionpack', '>= 4.0'
gem.add_development_dependency 'activerecord', '>= 4.0'
gem.add_development_dependency 'actionpack', '>= 4.2'
gem.add_development_dependency 'activerecord', '>= 4.2'
gem.add_development_dependency 'appraisal'
gem.add_development_dependency 'bump'
gem.add_development_dependency 'database_cleaner'
Expand All @@ -26,7 +26,7 @@ Gem::Specification.new do |gem|
gem.add_development_dependency 'sqlite3'
gem.add_development_dependency 'uuidtools'

gem.add_runtime_dependency 'activemodel', '>= 4.0'
gem.add_runtime_dependency 'activesupport', '>= 4.0'
gem.add_runtime_dependency 'activemodel', '>= 4.2'
gem.add_runtime_dependency 'activesupport', '>= 4.2'
gem.add_runtime_dependency 'tzinfo'
end
2 changes: 1 addition & 1 deletion lib/granite/form/model/attributes/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def evaluate(*args, &block)
if block.arity >= 0 && block.arity <= args.length
owner.instance_exec(*args.first(block.arity), &block)
else
args = block.arity < 0 ? args : args.first(block.arity)
args = block.arity.negative? ? args : args.first(block.arity)
yield(*args, owner)
end
end
Expand Down

0 comments on commit bdf1abc

Please sign in to comment.