occams 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d020dd30a0e74d5c86211e061b5018c726f9a07e364c96f9c9cc65ebf4762d3
4
- data.tar.gz: cf50ea17c8fcc9a5bdc6baa008dbfb7503b0d6acbdfa05389f706d6ce934adce
3
+ metadata.gz: 3d22998c59d5b513a2a94a37547b474bdbb96855635c995af716b69a59236ccb
4
+ data.tar.gz: 548c6d037e47b1b274e0b1891d7f63a71a89c2ef0f6b1d675709b0bade1730e9
5
5
  SHA512:
6
- metadata.gz: bf49d617a083d592d67dd6b5f72c2f3fb15618c64b5a954dd7fdefc71a578b1800279610bce9322867ef5ca5beef1cf4fa3356e766d1b4520810efb79f89ffbd
7
- data.tar.gz: 37c7949c2bac89e22933d44177a6a713559fe14db0488062f9564cacd240a8b608e56275a4228d457411abce7478c595488d5b399cbd0566f4daafcb2a261942
6
+ metadata.gz: '03289e8b933af455d8a6532807a73a6eb5ce50614da5627ee1fa9d1b548a0e9b005cae3edd650c5054de72c9306472e3a689e4baeb7f7e6dd23addf41c749024'
7
+ data.tar.gz: 607ce6b807c49f9a1ddabbbbafa6b4cc5ba1775a32bdbb26983eb45e5ec0f75b7a0a43eabf159fd3c2f2e06fe182de31323ba149dee55e7102e7b7759ca0791d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.0.7 - 9/12/2023
4
+
5
+ - update coveralls Coverage reporting
6
+ - add minitest-reporters for test output
7
+ - adjust tests to accomodate varying macos and linux outputs
8
+ - refine test for 'children' tag
9
+ - linting and 1 typo
10
+ - add Build Status and Coveralls Coverage Status to README
11
+
12
+ ## v1.0.6.1 - 9/5/2023
13
+
14
+ - Fixed siblings and children nav tags which as written had problems creating child pages in the admin panel
15
+
3
16
  ## v1.0.6 - 9/5/2023
4
17
 
5
18
  - 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
data/Gemfile CHANGED
@@ -21,9 +21,10 @@ group :development do
21
21
  end
22
22
 
23
23
  group :test do
24
- gem 'coveralls', '~> 0.8.23', require: false
24
+ gem 'coveralls_reborn', require: false
25
25
  gem 'diffy', '~> 3.4.2'
26
26
  gem 'equivalent-xml', '~> 0.6.0'
27
+ gem 'minitest-reporters'
27
28
  gem 'mocha', '~> 2.1.0', require: false
28
29
  gem 'rails-controller-testing', '~> 1.0.5'
29
30
  end
data/README.md CHANGED
@@ -1,8 +1,16 @@
1
1
  # ocCaM'S
2
2
 
