occams 1.0.7 → 1.0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/coveralls.yml +38 -0
- data/.github/workflows/rubyonrails.yml +49 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +1 -0
- data/CHANGELOG.md +21 -6
- data/Gemfile +11 -4
- data/README.md +13 -15
- data/app/controllers/concerns/occams/paginate.rb +3 -8
- data/app/controllers/occams/admin/cms/revisions/base_controller.rb +1 -1
- data/app/controllers/occams/cms/content_controller.rb +3 -3
- data/app/helpers/occams/cms_helper.rb +3 -6
- data/app/models/occams/cms/file.rb +2 -7
- data/app/models/occams/cms/fragment.rb +2 -6
- data/gemfiles/6.1.gemfile +35 -0
- data/gemfiles/7.0.gemfile +35 -0
- data/lib/occams/content/tags/children.rb +1 -1
- data/lib/occams/seeds/file/exporter.rb +2 -6
- data/lib/occams/seeds/file/importer.rb +2 -4
- data/lib/occams/seeds/layout/importer.rb +2 -4
- data/lib/occams/seeds/page/importer.rb +1 -2
- data/lib/occams/seeds/snippet/importer.rb +2 -4
- data/lib/occams/version.rb +1 -1
- data/occams.gemspec +26 -26
- metadata +28 -5
- data/.travis.yml +0 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9fce10bdb602179a806185f8069a8121d8405e4e9e04839e433096572207342
|
4
|
+
data.tar.gz: 96efa1be357c97aa6659ff74cd865a9c4e7732880c0817469e6cee0da1bcb745
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d681988915ae056de2c763f86927cdd2c51cc2ca121f0b291e59c8a4fe2fa069a5b21cb9e7f5f3719605475da2425165497f2b702242ba9b71043c5dff99b8b5
|
7
|
+
data.tar.gz: 4bc6d9ac47bd585a3f966e5308d066a423c1eb57e80535f5d2df0eda335273324d5ebf13066d32dd7ea12c027bdaa347b9fc02aea7363229f8849f4efd6c9973
|
@@ -0,0 +1,38 @@
|
|
1
|
+
name: "Coveralls"
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches:
|
5
|
+
- main
|
6
|
+
pull_request:
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
coveralls:
|
10
|
+
strategy:
|
11
|
+
matrix:
|
12
|
+
ruby-version:
|
13
|
+
- "3.2"
|
14
|
+
rails-version:
|
15
|
+
- "7.0"
|
16
|
+
continue-on-error: [false]
|
17
|
+
name: ${{ format('Coverage (Ruby {0}, Rails {1})', matrix.ruby-version, matrix.rails-version) }}
|
18
|
+
runs-on: ubuntu-latest
|
19
|
+
continue-on-error: ${{ matrix.continue-on-error }}
|
20
|
+
env:
|
21
|
+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.rails-version }}.gemfile
|
22
|
+
RAILS_ENV: test
|
23
|
+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
24
|
+
|
25
|
+
steps:
|
26
|
+
- uses: actions/checkout@v2
|
27
|
+
|
28
|
+
- name: Install Ruby
|
29
|
+
uses: ruby/setup-ruby@v1
|
30
|
+
with:
|
31
|
+
ruby-version: ${{ matrix.ruby-version }}
|
32
|
+
bundler-cache: true
|
33
|
+
|
34
|
+
- name: Set up Test DB
|
35
|
+
run: bin/rails db:migrate RAILS_ENV=test
|
36
|
+
- name: Run tests
|
37
|
+
run: bin/rake test
|
38
|
+
|
@@ -0,0 +1,49 @@
|
|
1
|
+
name: "Rails CI"
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches:
|
5
|
+
- main
|
6
|
+
pull_request:
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
test_lint_audit:
|
10
|
+
strategy:
|
11
|
+
matrix:
|
12
|
+
ruby-version:
|
13
|
+
- "2.7"
|
14
|
+
- "3.1"
|
15
|
+
- "3.2"
|
16
|
+
rails-version:
|
17
|
+
- "6.1"
|
18
|
+
- "7.0"
|
19
|
+
continue-on-error: [false]
|
20
|
+
name: ${{ format('Tests (Ruby {0}, Rails {1})', matrix.ruby-version, matrix.rails-version) }}
|
21
|
+
runs-on: ubuntu-latest
|
22
|
+
continue-on-error: ${{ matrix.continue-on-error }}
|
23
|
+
env:
|
24
|
+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.rails-version }}.gemfile
|
25
|
+
RAILS_ENV: test
|
26
|
+
SKIP_COV: true
|
27
|
+
|
28
|
+
steps:
|
29
|
+
- uses: actions/checkout@v2
|
30
|
+
|
31
|
+
- name: Install Ruby
|
32
|
+
uses: ruby/setup-ruby@v1
|
33
|
+
with:
|
34
|
+
ruby-version: ${{ matrix.ruby-version }}
|
35
|
+
bundler-cache: true
|
36
|
+
|
37
|
+
- name: Set up Test DB
|
38
|
+
run: bin/rails db:migrate RAILS_ENV=test
|
39
|
+
- name: Run tests
|
40
|
+
run: bin/rake test
|
41
|
+
|
42
|
+
- name: Ruby Lint
|
43
|
+
run: bin/bundle exec rubocop --parallel
|
44
|
+
|
45
|
+
- name: Security audit application code
|
46
|
+
run: bin/bundle exec brakeman -q -w3
|
47
|
+
|
48
|
+
- name: Security audit dependencies
|
49
|
+
run: bin/bundle exec bundler-audit --update --gemfile-lock gemfiles/${{ matrix.rails-version }}.gemfile.lock
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,13 +1,28 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v1.0.7.2 - 9/27/2023
|
4
|
+
|
5
|
+
- Pulled will_paginate option out in favor of Kaminari
|
6
|
+
- Switched CI from Buildkite to [Github actions](https://github.com/avonderluft/occams/actions/workflows/rubyonrails.yml)
|
7
|
+
- Improved test coverage to 99+
|
8
|
+
- Removed backward compatibility to Rails prior to 6.x
|
9
|
+
|
10
|
+
## v1.0.7.1 - 9/22/2023
|
11
|
+
|
12
|
+
- Addressed deprecations for file type 'image/jpg'
|
13
|
+
- Added github workflow for tests, lints and audits
|
14
|
+
- Fixed some flagged security warnings
|
15
|
+
- Bumped rubocop version to latest
|
16
|
+
- Updated some testing parameters
|
17
|
+
|
3
18
|
## v1.0.7 - 9/12/2023
|
4
19
|
|
5
|
-
-
|
6
|
-
-
|
7
|
-
-
|
8
|
-
-
|
9
|
-
-
|
10
|
-
-
|
20
|
+
- Updated coveralls Coverage reporting
|
21
|
+
- Added minitest-reporters for test output
|
22
|
+
- Adjusted tests to accomodate varying macos and linux outputs
|
23
|
+
- Refined test for 'children' tag
|
24
|
+
- Lints and 1 typo
|
25
|
+
- Added Build Status and Coveralls Coverage Status to README
|
11
26
|
|
12
27
|
## v1.0.6.1 - 9/5/2023
|
13
28
|
|
data/Gemfile
CHANGED
@@ -1,16 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
source '
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
4
5
|
|
5
6
|
gemspec
|
6
7
|
|
8
|
+
gem 'rails', '~> 7.0'
|
9
|
+
|
7
10
|
group :development, :test do
|
8
11
|
gem 'autoprefixer-rails', '~> 8.1.0'
|
9
12
|
gem 'byebug', '~> 10.0.0', platforms: %i[mri mingw x64_mingw]
|
10
13
|
gem 'capybara', '~> 3.39.0'
|
11
14
|
gem 'image_processing', '>= 1.2'
|
12
15
|
gem 'kaminari', '~> 1.2', '>= 1.2.2'
|
13
|
-
gem 'rubocop', '~> 0.55.0', require: false
|
14
16
|
gem 'selenium-webdriver', '~> 4.9.0'
|
15
17
|
gem 'sqlite3', '~> 1.4.2'
|
16
18
|
end
|
@@ -21,10 +23,15 @@ group :development do
|
|
21
23
|
end
|
22
24
|
|
23
25
|
group :test do
|
24
|
-
gem '
|
26
|
+
gem 'brakeman', '~> 5.4.1'
|
27
|
+
gem 'bundler-audit', '~> 0.9.1'
|
28
|
+
gem 'coveralls_reborn', '~> 0.28.0', require: false
|
25
29
|
gem 'diffy', '~> 3.4.2'
|
26
30
|
gem 'equivalent-xml', '~> 0.6.0'
|
27
|
-
gem 'minitest
|
31
|
+
gem 'minitest', '~> 5.20.0'
|
32
|
+
gem 'minitest-reporters', '~> 1.6.1'
|
28
33
|
gem 'mocha', '~> 2.1.0', require: false
|
29
34
|
gem 'rails-controller-testing', '~> 1.0.5'
|
35
|
+
gem 'rubocop', '~> 1.56.0', require: false
|
36
|
+
gem 'simplecov', '~> 0.22.0', require: false
|
30
37
|
end
|
data/README.md
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
# ocCaM'S
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![Rails CI](https://github.com/avonderluft/occams/actions/workflows/rubyonrails.yml/badge.svg?branch=main)](https://github.com/avonderluft/occams/actions/workflows/rubyonrails.yml)
|
4
4
|
[![Coverage Status](https://coveralls.io/repos/github/avonderluft/occams/badge.svg?branch=main)](https://coveralls.io/github/avonderluft/occams?branch=main)
|
5
5
|
[![Gem Version](https://img.shields.io/gem/v/occams.svg?style=flat)](http://rubygems.org/gems/occams)
|
6
6
|
[![Gem Downloads](https://img.shields.io/gem/dt/occams.svg?style=flat)](http://rubygems.org/gems/occams)
|
7
|
+
[![GitHub Release Date - Published_At](https://img.shields.io/github/release-date/avonderluft/occams)](https://github.com/avonderluft/occams/releases)
|
7
8
|
|
8
9
|
***Prefer Simplicity.***
|
9
10
|
|
@@ -22,13 +23,11 @@
|
|
22
23
|
|
23
24
|
## Raison d'etre
|
24
25
|
|
25
|
-
ocCaM'S is a revival of [ComfortableMexicanSofa](https://github.com/comfy/comfortable-mexican-sofa), with all due thanks and acknowledgements to [Oleg Khabarov](https://github.com/GBH),
|
26
|
+
ocCaM'S is a revival of [ComfortableMexicanSofa](https://github.com/comfy/comfortable-mexican-sofa), with all due thanks and acknowledgements to [Oleg Khabarov](https://github.com/GBH), and others. 'Comfy' is in my experience the simplest and cleanest of all Rails-based CMSes. Seeing that its last commit was in 2020, I was determined that it should not die on the vine as [RadiantCMS](https://github.com/radiant/radiant) did some years ago.
|
26
27
|
|
27
28
|
## The name
|
28
29
|
|
29
|
-
ocCaM'S, pronounced "AH-kums" is a nod to [Occam's Razor](https://en.wikipedia.org/wiki/Occam%27s_razor) - for this Rails-based Content Management System endeavors to follow the principle that unnecessarily complex models should not be preferred
|
30
|
-
|
31
|
-
|
30
|
+
ocCaM'S, pronounced "AH-kums" is a nod to [Occam's Razor](https://en.wikipedia.org/wiki/Occam%27s_razor) - for this Rails-based Content Management System endeavors to follow the principle that unnecessarily complex models should not be preferred over simpler ones.
|
32
31
|
|
33
32
|
## Features
|
34
33
|
|
@@ -44,13 +43,12 @@ ocCaM'S, pronounced "AH-kums" is a nod to [Occam's Razor](https://en.wikipedia.o
|
|
44
43
|
## Dependencies
|
45
44
|
|
46
45
|
* File attachments are handled by [ActiveStorage](https://github.com/rails/rails/tree/master/activestorage). Make sure that you can run appropriate migrations by running: `rails active_storage:install` and then `rake db:migrate`
|
47
|
-
* Image resizing is done with[ImageMagick](http://www.imagemagick.org/script/download.php), so make sure it's installed
|
48
|
-
* Pagination is handled by [kaminari](https://github.com/amatsuda/kaminari) or [will_paginate](https://github.com/mislav/will_paginate). Please add one of those to your Gemfile.
|
46
|
+
* Image resizing is done with [ImageMagick](http://www.imagemagick.org/script/download.php), so make sure it's installed
|
49
47
|
|
50
48
|
## Compatibility
|
51
49
|
|
52
|
-
- Test suite
|
53
|
-
- Rails 7+ is recommended, since performance is noticably better than 6
|
50
|
+
- [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+
|
51
|
+
- On Ruby 3.2, Rails 7+ is recommended, since performance is noticably better than 6
|
54
52
|
|
55
53
|
## Installation
|
56
54
|
|
@@ -60,15 +58,15 @@ Add gem definition to your Gemfile:
|
|
60
58
|
gem "occams"
|
61
59
|
```
|
62
60
|
|
63
|
-
* From the Rails project's root run:
|
61
|
+
* From the Rails project's root run:
|
64
62
|
`bundle install`
|
65
|
-
* Then add the CMS:
|
63
|
+
* Then add the CMS:
|
66
64
|
`rails generate occams:cms`
|
67
|
-
* If you want to store files in your CMS with Active Storage:
|
65
|
+
* If you want to store files in your CMS with Active Storage:
|
68
66
|
`rails active_storage:install`
|
69
|
-
* Set up the database:
|
67
|
+
* Set up the database:
|
70
68
|
`rails db:migrate`
|
71
|
-
|
69
|
+
|
72
70
|
Now take a look inside your `config/routes.rb` file. You'll see where routes attach for the admin area and content serving. Make sure that content serving route appears as a very last item or it will make all other routes to be inaccessible.
|
73
71
|
|
74
72
|
```ruby
|
@@ -121,5 +119,5 @@ For more detail see [CONTRIBUTING](CONTRIBUTING.md)
|
|
121
119
|
- Thanks to [Roman Almeida](https://github.com/nasmorn) for contributing OEM License for [Redactor Text Editor](http://imperavi.com/redactor)
|
122
120
|
|
123
121
|
---
|
122
|
+
- [Occams](https://github.com/avonderluft/occams) Copyright 2023 Andrew vonderLuft, following Comfy, released under the [MIT license](LICENSE)
|
124
123
|
- [ComfortableMexicanSofa](https://github.com/comfy/comfortable-mexican-sofa) Copyright 2010-2019 Oleg Khabarov. Released under the [MIT license](LICENSE)
|
125
|
-
- [Occams](https://github.com/avonderluft/occams) Copyright 2023 Andrew vonderLuft, following suit, also released under the [MIT license](LICENSE)
|
@@ -1,14 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Occams::Paginate
|
4
|
-
# Wrapper to deal with WillPaginate vs Kaminari nonsense
|
5
4
|
def occams_paginate(scope, per_page: 50)
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
scope.page(params[:page]).per(per_page)
|
10
|
-
else
|
11
|
-
scope
|
12
|
-
end
|
5
|
+
return unless defined?(Kaminari)
|
6
|
+
|
7
|
+
scope.page(params[:page]).per(per_page)
|
13
8
|
end
|
14
9
|
end
|
@@ -74,10 +74,10 @@ protected
|
|
74
74
|
# Getting page and setting content_cache and fragments data if we need to
|
75
75
|
# serve translation data
|
76
76
|
def find_cms_page_by_full_path(full_path)
|
77
|
-
@cms_page = if Rails.env == '
|
78
|
-
@cms_site.pages.published.find_by!(full_path: full_path)
|
79
|
-
else
|
77
|
+
@cms_page = if Rails.env == 'development'
|
80
78
|
@cms_site.pages.find_by!(full_path: full_path)
|
79
|
+
else
|
80
|
+
@cms_site.pages.published.find_by!(full_path: full_path)
|
81
81
|
end
|
82
82
|
|
83
83
|
@cms_page.translate!
|
@@ -62,15 +62,12 @@ module Occams
|
|
62
62
|
Occams::Cms::Site.find_site(host, path)
|
63
63
|
end
|
64
64
|
|
65
|
-
# Wrapper to deal with Kaminari vs WillPaginate
|
66
65
|
def occams_paginate(collection)
|
67
66
|
return unless collection
|
68
67
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
paginate collection, theme: 'occams'
|
73
|
-
end
|
68
|
+
return unless defined?(Kaminari)
|
69
|
+
|
70
|
+
paginate collection, theme: 'occams'
|
74
71
|
end
|
75
72
|
end
|
76
73
|
end
|
@@ -22,13 +22,8 @@ class Occams::Cms::File < ActiveRecord::Base
|
|
22
22
|
# -- Callbacks ---------------------------------------------------------------
|
23
23
|
before_validation :assign_label, on: :create
|
24
24
|
before_create :assign_position
|
25
|
-
# active_storage attachment behavior changed in rails 6
|
26
|
-
|
27
|
-
before_save :process_attachment
|
28
|
-
else
|
29
|
-
after_save :process_attachment
|
30
|
-
end
|
31
|
-
|
25
|
+
# active_storage attachment behavior changed in rails 6
|
26
|
+
before_save :process_attachment
|
32
27
|
after_save :clear_page_content_cache
|
33
28
|
|
34
29
|
# -- Validations -------------------------------------------------------------
|
@@ -10,12 +10,8 @@ class Occams::Cms::Fragment < ActiveRecord::Base
|
|
10
10
|
attr_reader :files
|
11
11
|
|
12
12
|
# -- Callbacks ---------------------------------------------------------------
|
13
|
-
# active_storage attachment behavior changed in rails 6
|
14
|
-
|
15
|
-
before_save :remove_attachments, :add_attachments
|
16
|
-
else
|
17
|
-
after_save :remove_attachments, :add_attachments
|
18
|
-
end
|
13
|
+
# active_storage attachment behavior changed in rails 6
|
14
|
+
before_save :remove_attachments, :add_attachments
|
19
15
|
|
20
16
|
# -- Relationships -----------------------------------------------------------
|
21
17
|
belongs_to :record, polymorphic: true, touch: true
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
5
|
+
|
6
|
+
gemspec path: '../'
|
7
|
+
|
8
|
+
gem 'rails', '~> 6.1'
|
9
|
+
|
10
|
+
group :development, :test do
|
11
|
+
gem 'autoprefixer-rails', '~> 8.1.0'
|
12
|
+
gem 'byebug', '~> 10.0.0', platforms: %i[mri mingw x64_mingw]
|
13
|
+
gem 'capybara', '~> 3.39.0'
|
14
|
+
gem 'image_processing', '>= 1.2'
|
15
|
+
gem 'kaminari', '~> 1.2', '>= 1.2.2'
|
16
|
+
gem 'selenium-webdriver', '~> 4.9.0'
|
17
|
+
gem 'sqlite3', '~> 1.4.2'
|
18
|
+
end
|
19
|
+
|
20
|
+
group :development do
|
21
|
+
gem 'listen', '~> 3.8.0'
|
22
|
+
gem 'web-console', '~> 4.2'
|
23
|
+
end
|
24
|
+
|
25
|
+
group :test do
|
26
|
+
gem 'brakeman', '~> 5.4.1'
|
27
|
+
gem 'bundler-audit', '~> 0.9.1'
|
28
|
+
gem 'coveralls_reborn', '~> 0.28.0', require: false
|
29
|
+
gem 'diffy', '~> 3.4.2'
|
30
|
+
gem 'equivalent-xml', '~> 0.6.0'
|
31
|
+
gem 'minitest-reporters', '~> 1.6.1'
|
32
|
+
gem 'mocha', '~> 2.1.0', require: false
|
33
|
+
gem 'rails-controller-testing', '~> 1.0.5'
|
34
|
+
gem 'rubocop', '~> 1.56.0', require: false
|
35
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
5
|
+
|
6
|
+
gemspec path: '../'
|
7
|
+
|
8
|
+
gem 'rails', '~> 7.0'
|
9
|
+
|
10
|
+
group :development, :test do
|
11
|
+
gem 'autoprefixer-rails', '~> 8.1.0'
|
12
|
+
gem 'byebug', '~> 10.0.0', platforms: %i[mri mingw x64_mingw]
|
13
|
+
gem 'capybara', '~> 3.39.0'
|
14
|
+
gem 'image_processing', '>= 1.2'
|
15
|
+
gem 'kaminari', '~> 1.2', '>= 1.2.2'
|
16
|
+
gem 'selenium-webdriver', '~> 4.9.0'
|
17
|
+
gem 'sqlite3', '~> 1.4.2'
|
18
|
+
end
|
19
|
+
|
20
|
+
group :development do
|
21
|
+
gem 'listen', '~> 3.8.0'
|
22
|
+
gem 'web-console', '~> 4.2'
|
23
|
+
end
|
24
|
+
|
25
|
+
group :test do
|
26
|
+
gem 'brakeman', '~> 5.4.1'
|
27
|
+
gem 'bundler-audit', '~> 0.9.1'
|
28
|
+
gem 'coveralls_reborn', '~> 0.28.0', require: false
|
29
|
+
gem 'diffy', '~> 3.4.2'
|
30
|
+
gem 'equivalent-xml', '~> 0.6.0'
|
31
|
+
gem 'minitest-reporters', '~> 1.6.1'
|
32
|
+
gem 'mocha', '~> 2.1.0', require: false
|
33
|
+
gem 'rails-controller-testing', '~> 1.0.5'
|
34
|
+
gem 'rubocop', '~> 1.56.0', require: false
|
35
|
+
end
|
@@ -29,7 +29,7 @@ class Occams::Content::Tag::Children < Occams::Content::Tag
|
|
29
29
|
@list = ''
|
30
30
|
# ActiveRecord_Associations_CollectionProxy
|
31
31
|
@page_children = context.children.order(:position).to_ary
|
32
|
-
|
32
|
+
unless Rails.env == 'development'
|
33
33
|
@page_children.delete_if { |child| !child.is_published }
|
34
34
|
end
|
35
35
|
@page_children.delete_if { |child| @exclude.include? child.slug }
|
@@ -23,14 +23,10 @@ module Occams::Seeds::File
|
|
23
23
|
# writing content
|
24
24
|
begin
|
25
25
|
::File.binwrite(::File.join(path, ::File.basename(file_path)), file.attachment.download)
|
26
|
+
Occams.logger.info("[CMS SEEDS] Exported File \t #{file.attachment.filename}")
|
26
27
|
rescue Errno::ENOENT, OpenURI::HTTPError
|
27
|
-
|
28
|
-
Occams.logger.warn(message)
|
29
|
-
next
|
28
|
+
Occams.logger.warn("[CMS SEEDS] No physical File \t #{file.attachment.filename}")
|
30
29
|
end
|
31
|
-
|
32
|
-
message = "[CMS SEEDS] Exported File \t #{file.attachment.filename}"
|
33
|
-
Occams.logger.info(message)
|
34
30
|
end
|
35
31
|
end
|
36
32
|
end
|
@@ -41,11 +41,9 @@ module Occams::Seeds::File
|
|
41
41
|
|
42
42
|
if fresh_file
|
43
43
|
if file.save
|
44
|
-
|
45
|
-
Occams.logger.info(message)
|
44
|
+
Occams.logger.info("[CMS SEEDS] Imported File \t #{file_path}")
|
46
45
|
else
|
47
|
-
|
48
|
-
Occams.logger.warn(message)
|
46
|
+
Occams.logger.warn("[CMS SEEDS] Failed to import File \n#{file.errors.inspect}")
|
49
47
|
end
|
50
48
|
end
|
51
49
|
|
@@ -41,11 +41,9 @@ module Occams::Seeds::Layout
|
|
41
41
|
)
|
42
42
|
|
43
43
|
if layout.save
|
44
|
-
|
45
|
-
Occams.logger.info(message)
|
44
|
+
Occams.logger.info("[CMS SEEDS] Imported Layout \t #{layout.identifier}")
|
46
45
|
else
|
47
|
-
|
48
|
-
Occams.logger.warn(message)
|
46
|
+
Occams.logger.warn("[CMS SEEDS] Failed to import Layout \n#{layout.errors.inspect}")
|
49
47
|
end
|
50
48
|
end
|
51
49
|
|
@@ -79,8 +79,7 @@ module Occams::Seeds::Page
|
|
79
79
|
page.fragments.where(identifier: old_frag_identifiers - new_frag_identifiers).destroy_all
|
80
80
|
|
81
81
|
else
|
82
|
-
|
83
|
-
Occams.logger.warn(message)
|
82
|
+
Occams.logger.warn("[CMS SEEDS] Failed to import Page \n#{page.errors.inspect}")
|
84
83
|
end
|
85
84
|
end
|
86
85
|
|
@@ -29,11 +29,9 @@ module Occams::Seeds::Snippet
|
|
29
29
|
)
|
30
30
|
|
31
31
|
if snippet.save
|
32
|
-
|
33
|
-
Occams.logger.info(message)
|
32
|
+
Occams.logger.info("[CMS SEEDS] Imported Snippet \t #{snippet.identifier}")
|
34
33
|
else
|
35
|
-
|
36
|
-
Occams.logger.warn(message)
|
34
|
+
Occams.logger.warn("[CMS SEEDS] Failed to import Snippet \n#{snippet.errors.inspect}")
|
37
35
|
end
|
38
36
|
end
|
39
37
|
|
data/lib/occams/version.rb
CHANGED
data/occams.gemspec
CHANGED
@@ -1,35 +1,35 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
require 'occams/version'
|
3
|
+
require_relative 'lib/occams/version'
|
5
4
|
|
6
|
-
Gem::Specification.new do |
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'occams'
|
7
|
+
spec.version = Occams::VERSION
|
8
|
+
spec.authors = ['Andrew vonderLuft']
|
9
|
+
spec.email = ['wonder@hey.com']
|
10
|
+
spec.homepage = 'http://github.com/avonderluft/occams'
|
11
|
+
spec.summary = 'Rails 6-7+ CMS Engine'
|
12
|
+
spec.description = 'Occams is a powerful Rails 6-7+ CMS Engine'
|
13
|
+
spec.license = 'MIT'
|
15
14
|
|
16
|
-
|
15
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
17
16
|
f.match(%r{^(test|doc)/})
|
18
17
|
end
|
19
18
|
|
20
|
-
|
21
|
-
|
19
|
+
spec.required_ruby_version = '>= 2.7.0'
|
20
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
22
21
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
22
|
+
spec.add_dependency 'active_link_to', '~> 1.0', '>= 1.0.5'
|
23
|
+
spec.add_dependency 'comfy_bootstrap_form', '~> 4.0', '>= 4.0.0'
|
24
|
+
spec.add_dependency 'haml-rails', '~> 2.1', '>= 2.1.0'
|
25
|
+
spec.add_dependency 'image_processing', '~> 1.2', '>= 1.12.2'
|
26
|
+
spec.add_dependency 'jquery-rails', '~> 4.6', '>= 4.6.0'
|
27
|
+
spec.add_dependency 'kaminari', '~> 1.2', '>= 1.2.2'
|
28
|
+
spec.add_dependency 'kramdown', '~> 2.4', '>= 2.4.0'
|
29
|
+
spec.add_dependency 'mimemagic', '~> 0.4', '>= 0.4.3'
|
30
|
+
spec.add_dependency 'mini_magick', '~> 4.12', '>= 4.12.0'
|
31
|
+
spec.add_dependency 'rails', '>= 6.1.0'
|
32
|
+
spec.add_dependency 'rails-i18n', '>= 6.0.0'
|
33
|
+
spec.add_dependency 'sassc-rails', '~> 2.1', '>= 2.1.2'
|
34
|
+
spec.add_dependency 'sprockets-rails', '~> 3.4', '>= 3.4.2'
|
35
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: occams
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.7
|
4
|
+
version: 1.0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew vonderLuft
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_link_to
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
requirements:
|
77
77
|
- - "~>"
|
78
78
|
- !ruby/object:Gem::Version
|
79
|
-
version: '1.
|
79
|
+
version: '1.2'
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 1.12.2
|
@@ -86,7 +86,7 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '1.
|
89
|
+
version: '1.2'
|
90
90
|
- - ">="
|
91
91
|
- !ruby/object:Gem::Version
|
92
92
|
version: 1.12.2
|
@@ -110,6 +110,26 @@ dependencies:
|
|
110
110
|
- - ">="
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: 4.6.0
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: kaminari
|
115
|
+
requirement: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - "~>"
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '1.2'
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: 1.2.2
|
123
|
+
type: :runtime
|
124
|
+
prerelease: false
|
125
|
+
version_requirements: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - "~>"
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '1.2'
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: 1.2.2
|
113
133
|
- !ruby/object:Gem::Dependency
|
114
134
|
name: kramdown
|
115
135
|
requirement: !ruby/object:Gem::Requirement
|
@@ -249,9 +269,10 @@ files:
|
|
249
269
|
- ".gitattributes"
|
250
270
|
- ".github/issue_template.md"
|
251
271
|
- ".github/pull_request_template.md"
|
272
|
+
- ".github/workflows/coveralls.yml"
|
273
|
+
- ".github/workflows/rubyonrails.yml"
|
252
274
|
- ".gitignore"
|
253
275
|
- ".rubocop.yml"
|
254
|
-
- ".travis.yml"
|
255
276
|
- CHANGELOG.md
|
256
277
|
- CONTRIBUTING.md
|
257
278
|
- Gemfile
|
@@ -652,6 +673,8 @@ files:
|
|
652
673
|
- db/cms_seeds/sample-site/snippets/default.html
|
653
674
|
- db/migrate/00_create_active_storage_tables.rb
|
654
675
|
- db/migrate/01_create_cms.rb
|
676
|
+
- gemfiles/6.1.gemfile
|
677
|
+
- gemfiles/7.0.gemfile
|
655
678
|
- lib/generators/occams/cms/README
|
656
679
|
- lib/generators/occams/cms/assets_generator.rb
|
657
680
|
- lib/generators/occams/cms/cms_generator.rb
|
data/.travis.yml
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
dist: xenial
|
2
|
-
services:
|
3
|
-
- xvfb
|
4
|
-
addons:
|
5
|
-
sources:
|
6
|
-
- google-chrome
|
7
|
-
apt:
|
8
|
-
packages:
|
9
|
-
- google-chrome-stable
|
10
|
-
|
11
|
-
language: ruby
|
12
|
-
rvm:
|
13
|
-
- 2.7.8
|
14
|
-
- 3.1.4
|
15
|
-
- 3.2.2
|
16
|
-
gemfile:
|
17
|
-
- test/gemfiles/6.1.gemfile
|
18
|
-
jobs:
|
19
|
-
include:
|
20
|
-
- rvm: 2.7.8
|
21
|
-
gemfile: test/gemfiles/6.1.gemfile
|
22
|
-
- rvm: 3.1.4
|
23
|
-
gemfile: test/gemfiles/6.1.gemfile
|
24
|
-
- rvm: 3.2.2
|
25
|
-
gemfile: test/gemfiles/7.0.gemfile
|
26
|
-
branches:
|
27
|
-
only:
|
28
|
-
- master
|
29
|
-
before_install:
|
30
|
-
- gem update --system
|
31
|
-
- gem update bundler
|
32
|
-
before_script:
|
33
|
-
- wget http://chromedriver.storage.googleapis.com/2.36/chromedriver_linux64.zip
|
34
|
-
- unzip chromedriver_linux64.zip
|
35
|
-
- sudo apt-get install libnss3
|
36
|
-
- sudo apt-get --only-upgrade install google-chrome-stable
|
37
|
-
- sudo cp chromedriver /usr/local/bin/.
|
38
|
-
- sudo chmod +x /usr/local/bin/chromedriver
|
39
|
-
- export DISPLAY=:99.0
|
40
|
-
- sleep 3
|
41
|
-
script:
|
42
|
-
- bundle exec rake db:migrate
|
43
|
-
- bundle exec rake test
|
44
|
-
- SKIP_COV=true bundle exec rake test:system
|
45
|
-
- bundle exec rubocop
|