Skip to content

Commit

Permalink
Fix release build job
Browse files Browse the repository at this point in the history
The CSS code for the `flipflop` web interface is generated
by the rake tast `assets:compile`, hence it should not
be commited to the repository at all, because its content
depends on the actual versions of gems activated at build time.
We therefore remove it and add it to `.gitignore`.

Furthermore, in #40 the stylesheet file was renamed from
`_flipflop.css` to `_flipflop.html.erb` which is problematic because

- the file is not HTML
- the file is not a template
- the filename in `rake assets:compile` was not adjusted,
  so the generated content is now ignored and instead
  the commited content is used.

We revert the renaming of the file and use `render(file: ...`
to insert its contents into the view, thereby fixing all issues.
  • Loading branch information
leoarnold committed Jul 1, 2022
1 parent 1029813 commit 9f2c407
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*.gem
.bundle
app/views/flipflop/stylesheets/_flipflop.css
Gemfile.lock
pkg/*
tmp/*

pkg/
tmp/
Empty file.
1 change: 0 additions & 1 deletion app/views/flipflop/stylesheets/_flipflop.html.erb

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/layouts/flipflop.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<title><%= yield :title -%></title>
<style><%= render partial: "flipflop/stylesheets/flipflop" %></style>
<style><%= render(file: File.expand_path("../flipflop/stylesheets/_flipflop.css", __dir__)) %></style>
</head>
<body><%= yield -%></body>
</html>

0 comments on commit 9f2c407

Please sign in to comment.