Skip to content

Commit

Permalink
1.0.8 release
Browse files Browse the repository at this point in the history
- Updated configs, et al. in pursuit of Rails 7.1 compatibility
- Added explicit coder for serialize commands
- Added ActiveRecord Adapter (database) info to admin footer
- Added commented defaults for MySQL and Postgres to database.yml
- Updated documentation
- Refactored lib files for better test coverage awareness
  • Loading branch information
avonderluft committed Dec 29, 2023
1 parent 0a9e0da commit d8f4363
Show file tree
Hide file tree
Showing 93 changed files with 903 additions and 435 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- "3.2"
rails-version:
- "7.0"
continue-on-error: [false]
continue-on-error: [true]
name: ${{ format('Coverage (Ruby {0}, Rails {1})', matrix.ruby-version, matrix.rails-version) }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.continue-on-error }}
Expand All @@ -23,16 +23,18 @@ jobs:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

steps:
- uses: actions/checkout@v2
- name: Checkout source
uses: actions/checkout@v2

- name: Install Ruby
- name: Install Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

- name: Set up Test DB
run: bin/rails db:migrate RAILS_ENV=test
- name: Run tests
run: bin/rake test

- name: Run tests, report coverage
run: |
bin/bundle install --retry 3 --quiet
bin/bundle exec rails db:drop
bin/bundle exec rails db:create
bin/bundle exec rails db:migrate
bin/bundle exec rails test:db
32 changes: 17 additions & 15 deletions .github/workflows/rubyonrails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,46 @@ on:
pull_request:

jobs:
test_lint_audit:
build_test_lint_audit:
strategy:
matrix:
ruby-version:
- "2.7"
- "3.1"
- "3.2"
- "3.3"
rails-version:
- "6.1"
- "7.0"
continue-on-error: [false]
continue-on-error: [true]
name: ${{ format('Tests (Ruby {0}, Rails {1})', matrix.ruby-version, matrix.rails-version) }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.continue-on-error }}
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.rails-version }}.gemfile
RAILS_ENV: test
SKIP_COV: true

steps:
- uses: actions/checkout@v2
- name: Checkout source
uses: actions/checkout@v2

- name: Install Ruby
- name: Install Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

- name: Set up Test DB
run: bin/rails db:migrate RAILS_ENV=test
- name: Run tests
run: bin/rake test
run: |
bin/bundle install --retry 3 --quiet
bin/bundle exec rails db:drop
bin/bundle exec rails db:create
bin/bundle exec rails db:migrate
bin/bundle exec rails test:db
- name: Ruby Lint
- name: Lint the code
run: bin/bundle exec rubocop --parallel

- name: Security audit application code
run: bin/bundle exec brakeman -q -w3

- name: Security audit dependencies
run: bin/bundle exec bundler-audit --update --gemfile-lock gemfiles/${{ matrix.rails-version }}.gemfile.lock
- name: Audit for security
run: |
bin/bundle exec brakeman -q -w3
bin/bundle exec bundler-audit --update --gemfile-lock gemfiles/${{ matrix.rails-version }}.gemfile.lock
34 changes: 18 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
.bundle
db/*.sqlite3
log/*.log
tmp/**/*
.DS_Store
db/schema.rb
db/development_structure.sql
db/test.sqlite3*
pkg
rdoc
/tmp
public/system/
Gemfile.lock
gemfiles/*.gemfile.lock
.rvmrc
.ruby-version
.idea
.ruby-gemset
.ruby-version
.rvmrc
.vscode
/.sass-cache
coverage/
/storage
/tmp
coverage/
db/*.sqlite3
db/cms_fixtures/test-site/
.idea
db/development_structure.sql
db/schema.rb
db/test.sqlite3*
Gemfile.lock
gemfiles/*.gemfile.lock
log/
pkg
public/system/
rdoc
tmp/**/*
vendor/bundle/
33 changes: 21 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
# Changelog

## v1.0.7.3 - 10/7/2023
## v1.0.8 - 29 December 2023

- Updated configs, et al. in pursuit of Rails 7.1 compatibility
- Added explicit coder for serialize commands
- Added ActiveRecord Adapter (database) info to admin footer
- Added commented defaults for MySQL and Postgres to database.yml
- Updated documentation
- Refactored lib files for better test coverage awareness

## v1.0.7.3 - 7 October 2023

- Fixed edge case with siblings tag when current page is excluded
- Git ignore all sqlite* files for testing
- Small testing refinements
- Prep for Rails 7.1 compatibility