3
+ [![Build status](https://badge.buildkite.com/6b70f3f81c5922bd134b33d3ba1412c68f53a9f67e0a907ade.svg?branch=main)](https://buildkite.com/gknt/occams)
4
+ [![Coverage Status](https://coveralls.io/repos/github/avonderluft/occams/badge.svg?branch=main)](https://coveralls.io/github/avonderluft/occams?branch=main)
3
5
  [![Gem Version](https://img.shields.io/gem/v/occams.svg?style=flat)](http://rubygems.org/gems/occams)
4
6
  [![Gem Downloads](https://img.shields.io/gem/dt/occams.svg?style=flat)](http://rubygems.org/gems/occams)
5
7
 
8
+ ***Prefer Simplicity.***
9
+
10
+ <a href="https://en.wikipedia.org/wiki/William_of_Ockham" target="_blank">
11
+ <img align="left" height="150" src="https://upload.wikimedia.org/wikipedia/commons/7/70/William_of_Ockham.png" alt="William of Ockham" title="William of Ockham">
12
+ </a>
13
+
6
14
  ```
7
15
  ____ __ __ _ ____
8
16
  ___ ___ / ___|__ _| \/ ( ) ___|
@@ -10,26 +18,22 @@
10
18
  | (_) | (__| |__| (_| | | | | ___) |
11
19
  \___/ \___|\____\__,_|_| |_| |____/
12
20
 
13
- ```
14
-
15
- Prefer Simplicity.
21
+ ```
16
22
 
17
23
  ## Raison d'etre
18
24
 
19
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), et al. 'Comfy' was the simplest and cleanest Rails-based CMS that I had used. Its last commit was in 2020, and I simply did not want to see it die on the vine as [RadiantCMS](https://github.com/radiant/radiant) did some years ago.
20
26
 
21
-
22
27
  ## The name
23
28
 
24
- 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 the preferred solution is that which is simplest and built with the smallest possible set of components.
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 to simpler ones.
25
30
 
26
- ## Features
27
31
 
28
- * Simple drop-in integration with Rails 6.1+ apps with minimal configuration
29
- * CMS stays away from the rest of your application
30
32
 
31
- Referring to the [ComfortableMexicanSofa](https://github.com/comfy/comfortable-mexican-sofa) documentation, substituting 'Occams' for 'ComfortableMexicanSofa' where appropriate.
33
+ ## Features
32
34
 
35
+ * Simple drop-in integration with Rails 6.1+ apps with minimal configuration
36
+ * The CMS keeps clear from the rest of your application
33
37
  * Powerful page templating capability using [Content Tags](https://github.com/avonderluft/occams/wiki/Content-Tags)
34
38
  * [Multiple Sites](https://github.com/avonderluft/occams/wiki/Sites) from a single installation
35
39
  * Multi-Language Support (i18n) (ca, cs, da, de, en, es, fi, fr, gr, hr, it, ja, nb, nl, pl, pt-BR, ru, sv, tr, uk, zh-CN, zh-TW) and page localization.
@@ -3,5 +3,5 @@ label: Child Seed Page
3
3
  layout: nested
4
4
  target_page: '/child_b'
5
5
 
6
- [textares content]
6
+ [textarea content]
7
7
  Child A Page Seed Content
@@ -16,31 +16,33 @@
16
16
  # as comma-delimited string, e.g. as above - exclude: "404-page, search-page"
17
17
 
18
18
  class Occams::Content::Tag::Children < Occams::Content::Tag
19
- attr_reader :list, :style, :locals
19
+ attr_reader :style, :page_children, :locals
20
+ attr_accessor :list
20
21
 
21
22
  def initialize(context:, params: [], source: nil)
22
23
  super
23
24
  @locals = params.extract_options!
24
25
  @style = ''
25
- @style = "<style>#children {#{@locals['style']}}</style>" if @locals['style']
26
+ @style = "<style>#children {#{@locals['style']}}</style>\n" if @locals['style']
26
27
  @exclude = []
27
28
  @exclude = @locals['exclude'].split(',') if @locals['exclude']
28
29
  @list = ''
29
30
  # ActiveRecord_Associations_CollectionProxy
30
- page_children = context.children.order(:position).to_ary
31
- page_children.delete_if { |child| @exclude.include? child.slug }
32
- return unless page_children.any?
33
-
34
- @list = '<ul id="children">'
35
- page_children.each do |c|
36
- next if Rails.env == 'production' && !c.is_published
37
-
38
- @list += "<li><a href=#{c.url(relative: true)}>#{c.label}</a></li>"
31
+ @page_children = context.children.order(:position).to_ary
32
+ if Rails.env == 'production'
33
+ @page_children.delete_if { |child| !child.is_published }
39
34
  end
40
- @list += '</ul>'
35
+ @page_children.delete_if { |child| @exclude.include? child.slug }
41
36
  end
42
37
 
43
38
  def content
39
+ if @page_children.any?
40
+ @list = "<ul id=\"children\">\n"
41
+ @page_children.each do |c|
42
+ @list += " <li><a href=#{c.url(relative: true)}>#{c.label}</a></li>\n"
43
+ end
44
+ @list += '</ul>'
45
+ end
44
46
  format("#{@style}#{@list}")
45
47
  end
46
48
  end
@@ -18,7 +18,8 @@
18
18
  # style and exclude parameters are optional
19
19
 
20
20
  class Occams::Content::Tag::Siblings < Occams::Content::Tag
21
- attr_reader :locals, :style, :links
21
+ attr_reader :locals, :style, :sibs
22
+ attr_accessor :links
22
23
 
23
24
  def initialize(context:, params: [], source: nil)
24
25
  super
@@ -27,29 +28,31 @@ class Occams::Content::Tag::Siblings < Occams::Content::Tag
27
28
  @style = "<style>#siblings {#{@locals['style']}}</style>" if @locals['style']
28
29
  @exclude = []
29
30
  @exclude = @locals['exclude'].split(',') if @locals['exclude']
30
- @links = '<div id="siblings">'
31
+ @links = ''
32
+ # ActiveRecord_Associations_CollectionProxy
33
+ @sibs = context.self_and_siblings.order(:position).to_ary
34
+ @sibs.delete_if { |sib| @exclude.include? sib.slug }
35
+ end
31
36
 
32
- prevp = false
33
- sibs = context.self_and_siblings.sort_by(&:position)
34
- sibs.delete_if { |sib| @exclude.include? sib.slug }
35
- page_idx = sibs.index(context)
36
- sibs.each do |sib|
37
- sib_idx = sibs.index(sib)
38
- next if sibs.index(sib) == page_idx
39
- next if Rails.env == 'production' && !sib.is_published
37
+ def content
38
+ if @sibs.count > 1
39
+ @links = '<div id="siblings">'
40
+ prevp = false
41
+ @sibs.each do |sib|
42
+ sib_idx = @sibs.index(sib)
43
+ next if sib.slug == context.slug
44
+ next if Rails.env == 'production' && !sib.is_published
40
45
 
41
- if sib_idx == page_idx - 1
42
- @links += "<a href=#{sib.url(relative: true)}>#{sib.label}</a> &laquo;&nbsp;<em>Previous</em> &bull; "
43
- prevp = true
44
- elsif sib_idx == page_idx + 1
45
- @links += '&bull;' unless prevp
46
- @links += "<em>Next</em>&nbsp;&raquo; <a href=#{sib.url(relative: true)}>#{sib.label}</a>"
46
+ if sib_idx == @sibs.index(context) - 1
47
+ @links += "<a href=#{sib.url(relative: true)}>#{sib.label}</a> &laquo;&nbsp;<em>Previous</em> &bull; "
48
+ prevp = true
49
+ elsif sib_idx == @sibs.index(context) + 1
50
+ @links += '&bull;' unless prevp
51
+ @links += "<em>Next</em>&nbsp;&raquo; <a href=#{sib.url(relative: true)}>#{sib.label}</a>"
52
+ end
47
53
  end
54
+ @links += '</div>'
48
55
  end
49
- @links += '</div>'
50
- end
51
-
52
- def content
53
56
  format("#{@style}#{@links}")
54
57
  end
55
58
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Occams
4
- VERSION = '1.0.6'
4
+ VERSION = '1.0.7'
5
5
  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.6
4
+ version: 1.0.7
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-06 00:00:00.000000000 Z
11
+ date: 2023-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_link_to