Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
inherit_from: .rubocop_todo.yml

AllCops:
NewCops: enable
SuggestExtensions: false
TargetRubyVersion: 3.0
Exclude:
- 'bin/**/*'
- 'spec/db/schema.rb'

Lint/MissingSuper:
Enabled: false

Lint/EmptyBlock:
Enabled: false

Style/OpenStructUse:
Enabled: false

Style/Documentation:
Enabled: false

Expand All @@ -14,7 +26,7 @@ Style/HashSyntax:
Style/StringLiterals:
EnforcedStyle: double_quotes

Layout/AlignParameters:
Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation

Layout/MultilineOperationIndentation:
Expand All @@ -24,7 +36,7 @@ Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented

Layout/IndentationWidth:
Width: 2
Width: 2

Metrics/ClassLength:
Max: 115
Expand Down
17 changes: 3 additions & 14 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,19 @@

# Offense count: 1
# Cop supports --auto-correct.
Lint/UnneededCopDisableDirective:
Lint/RedundantCopDisableDirective:
Exclude:
- 'lib/rectify/command.rb'

# Offense count: 6
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: io, id, to, by, on, in, at
Naming/UncommunicativeMethodParamName:
Lint/MissingSuper:
Exclude:
- 'lib/rectify/format_attributes_hash.rb'
- 'lib/rectify/rspec/database_reporter/reporter.rb'
- 'spec/fixtures/command/args_command.rb'

# Offense count: 1
# Cop supports --auto-correct.
Performance/RegexpMatch:
Exclude:
- 'lib/rectify/rspec/matchers.rb'

# Offense count: 3
# Cop supports --auto-correct.
Style/ExpandPathArguments:
Expand All @@ -47,11 +41,6 @@ Style/IfUnlessModifier:
Exclude:
- 'lib/rectify/rspec/matchers.rb'

# Offense count: 1
Style/MethodMissingSuper:
Exclude:
- 'lib/rectify/command.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle.
Expand All @@ -64,5 +53,5 @@ Style/NumericPredicate:
# Offense count: 1
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Layout/LineLength:
Max: 100
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM ruby:3.0.4

ENV APP_HOME /app
RUN mkdir -p $APP_HOME
WORKDIR $APP_HOME

