Skip to content

Commit 85382c3

Browse files
lcreiddonvthimo
authored and
Charlotte Hanekamp
committed
Get rid of heredoc on bootstrap-5 branch (bootstrap-ruby#591)
* Ignore RubyMine config directory * Initial setup of GitHb Actions * Run tests for rails 5 and rails 6 * Run tests for rails 5 and rails 6 + run lint job * GH Actions: Correct gemfile names * GH Actions: Only run the test task in the matrix. rubocop is run in the separate Lint job. * GH Actions: Separate the Danger run for better output * GH Actions: Run rubocop directly instead of as a Rake task. Allow autocorrectable offences. * GH Actions: Only run Danger for pull requests * GH Actions: Try to calm RuboCop * Use the default Gemfile to pick up rubocop.yml * GH Actions: Ignore the vendor directory for rubocop * Forward the options as keyword arguments * Test Rails 6.1 and skip Rails 5.2 + Ruby 3.0 * Fix Rails 6.1 tests on master (bootstrap-ruby#586) * Fix tests for Rails 6.1 * Fix Rubocop offenses bootstrap_form.gemspec:27:29: C: Gemspec/RequiredRubyVersion: required_ruby_version (2.5, declared in bootstrap_form.gemspec) and TargetRubyVersion (2.7, which may be specified in .rubocop.yml) should be equal. s.required_ruby_version = ">= 2.5" ^^^^^^^^ lib/bootstrap_form/form_group.rb:14:30: C: [Correctable] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line. (https://rubystyle.guide#no-double-indent) :input_group_class, :label_col, :control_col, ^^^^^^^^^^^^^^^^^^ lib/bootstrap_form/form_group.rb:15:30: C: [Correctable] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line. (https://rubystyle.guide#no-double-indent) :add_control_col_class, :layout, :prepend)) do ^^^^^^^^^^^^^^^^^^^^^^ test/bootstrap_form_test.rb:123:103: C: [Correctable] Style/IfUnlessModifier: Modifier form of if makes the line too long. (https://rubystyle.guide#if-as-a-modifier) <form accept-charset="UTF-8" action="/users" method="post" role="form" #{'data-remote="true"' if ::Rails::VERSION::STRING < "6.1"}> ^^ test/bootstrap_form_test.rb:123:133: C: [Correctable] Style/StringLiteralsInInterpolation: Prefer single-quoted strings inside interpolations. <form accept-charset="UTF-8" action="/users" method="post" role="form" #{'data-remote="true"' if ::Rails::VERSION::STRING < "6.1"}> ^^^^^ test/bootstrap_rich_text_area_test.rb:23:54: C: [Correctable] Style/StringLiteralsInInterpolation: Prefer single-quoted strings inside interpolations. "http://test.host/rails/active_storage/blobs/#{"redirect/" if ::Rails::VERSION::STRING >= "6.1"}:signed_id/:filename" ^^^^^^^^^^^ test/bootstrap_rich_text_area_test.rb:23:97: C: [Correctable] Style/StringLiteralsInInterpolation: Prefer single-quoted strings inside interpolations. "http://test.host/rails/active_storage/blobs/#{"redirect/" if ::Rails::VERSION::STRING >= "6.1"}:signed_id/:filename" ^^^^^ * Include Rails 6.1 in Travis tests + update Ruby versions * Update CHANGELOG * Rails Edge requires Ruby 2.7+ * Remove rubocop_todo and fix Rubocop offenses * Replace strip_heredoc with <<~ (bootstrap-ruby#587) * Replace strip_heredoc with <<~ Also fix newly detected Rubocop offenses on indentation * Update CHANGELOG * Simplify Dockerfile and add documentation (bootstrap-ruby#588) * Simplify Dockerfile and add documentation * A few more additions to .gitignore * Ignore gems placed when using Dockerfile (bootstrap-ruby#590) * Fix formatting and heredoc * Fix bad merge Co-authored-by: Uwe Kubosch <uwe@kubosch.no> Co-authored-by: Uwe Kubosch <donv@users.noreply.github.com> Co-authored-by: Thimo Jansen <thimo@defrog.nl>
1 parent e45152c commit 85382c3

13 files changed

+416
-442
lines changed

.github/workflows/ruby.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ name: Ruby
22

33
on:
44
push:
5+
branches: [ master ]
56
pull_request:
7+
branches: [ master ]
68

79
jobs:
810
Lint:
@@ -17,7 +19,6 @@ jobs:
1719
if: ${{ github.event_name == 'pull_request' }}
1820
run: |
1921
gem install danger
20-
export DANGER_GITHUB_API_TOKEN=${{ github.token }}
2122
danger
2223
- name: Rubocop
2324
run: bundle exec rubocop --auto-correct
@@ -26,14 +27,11 @@ jobs:
2627
strategy:
2728
fail-fast: false
2829
matrix:
29-
ruby-version: [ '3.1', '3.0', '2.7', '2.6' ]
30-
gemfile: [ '7.0', '6.1', '6.0', '5.2', 'edge' ]
30+
ruby-version: [ '3.0', '2.7', '2.6' ]
31+
gemfile: [ '6.1', '6.0', '5.2', 'edge' ]
3132
exclude:
32-
- { ruby-version: '3.1', gemfile: "6.0" }
33-
- { ruby-version: '3.1', gemfile: "5.2" }
3433
- { ruby-version: '3.0', gemfile: "5.2" }
3534
- { ruby-version: '2.6', gemfile: "edge" }
36-
- { ruby-version: '2.6', gemfile: "7.0" }
3735
env:
3836
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
3937
steps:

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525

2626
### Bugfixes
2727

28-
* Your contribution here!
28+
* [#586](https://github.com/bootstrap-ruby/bootstrap_form/pull/586): Fix Rails 6.1 tests on master - [@thimo](https://github.com/thimo).
29+
* [#587](https://github.com/bootstrap-ruby/bootstrap_form/pull/587): Replace `strip_heredoc` with `<<~` - [@thimo](https://github.com/thimo).
2930

3031
## [4.5.0][] (2020-04-29)
3132

CONTRIBUTING.md

+2-27
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ You may find the demo application useful for development and debugging.
6363
### 7. Done!
6464

6565
Somebody will shortly review your pull request and if everything is good, it will be
66-
merged into the main branch. Eventually the gem will be published with your changes.
66+
merged into the master branch. Eventually the gem will be published with your changes.
6767

6868
### Coding guidelines
6969

@@ -98,7 +98,7 @@ If you want to use a different Ruby version, or a smaller Linux distribution (al
9898
docker build --build-arg "RUBY_VERSION=2.7" --build-arg "DISTRO=slim-buster" --tag bootstrap_form .
9999
```
100100

101-
Then run the container you built with the shell, and create the bundle:
101+
Then run whichever container you built with the shell to create the bundle:
102102

103103
```bash
104104
docker run --volume "$PWD:/app" --user $UID:`grep ^$USERNAME /etc/passwd | cut -d: -f4` -it bootstrap_form /bin/bash
@@ -109,31 +109,6 @@ You can run tests in the container as normal, with `rake test`.
109109

110110
(Some of that command line is need for Linux hosts, to run the container as the current user.)
111111

112-
### The Demo App
113-
114-
There is a demo app in this repository. It shows some of the features of `bootstrap_form`, and provides a base on which to build ad-hoc testing, if you need it.
115-
116-
To run the demo app, set up the database and run the server:
117-
118-
```bash
119-
cd demo
120-
export BUNDLER_GEMFILE=../gemfiles/6.1.gemfile
121-
rails db:setup
122-
rails s -b 0.0.0.0
123-
```
124-
125-
To run the demo app in the Docker container:
126-
127-
```bash
128-
docker run --volume "$PWD:/app" --user $UID:`grep ^$USERNAME /etc/passwd | cut -d: -f4` -p 3000:3000 -it bootstrap_form /bin/bash
129-
cd demo
130-
export BUNDLER_GEMFILE=../gemfiles/6.1.gemfile
131-
rails db:setup
132-
rails s -b 0.0.0.0
133-
```
134-
135-
To use other supported versions of Rails, change the `export BUNDLER_GEMFILE...` line to another gem file.
136-
137112
## Documentation Contributions
138113

139114
Contributions to documentation are always welcome. Even fixing one typo improves the quality of `bootstrap_form`. To make a documentation contribution, follow steps 1-3 of Code Contributions, then make the documentation changes, then make the pull request (step 6 of Code Contributions).

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN (echo 'docker'; echo 'docker') | passwd root
1616
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
1717
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
1818
apt update -y -q && \
19-
apt install -y -q yarn sqlite3
19+
apt install -y -q yarn
2020

2121
# Ruby now comes with bundler, but we're not using the default version yet, because we were using
2222
# a newer version of bundler already. Ruby 3 comes with Bundler 2.2.3. Ruby 2.7 has Bundler 2.1.2,

0 commit comments

Comments
 (0)