Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
StefSchenkelaars committed Nov 5, 2020
0 parents commit 1288c8f
Show file tree
Hide file tree
Showing 26 changed files with 743 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI
on: [push]
jobs:
reviewdog:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Setup reviewdog
uses: reviewdog/action-setup@v1

- name: Run reviewdog
run: reviewdog -reporter=github-check
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}

rspec:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Run RSpec
run: bundle exec rspec --format RSpec::Github::Formatter
54 changes: 54 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Publish
on:
release:
types: [published]

jobs:
publish-github:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Setup Ruby
uses: ruby/setup-ruby@v1

- name: Setup GitHub Package Registry credentials
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:github: Bearer ${{ secrets.GITHUB_TOKEN }}\n" > $HOME/.gem/credentials
- name: Replace version by tag value
run: sed -i "s/'[0-9]\.[0-9]\..*'/'${GITHUB_REF##*/}'/" lib/sql_attributes/version.rb

- name: Build and Publish gem to GitHub Package Registry
run: |
gem build --verbose *.gemspec
gem push --verbose --key github --host https://rubygems.pkg.github.com/${OWNER} *.gem
env:
OWNER: Drieam

publish-rubygems:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Setup Ruby
uses: ruby/setup-ruby@v1

- name: Replace version by tag value
run: sed -i "s/'[0-9]\.[0-9]\..*'/'${GITHUB_REF##*/}'/" lib/sql_attributes/version.rb

- name: Publish to RubyGems
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build --verbose *.gemspec
gem push --verbose *.gem
env:
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.bundle/
log/*.log
pkg/
spec/internal/db/*.sqlite3
spec/internal/log/*.log
spec/internal/storage/

.yardoc
_yardoc/
coverage/
doc/
spec/reports/
tmp/

# rspec failure tracking
.rspec_status

3 changes: 3 additions & 0 deletions .reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
runner:
rubocop:
cmd: bundle exec rubocop
3 changes: 3 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--format documentation
--color
--require spec_helper
32 changes: 32 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
require:
- rubocop-performance # Performance optimization analysis
- rubocop-rails # Rails-specific analysis

AllCops:
TargetRubyVersion: 2.5
NewCops: enable
Exclude:
- 'tmp/**/*'
- 'vendor/**/*'

# We have a readme instead
Style/Documentation:
Enabled: false

# We like our specs to use the {} syntax
Lint/AmbiguousBlockAssociation:
Exclude:
- 'spec/**/*.rb'

# Well, lower would probably be better but it doesn't improve the readability of this gem
Metrics/MethodLength:
Max: 15

Metrics/BlockLength:
Exclude:
- 'spec/**/*.rb' # Specs just have large blocks
- '*.gemspec' # Is just one block

# This is intentional and covered by the specs
Rails/SquishedSQLHeredocs:
Enabled: false
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby 2.7.2
8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

source 'https://rubygems.org'

# Declare your gem's dependencies in sql_attributes.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
gemspec
140 changes: 140 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
PATH
remote: .
specs:
sql_attributes (0.1.0.develop)
activerecord (>= 6.0.3)

GEM
remote: https://rubygems.org/
specs:
actionpack (6.0.3.4)
actionview (= 6.0.3.4)
activesupport (= 6.0.3.4)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionview (6.0.3.4)
activesupport (= 6.0.3.4)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activemodel (6.0.3.4)
activesupport (= 6.0.3.4)
activerecord (6.0.3.4)
activemodel (= 6.0.3.4)
activesupport (= 6.0.3.4)
activesupport (6.0.3.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
ast (2.4.1)
builder (3.2.4)
combustion (1.3.1)
activesupport (>= 3.0.0)
railties (>= 3.0.0)
thor (>= 0.14.6)
concurrent-ruby (1.1.7)
crass (1.0.6)
database_cleaner (1.8.5)
database_cleaner-active_record (1.8.0)
activerecord
database_cleaner (~> 1.8.0)
diff-lcs (1.4.4)
erubi (1.9.0)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
loofah (2.7.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
method_source (1.0.0)
mini_portile2 (2.4.0)
minitest (5.14.2)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
parallel (1.19.2)
parser (2.7.2.0)
ast (~> 2.4.1)
rack (2.2.3)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
railties (6.0.3.4)
actionpack (= 6.0.3.4)
activesupport (= 6.0.3.4)
method_source
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
rainbow (3.0.0)
rake (13.0.1)
regexp_parser (1.8.2)
rexml (3.2.4)
rspec-core (3.9.3)
rspec-support (~> 3.9.3)
rspec-expectations (3.9.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-github (2.3.1)
rspec-core (~> 3.0)
rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-rails (4.0.1)
actionpack (>= 4.2)
activesupport (>= 4.2)
railties (>= 4.2)
rspec-core (~> 3.9)
rspec-expectations (~> 3.9)
rspec-mocks (~> 3.9)
rspec-support (~> 3.9)
rspec-support (3.9.4)
rubocop (1.0.0)
parallel (~> 1.10)
parser (>= 2.7.1.5)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8)
rexml
rubocop-ast (>= 0.6.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (1.1.0)
parser (>= 2.7.1.5)
rubocop-performance (1.8.1)
rubocop (>= 0.87.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.8.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 0.87.0)
ruby-progressbar (1.10.1)
sqlite3 (1.4.2)
thor (1.0.1)
thread_safe (0.3.6)
tzinfo (1.2.7)
thread_safe (~> 0.1)
unicode-display_width (1.7.0)
zeitwerk (2.4.0)

PLATFORMS
ruby

DEPENDENCIES
combustion
database_cleaner-active_record
rspec-github
rspec-rails
rubocop
rubocop-performance
rubocop-rails
sql_attributes!
sqlite3

BUNDLED WITH
2.1.4
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2020 Stef Schenkelaars

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Loading

0 comments on commit 1288c8f

Please sign in to comment.