Skip to content

Commit

Permalink
Refactor gem
Browse files Browse the repository at this point in the history
- Add RuboCop
- Add Gemfile
- Add License
- Generate Readme
- Add tests

Ref: rails/rails#54040
  • Loading branch information
tagliala committed Jan 13, 2025
1 parent 6e6d9d2 commit 4b2c9ec
Show file tree
Hide file tree
Showing 21 changed files with 677 additions and 80 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
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.4'
rubygems: latest
bundler-cache: true
- name: RuboCop
run: bundle exec rubocop -f github
69 changes: 69 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Ruby tests

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

permissions:
contents: read

jobs:
test:
name: Ruby tests
runs-on: ubuntu-latest

strategy:
matrix:
ruby-version: ['3.1', '3.2', '3.3', '3.4']
gemfile: [as_7.1, as_7.2, as_8.0]
channel: [stable]

include:
- ruby-version: '3.2'
gemfile: as_edge
channel: experimental

- ruby-version: '3.3'
gemfile: as_edge
channel: experimental

- ruby-version: '3.4'
gemfile: as_edge
channel: experimental

- ruby-version: 'head'
gemfile: as_7.1
channel: experimental
- ruby-version: 'head'
gemfile: as_7.2
channel: experimental
- ruby-version: 'head'
gemfile: as_8.0
channel: experimental
- ruby-version: 'head'
gemfile: as_edge
channel: experimental

exclude:
- ruby-version: '3.1'
gemfile: as_8.0

- ruby-version: '3.4'
gemfile: as_7.0

env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile

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

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Run tests
run: bundle exec rake test
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.byebug_history
/.bundle/
/.yardoc
/coverage/
/doc/
/Gemfile.lock
/pkg/
/spec/reports/
/tmp/
/_yardoc/
Gemfile.lock
gemfiles/*.gemfile.lock
gemfiles/.bundle
28 changes: 28 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
require:
- rubocop-minitest
- rubocop-packaging
- rubocop-performance
- rubocop-rails
- rubocop-rake

AllCops:
NewCops: enable
TargetRailsVersion: 7.1
TargetRubyVersion: 3.1
Exclude:
- .git/**/*
- .github/**/*
- bin/**/*
- gemfiles/**/*
- node_modules/**/*
- tmp/**/*
- vendor/**/*

Layout/LineLength:
Enabled: false

Style/ArgumentsForwarding:
Enabled: false

Style/ClassAndModuleChildren:
Enabled: false
21 changes: 21 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

appraise 'as-7.1' do
gem 'activestorage', '~> 7.1.0'
end

appraise 'as-7.2' do
gem 'activestorage', '~> 7.2.0'
end

appraise 'as-8.0' do
gem 'activestorage', '~> 8.0.0'
end

appraise 'as-edge' do
gem 'actionpack', git: 'https://github.com/rails/rails.git'
gem 'activejob', git: 'https://github.com/rails/rails.git'
gem 'activerecord', git: 'https://github.com/rails/rails.git'
gem 'activestorage', git: 'https://github.com/rails/rails.git'
gem 'activesupport', git: 'https://github.com/rails/rails.git'
end
22 changes: 22 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true

source 'https://rubygems.org'

# Specify your gem's dependencies in activestorage-colore.gemspec
gemspec

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

gem 'rubocop', require: false
gem 'rubocop-minitest', require: false
gem 'rubocop-packaging', require: false
gem 'rubocop-performance', require: false
gem 'rubocop-rails', require: false
gem 'rubocop-rake', require: false
191 changes: 191 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
PATH
remote: .
specs:
activestorage-colore (2.0.0)
activestorage (>= 7.1)

GEM
remote: https://rubygems.org/
specs:
actionpack (8.0.1)
actionview (= 8.0.1)
activesupport (= 8.0.1)
nokogiri (>= 1.8.5)
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
useragent (~> 0.16)
actionview (8.0.1)
activesupport (= 8.0.1)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (8.0.1)
activesupport (= 8.0.1)
globalid (>= 0.3.6)
activemodel (8.0.1)
activesupport (= 8.0.1)
activerecord (8.0.1)
activemodel (= 8.0.1)
activesupport (= 8.0.1)
timeout (>= 0.4.0)
activestorage (8.0.1)
actionpack (= 8.0.1)
activejob (= 8.0.1)
activerecord (= 8.0.1)
activesupport (= 8.0.1)
marcel (~> 1.0)
activesupport (8.0.1)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
appraisal (2.5.0)
bundler
rake
thor (>= 0.14.0)
ast (2.4.2)
base64 (0.2.0)
benchmark (0.4.0)
bigdecimal (3.1.9)
builder (3.3.0)
byebug (11.1.3)
coderay (1.1.3)
concurrent-ruby (1.3.4)
connection_pool (2.5.0)
crack (1.0.0)
bigdecimal
rexml
crass (1.0.6)
docile (1.4.1)
drb (2.2.1)
erubi (1.13.1)
globalid (1.2.1)
activesupport (>= 6.1)
hashdiff (1.1.2)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
json (2.9.1)
language_server-protocol (3.17.0.3)
logger (1.6.5)
loofah (2.24.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
marcel (1.0.4)
method_source (1.1.0)
mini_portile2 (2.8.8)
minitest (5.25.4)
nokogiri (1.18.1)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
parallel (1.26.3)
parser (3.3.6.0)
ast (~> 2.4.1)
racc
pry (0.15.2)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (6.0.1)
racc (1.8.1)
rack (3.1.8)
rack-session (2.1.0)
base64 (>= 0.1.0)
rack (>= 3.0.0)
rack-test (2.2.0)
rack (>= 1.3)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.2)
loofah (~> 2.21)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.10.0)
rexml (3.4.0)
rubocop (1.70.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.36.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.37.0)
parser (>= 3.3.1.0)
rubocop-minitest (0.36.0)
rubocop (>= 1.61, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-packaging (0.5.2)
rubocop (>= 1.33, < 2.0)
rubocop-performance (1.23.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails (2.28.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.52.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
ruby-progressbar (1.13.0)
securerandom (0.4.1)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4)
thor (1.3.2)
timeout (0.4.3)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (3.1.3)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
uri (1.0.2)
useragent (0.16.11)
webmock (3.24.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
yard (0.9.37)

PLATFORMS
ruby

DEPENDENCIES
activestorage-colore!
appraisal
bundler
byebug
pry
rake
rubocop
rubocop-minitest
rubocop-packaging
rubocop-performance
rubocop-rails
rubocop-rake
simplecov
webmock
yard

BUNDLED WITH
2.6.2
Loading

0 comments on commit 4b2c9ec

Please sign in to comment.