Skip to content

Commit

Permalink
Merge pull request #37 from ifad/feature/modernize
Browse files Browse the repository at this point in the history
Modernize
  • Loading branch information
tagliala authored Jan 20, 2024
2 parents 757d024 + 055a5bd commit 147514e
Show file tree
Hide file tree
Showing 38 changed files with 550 additions and 567 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.rubocop_todo.yml linguist-generated
86 changes: 0 additions & 86 deletions .github/workflows/legacy_ruby.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: RuboCop

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

permissions:
contents: read

jobs:
test:
name: RuboCop
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
rubygems: latest
bundler-cache: true
- name: RuboCop
run: bundle exec rubocop
26 changes: 2 additions & 24 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:

strategy:
matrix:
ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3']
gemfile: [am_6.0, am_6.1, am_7.0, am_7.1]
ruby-version: ['3.0', '3.1', '3.2', '3.3']
gemfile: [am_7.0, am_7.1]
channel: [stable]

include:
Expand All @@ -43,30 +43,8 @@ jobs:
gemfile: am_edge
channel: experimental

exclude:
- ruby-version: '2.6'
gemfile: am_7.0
- ruby-version: '2.6'
gemfile: am_7.1

- ruby-version: '3.1'
gemfile: am_6.0
- ruby-version: '3.1'
gemfile: am_6.1

- ruby-version: '3.2'
gemfile: am_6.0
- ruby-version: '3.2'
gemfile: am_6.1

- ruby-version: '3.3'
gemfile: am_6.0
- ruby-version: '3.3'
gemfile: am_6.1

env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
TEST_CONFIG: ./spec/config.github.yml

continue-on-error: ${{ matrix.channel != 'stable' }}

Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/.bundle/
/.yardoc
/Gemfile.lock
/_yardoc/
/coverage/
/doc/
/Gemfile.lock
/pkg/
/spec/reports/
/tmp/
/_yardoc/
Gemfile.lock
gemfiles/*.gemfile.lock
gemfiles/.bundle
spec/examples.txt
3 changes: 1 addition & 2 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
--format progress
--color
--require spec_helper
27 changes: 27 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
inherit_from: .rubocop_todo.yml

require:
- rubocop-packaging
- rubocop-performance
- rubocop-rails
- rubocop-rake
- rubocop-rspec

AllCops:
NewCops: enable
TargetRailsVersion: 7.0
TargetRubyVersion: 3.0
Exclude:
- 'lib/**/*'
- 'gemfiles/**/*'
- 'vendor/bundle/**/*'
- 'tmp/**/*'

Layout/LineLength:
Enabled: false

RSpec/ExampleLength:
Enabled: false

RSpec/MultipleExpectations:
Enabled: false
19 changes: 19 additions & 0 deletions .rubocop_todo.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 5 additions & 57 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,66 +1,14 @@
appraise 'am-3.2' do
gem 'activemodel', "~> 3.2.0"
gem 'activesupport', "~> 3.2.0"
gem 'dalli', '< 3'
end

appraise 'am-4.0' do
gem 'activemodel', "~> 4.0.0"
gem 'activesupport', "~> 4.0.0"
gem 'dalli', '< 3'
end

appraise 'am-4.1' do
gem 'activemodel', "~> 4.1.0"
gem 'activesupport', "~> 4.1.0"
gem 'dalli', '< 3'
end

appraise 'am-4.2' do
gem 'activemodel', "~> 4.2.0"
gem 'activesupport', "~> 4.2.0"
gem 'dalli', '< 3'
end

appraise 'am-5.0' do
gem 'activemodel', "~> 5.0.0"
gem 'activesupport', "~> 5.0.0"
gem 'dalli', '< 3'
end

appraise 'am-5.1' do
gem 'activemodel', "~> 5.1.0"
gem 'activesupport', "~> 5.1.0"
gem 'dalli', '< 3'
end

appraise 'am-5.2' do
gem 'activemodel', "~> 5.2.0"
gem 'activesupport', "~> 5.2.0"
gem 'dalli', '< 3'
end

appraise 'am-6.0' do
gem 'activemodel', "~> 6.0.0"
gem 'activesupport', "~> 6.0.0"
end

appraise 'am-6.1' do
gem 'activemodel', "~> 6.1.0"
gem 'activesupport', "~> 6.1.0"
end
# frozen_string_literal: true

appraise 'am-7.0' do
gem 'activemodel', "~> 7.0.0"
gem 'activesupport', "~> 7.0.0"
gem 'activemodel', '~> 7.0.0'
end

appraise 'am-7.1' do
gem 'activemodel', "~> 7.1.0"
gem 'activesupport', "~> 7.1.0"
gem 'activemodel', '~> 7.1.0'
end

appraise 'am-edge' do
gem 'activemodel', git: "https://github.com/rails/rails.git"
gem 'activesupport', git: "https://github.com/rails/rails.git"
gem 'activemodel', git: 'https://github.com/rails/rails.git'
gem 'activesupport', git: 'https://github.com/rails/rails.git'
end
19 changes: 19 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
# frozen_string_literal: true

source 'https://rubygems.org'

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

gem 'appraisal'
gem 'bundler'
gem 'byebug'
gem 'pry'
gem 'rake'
gem 'rspec'
gem 'simplecov'
gem 'webmock'
gem 'yard'

gem 'rubocop', require: false
gem 'rubocop-packaging', require: false
gem 'rubocop-performance', require: false
gem 'rubocop-rails', require: false
gem 'rubocop-rake', require: false
gem 'rubocop-rspec', require: false
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Hawk

[![Build Status](https://github.com/ifad/hawk/actions/workflows/ruby.yml/badge.svg)](https://github.com/ifad/hawk/actions)
[![Legacy Build Status](https://github.com/ifad/hawk/actions/workflows/legacy_ruby.yml/badge.svg)](https://github.com/ifad/hawk/actions)

Hawk is an API Client framework. It is used as a base to then build your API
clients. It consumes JSON and produces Ruby objects without any Hash magic.
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Bundler
require 'bundler/setup'
require 'bundler/gem_tasks'
Expand Down
7 changes: 4 additions & 3 deletions bin/console
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require "bundler/setup"
require "hawk"
require 'bundler/setup'
require 'hawk'

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.
Expand All @@ -10,5 +11,5 @@ require "hawk"
# require "pry"
# Pry.start

require "irb"
require 'irb'
IRB.start
9 changes: 0 additions & 9 deletions gemfiles/am_3.2.gemfile

This file was deleted.

9 changes: 0 additions & 9 deletions gemfiles/am_4.0.gemfile

This file was deleted.

9 changes: 0 additions & 9 deletions gemfiles/am_4.1.gemfile

This file was deleted.

9 changes: 0 additions & 9 deletions gemfiles/am_4.2.gemfile

This file was deleted.

Loading

0 comments on commit 147514e

Please sign in to comment.