## v1.0.7.2 - 9/27/2023
## v1.0.7.2 - 27 September 2023

- Pulled will_paginate option out in favor of Kaminari
- Switched CI from Buildkite to [Github actions](https://github.com/avonderluft/occams/actions/workflows/rubyonrails.yml)
- Improved test coverage to 99+
- Removed backward compatibility to Rails prior to 6.x

## v1.0.7.1 - 9/22/2023
## v1.0.7.1 - 22 September 2023

- Addressed deprecations for file type 'image/jpg'
- Added github workflow for tests, lints and audits
- Fixed some flagged security warnings
- Bumped rubocop version to latest
- Updated some testing parameters

## v1.0.7 - 9/12/2023
## v1.0.7 - 12 September 2023

- Updated coveralls Coverage reporting
- Added minitest-reporters for test output
Expand All @@ -31,48 +40,48 @@
- Lints and 1 typo
- Added Build Status and Coveralls Coverage Status to README

## v1.0.6.1 - 9/5/2023
## v1.0.6.1 - 5 September 2023

- Fixed siblings and children nav tags which as written had problems creating child pages in the admin panel

## v1.0.6 - 9/5/2023
## v1.0.6 - 5 September 2023

- Fixed [cms:siblings Nav tag](https://github.com/avonderluft/occams/wiki/Content-Tags#siblings) to handle edge case when page(s) are excluded by the `exclude` parameter
- Added [cms:children Nav tag](https://github.com/avonderluft/occams/wiki/Content-Tags#children) to render unordered list of links for children of current page

## v1.0.5 - 8/31/2023
## v1.0.5 - 31 August 2023

- All tests now green on Rails 6.1 and 7.0, each tested with rubies 2.7.8, 3.1.4 and 3.2.2.
- Tests added for new tags
- TODO: set up CI pipeline

## v1.0.4 - 8/26/2023
## v1.0.4 - 26 August 2023

- Added [cms:breadcrumbs Nav tag](https://github.com/avonderluft/occams/wiki/Content-Tags#breadcrumbs)
- Added [cms:siblings Nav tag](https://github.com/avonderluft/occams/wiki/Content-Tags#siblings)
- Updated [wiki documentation](https://github.com/avonderluft/occams/wiki)

## v1.0.3 - 8/15/2023
## v1.0.3 - 15 August 2023

- Added a [cms:audio tag](https://github.com/avonderluft/occams/wiki/Content-Tags#audio) for an embedded audio player
- Some formatting of admin menu footer

## v1.0.2 - 8/14/2023
## v1.0.2 - 14 August 2023

- Fixed image rendering which rubocop broke in v1.0.1
- Show unpublished pages in Rails development mode
- Show Rails ENV at foot of Admin menu, along with versions of Occams, Rails and Ruby
- Updated documentation at [Occams Wiki](https://github.com/avonderluft/occams/wiki)
- Comprehensive rubocop linting

## v1.0.1 - 8/7/2023
## v1.0.1 - 7 August 2023

- Fixed image thumbnail hover for Rails 7
- Added display of Rails and Ruby versions along with Occams version at foot of Admin menu
- Refined gemspec dependencies
- Tweaked with a bunch of rubocop linting

## v1.0.0 - 8/5/2023
## v1.0.0 - 5 August 2023

- Copied the original [ComfortableMexicanSofa](https://github.com/comfy/comfortable-mexican-sofa)
- Added the changes from [Restarone's fork](https://github.com/restarone/comfortable-mexican-sofa) (23 commits)
Expand Down
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ Fork the project. Optionally, create a branch you want to work on.
- Tests please, but nothing complicated. UnitTest / Fixtures all the way. Make sure all tests pass.
- Run `bundle exec rubocop` and fix any issues raised.

### 4. Make a pull request
### 4. Create a pull request

- If you never done it before read this: https://help.github.com/articles/using-pull-requests
- When PR is submitted check if TravisCI ran all tests successfully and Rubocop didn't raise any issues
- When PR is submitted check if [Github Actions](https://github.com/avonderluft/occams/actions) ran all tests successfully and Rubocop didn't raise any issues

### 5. Done!

If everything is good your changes will be merged into master branch. Eventually
a new version of gem will be published.
If everything looks good, we will review your changes to be merged into the main branch, and publish a new version of the gem.
10 changes: 6 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ gem 'rails', '~> 7.0.0'
group :development, :test do
gem 'autoprefixer-rails', '~> 8.1.0'
gem 'byebug', '~> 10.0.0', platforms: %i[mri mingw x64_mingw]
gem 'capybara', '~> 3.39.0'
gem 'image_processing', '>= 1.2'
gem 'kaminari', '~> 1.2', '>= 1.2.2'
gem 'selenium-webdriver', '~> 4.9.0'
gem 'sqlite3', '~> 1.4.2'
gem 'sqlite3', '~> 1.6.7'
# gem 'mysql2', '~> 0.5'
# gem 'pg', '~> 1.5.4'
end

group :development do
Expand All @@ -25,12 +24,15 @@ end
group :test do
gem 'brakeman', '~> 5.4.1'
gem 'bundler-audit', '~> 0.9.1'
gem 'capybara', '~> 3.39.0'
gem 'coveralls_reborn', '~> 0.28.0', require: false
gem 'cuprite', '~> 0.14.3'
gem 'diffy', '~> 3.4.2'
gem 'equivalent-xml', '~> 0.6.0'
gem 'minitest', '~> 5.20.0'
gem 'minitest-reporters', '~> 1.6.1'
gem 'mocha', '~> 2.1.0', require: false
gem 'puma', '~> 6.4.0'
gem 'rails-controller-testing', '~> 1.0.5'
gem 'rubocop', '~> 1.56.0', require: false
gem 'simplecov', '~> 0.22.0', require: false
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ ocCaM'S, pronounced "AH-kums" is a nod to [Occam's Razor](https://en.wikipedia.o

## Compatibility

- [Test suite](https://github.com/avonderluft/occams/actions/workflows/rubyonrails.yml) on Ruby 2.7, 3.1 and 3.2 with Rails 6.1 and 7.0+
- On Ruby 3.2, Rails 7+ is recommended, since performance is noticably better than 6
- [Test suite](https://github.com/avonderluft/occams/actions/workflows/rubyonrails.yml) on Ruby >= 2.7 with Rails >= 6.1
- On Ruby 3.2, Rails 7.x + is recommended, since performance is noticably better than on 6.x
- Sites do run on Rails 7.1, e.g. [GKNT](https://gknt.org/), but some tests fail in [Github Actions](https://github.com/avonderluft/occams/actions). Your mileage may vary.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/occams/cms/with_fragments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def fragments_attributes_was
# duplicate tags on the layout. That's wierd (but still works).
def fragment_nodes
nodes
.select { |n| n.is_a?(Occams::Content::Tag::Fragment) }
.select { |n| n.is_a?(Occams::Content::Tags::Fragment) }
.uniq(&:identifier)
end

Expand Down
2 changes: 1 addition & 1 deletion app/models/occams/cms/fragment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Occams::Cms::Fragment < ActiveRecord::Base

has_many_attached :attachments

serialize :content
serialize :content, coder: Psych

attr_reader :files

Expand Down
4 changes: 3 additions & 1 deletion app/models/occams/cms/layout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
class Occams::Cms::Layout < ActiveRecord::Base
self.table_name = 'occams_cms_layouts'

require_relative '../../../../lib/occams/extensions/acts_as_tree'

cms_acts_as_tree
cms_has_revisions_for :content, :css, :js

Expand Down Expand Up @@ -67,7 +69,7 @@ def content_tokens
tokens = renderer.tokenize(content)

if parent
fragment_tags = Occams::Content::Tag::Fragment.subclasses.map do |c|
fragment_tags = Occams::Content::Tags::Fragment.subclasses.map do |c|
Occams::Content::Renderer.tags.key(c)
end

Expand Down
2 changes: 1 addition & 1 deletion app/models/occams/cms/revision.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class Occams::Cms::Revision < ActiveRecord::Base
self.table_name = 'occams_cms_revisions'

serialize :data
serialize :data, coder: Psych

# -- Relationships --------------------------------------------------------
belongs_to :record, polymorphic: true
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/occams/admin/cms/_left.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@
= link_to 'Ruby', 'https://www.ruby-lang.org', target: '_blank'
%span.version= RUBY_VERSION
%br
= Rails.env.upcase
= Rails.env.upcase + ' - ' + ActiveRecord::Base.connection.adapter_name

6 changes: 3 additions & 3 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'
APP_PATH = File.expand_path("../config/application", __dir__)
require_relative "../config/boot"
require "rails/commands"
4 changes: 2 additions & 2 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
require_relative '../config/boot'
require 'rake'
require_relative "../config/boot"
require "rake"
Rake.application.run

0 comments on commit d8f4363

Please sign in to comment.