RUN apt-get update && apt-get install -y apt-transport-https --no-install-recommends \
build-essential \
ruby-dev \
libgdbm-dev \
libncurses5-dev \
curl \
vim \
graphviz \
&& rm -rf /var/lib/apt/lists/*

COPY . $APP_HOME

ENV BUNDLE_GEMFILE=$APP_HOME/Gemfile \
BUNDLE_PATH=/gems \
BUNDLE_BIN=/gems/bin

RUN bundle install

ENTRYPOINT ["/app/docker-entrypoint.sh"]
147 changes: 76 additions & 71 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,116 +1,121 @@
PATH
remote: .
specs:
rectify (0.13.0)
activemodel (>= 4.1.0)
activerecord (>= 4.1.0)
activesupport (>= 4.1.0)
rectify (0.14.0)
activemodel (>= 7.0.3)
activerecord (>= 7.0.3)
activesupport (>= 7.0.3)
virtus (~> 1.0.5)
wisper (>= 1.6.1)

GEM
remote: https://rubygems.org/
specs:
actionpack (5.2.1)
actionview (= 5.2.1)
activesupport (= 5.2.1)
rack (~> 2.0)
actionpack (7.0.3.1)
actionview (= 7.0.3.1)
activesupport (= 7.0.3.1)
rack (~> 2.0, >= 2.2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.1)
activesupport (= 5.2.1)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionview (7.0.3.1)
activesupport (= 7.0.3.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activemodel (5.2.1)
activesupport (= 5.2.1)
activerecord (5.2.1)
activemodel (= 5.2.1)
activesupport (= 5.2.1)
arel (>= 9.0)
activesupport (5.2.1)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activemodel (7.0.3.1)
activesupport (= 7.0.3.1)
activerecord (7.0.3.1)
activemodel (= 7.0.3.1)
activesupport (= 7.0.3.1)
activesupport (7.0.3.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
arel (9.0.0)
ast (2.4.0)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
ast (2.4.2)
awesome_print (1.8.0)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
builder (3.2.3)
builder (3.2.4)
coderay (1.1.2)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
concurrent-ruby (1.0.5)
crass (1.0.4)
concurrent-ruby (1.1.10)
crass (1.0.6)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
diff-lcs (1.3)
diff-lcs (1.5.0)
equalizer (0.0.11)
erubi (1.7.1)
i18n (1.1.1)
erubi (1.11.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
jaro_winkler (1.5.1)
loofah (2.2.2)
json (2.6.2)
loofah (2.18.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
method_source (0.9.0)
mini_portile2 (2.3.0)
minitest (5.11.3)
nokogiri (1.8.5)
mini_portile2 (~> 2.3.0)
parallel (1.12.1)
parser (2.5.1.2)
ast (~> 2.4.0)
powerpack (0.1.2)
mini_portile2 (2.8.0)
minitest (5.16.2)
nokogiri (1.13.8)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
parallel (1.22.1)
parser (3.1.2.0)
ast (~> 2.4.1)
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
rack (2.0.5)
rack-test (1.1.0)
rack (>= 1.0, < 3)
racc (1.6.0)
rack (2.2.4)
rack-test (2.0.2)
rack (>= 1.3)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.0.4)
loofah (~> 2.2, >= 2.2.2)
rainbow (3.0.0)
rails-html-sanitizer (1.4.3)
loofah (~> 2.3)
rainbow (3.1.1)
rake (12.3.1)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-collection_matchers (1.1.3)
regexp_parser (2.5.0)
rexml (3.2.5)
rspec (3.11.0)
rspec-core (~> 3.11.0)
rspec-expectations (~> 3.11.0)
rspec-mocks (~> 3.11.0)
rspec-collection_matchers (1.2.0)
rspec-expectations (>= 2.99.0.beta1)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.2)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
rspec-support (~> 3.11.0)
rspec-mocks (3.11.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
rubocop (0.59.2)
jaro_winkler (~> 1.5.1)
rspec-support (~> 3.11.0)
rspec-support (3.11.0)
rubocop (1.33.0)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 2.5, != 2.5.1.1)
powerpack (~> 0.1)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.19.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.10.0)
sqlite3 (1.3.13)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.21.0)
parser (>= 3.1.1.0)
ruby-progressbar (1.11.0)
sqlite3 (1.4.4)
thread_safe (0.3.6)
tzinfo (1.2.5)
thread_safe (~> 0.1)
unicode-display_width (1.4.0)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
unicode-display_width (2.2.0)
virtus (1.0.5)
axiom-types (~> 0.1)
coercible (~> 1.0)
Expand All @@ -123,16 +128,16 @@ PLATFORMS
ruby

DEPENDENCIES
actionpack (>= 4.1.0)
actionpack (>= 7.0.3)
awesome_print (~> 1.6)
pry (~> 0.11.3)
rake
rectify!
rspec (~> 3.8)
rspec-collection_matchers (~> 1.1)
rubocop
sqlite3
sqlite3 (>= 1.4.2)
wisper-rspec

BUNDLED WITH
1.16.2
2.2.33
14 changes: 7 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ namespace :g do

migration_class = name.split("_").map(&:capitalize).join

File.open(path, "w") do |file|
file.write <<-MIGRATION.strip_heredoc
class #{migration_class} < ActiveRecord::Migration[5.2]
def change
end
content = <<~MIGRATION
class #{migration_class} < ActiveRecord::Migration[5.2]
def change
end
MIGRATION
end
end
MIGRATION

File.write(path, content)

puts "Migration #{path} created"
abort # needed stop other tasks
Expand Down
5 changes: 5 additions & 0 deletions bin/docker/rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

echo start specs tests

docker-compose run --rm web bash -c "bundle exec rspec $*"
3 changes: 3 additions & 0 deletions bin/docker/rubocop
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

docker-compose run --rm -v $(PWD):$(PWD) --no-deps web bash -c "bundle exec rubocop $*"
24 changes: 24 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: '3.7'

volumes:
store:
gem_cache:

x-base: &base
image: rectify_web
build:
context: .
dockerfile: Dockerfile
volumes:
- .:/app
- gem_cache:/gems

services:
web:
<<: *base
stdin_open: true
tty: true
command: ./bin/rspec
environment:
- EDITOR=vim
- WEBPACKER_DEV_SERVER_HOST=webpack
9 changes: 9 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
set -e

if [ -f tmp/pids/server.pid ]; then
# remove old pids
rm tmp/pids/server.pid
fi

exec "$@"
Loading