occams 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +23 -40
  3. data/CHANGELOG.md +8 -0
  4. data/Gemfile +17 -17
  5. data/LICENSE +1 -1
  6. data/README.md +15 -18
  7. data/Rakefile +1 -1
  8. data/TODOS.md +6 -0
  9. data/app/controllers/occams/admin/base_controller.rb +1 -1
  10. data/app/controllers/occams/admin/cms/base_controller.rb +7 -7
  11. data/app/controllers/occams/admin/cms/files_controller.rb +17 -17
  12. data/app/controllers/occams/admin/cms/layouts_controller.rb +7 -7
  13. data/app/controllers/occams/admin/cms/pages_controller.rb +25 -25
  14. data/app/controllers/occams/admin/cms/revisions/base_controller.rb +5 -5
  15. data/app/controllers/occams/admin/cms/revisions/layout_controller.rb +1 -1
  16. data/app/controllers/occams/admin/cms/revisions/page_controller.rb +3 -3
  17. data/app/controllers/occams/admin/cms/revisions/snippet_controller.rb +1 -1
  18. data/app/controllers/occams/admin/cms/revisions/translation_controller.rb +3 -3
  19. data/app/controllers/occams/admin/cms/sites_controller.rb +6 -6
  20. data/app/controllers/occams/admin/cms/snippets_controller.rb +6 -6
  21. data/app/controllers/occams/admin/cms/translations_controller.rb +24 -24
  22. data/app/controllers/occams/cms/assets_controller.rb +5 -5
  23. data/app/controllers/occams/cms/base_controller.rb +7 -12
  24. data/app/controllers/occams/cms/content_controller.rb +14 -10
  25. data/app/helpers/occams/admin/cms_helper.rb +3 -3
  26. data/app/helpers/occams/cms_helper.rb +8 -8
  27. data/app/models/concerns/occams/cms/with_categories.rb +3 -3
  28. data/app/models/concerns/occams/cms/with_fragments.rb +3 -3
  29. data/app/models/occams/cms/categorization.rb +1 -1
  30. data/app/models/occams/cms/category.rb +1 -1
  31. data/app/models/occams/cms/file.rb +4 -4
  32. data/app/models/occams/cms/fragment.rb +2 -2
  33. data/app/models/occams/cms/layout.rb +5 -5
  34. data/app/models/occams/cms/page.rb +6 -6
  35. data/app/models/occams/cms/revision.rb +1 -1
  36. data/app/models/occams/cms/site.rb +8 -8
  37. data/app/models/occams/cms/snippet.rb +1 -1
  38. data/app/models/occams/cms/translation.rb +1 -1
  39. data/app/views/layouts/occams/admin/cms/_left.html.haml +1 -0
  40. data/config/application.rb +4 -4
  41. data/config/boot.rb +4 -3
  42. data/config/environment.rb +1 -1
  43. data/config/environments/development.rb +2 -2
  44. data/config/environments/test.rb +1 -1
  45. data/config/initializers/occams.rb +2 -2
  46. data/config.ru +1 -1
  47. data/lib/generators/occams/cms/assets_generator.rb +3 -3
  48. data/lib/generators/occams/cms/cms_generator.rb +13 -13
  49. data/lib/generators/occams/cms/controllers_generator.rb +2 -2
  50. data/lib/generators/occams/cms/models_generator.rb +2 -2
  51. data/lib/generators/occams/cms/views_generator.rb +2 -2
  52. data/lib/generators/occams/scaffold/scaffold_generator.rb +18 -18
  53. data/lib/occams/configuration.rb +33 -33
  54. data/lib/occams/content/params_parser.rb +3 -3
  55. data/lib/occams/content/renderer.rb +8 -8
  56. data/lib/occams/content/tag.rb +1 -1
  57. data/lib/occams/content/tags/asset.rb +13 -13
  58. data/lib/occams/content/tags/checkbox.rb +4 -4
  59. data/lib/occams/content/tags/date.rb +2 -2
  60. data/lib/occams/content/tags/datetime.rb +4 -4
  61. data/lib/occams/content/tags/file.rb +8 -8
  62. data/lib/occams/content/tags/file_link.rb +8 -8
  63. data/lib/occams/content/tags/files.rb +5 -5
  64. data/lib/occams/content/tags/fragment.rb +4 -4
  65. data/lib/occams/content/tags/helper.rb +6 -6
  66. data/lib/occams/content/tags/markdown.rb +2 -2
  67. data/lib/occams/content/tags/mixins/file_content.rb +3 -3
  68. data/lib/occams/content/tags/number.rb +1 -1
  69. data/lib/occams/content/tags/page_file_link.rb +8 -8
  70. data/lib/occams/content/tags/partial.rb +5 -5
  71. data/lib/occams/content/tags/snippet.rb +3 -3
  72. data/lib/occams/content/tags/template.rb +5 -5
  73. data/lib/occams/content/tags/text.rb +1 -1
  74. data/lib/occams/content/tags/textarea.rb +1 -1
  75. data/lib/occams/content/tags/wysiwyg.rb +1 -1
  76. data/lib/occams/content.rb +22 -22
  77. data/lib/occams/engine.rb +10 -10
  78. data/lib/occams/extensions/acts_as_tree.rb +1 -1
  79. data/lib/occams/extensions/has_revisions.rb +3 -3
  80. data/lib/occams/form_builder.rb +4 -4
  81. data/lib/occams/render_methods.rb +2 -2
  82. data/lib/occams/routes/cms.rb +3 -3
  83. data/lib/occams/routes/cms_admin.rb +6 -6
  84. data/lib/occams/routing.rb +2 -2
  85. data/lib/occams/seeds/file/exporter.rb +7 -11
  86. data/lib/occams/seeds/file/importer.rb +5 -5
  87. data/lib/occams/seeds/layout/exporter.rb +9 -9
  88. data/lib/occams/seeds/layout/importer.rb +9 -9
  89. data/lib/occams/seeds/page/exporter.rb +19 -21
  90. data/lib/occams/seeds/page/importer.rb +14 -14
  91. data/lib/occams/seeds/snippet/exporter.rb +6 -6
  92. data/lib/occams/seeds/snippet/importer.rb +6 -6
  93. data/lib/occams/seeds.rb +5 -5
  94. data/lib/occams/version.rb +1 -1
  95. data/lib/occams/view_hooks.rb +1 -1
  96. data/lib/occams.rb +24 -24
  97. data/lib/tasks/cms_seeds.rake +2 -2
  98. data/occams.gemspec +22 -21
  99. metadata +5 -4
  100. data/LICENSE.comfy +0 -20
@@ -4,7 +4,7 @@ module Occams::Seeds::Layout
4
4
  class Exporter < Occams::Seeds::Exporter
5
5
  def initialize(from, to = from)
6
6
  super
7
- self.path = ::File.join(Occams.config.seeds_path, to, "layouts/")
7
+ self.path = ::File.join(Occams.config.seeds_path, to, 'layouts/')
8
8
  end
9
9
 
10
10
  def export!
@@ -14,19 +14,19 @@ module Occams::Seeds::Layout
14
14
  layout_path = File.join(path, layout.ancestors.reverse.collect(&:identifier), layout.identifier)
15
15
  FileUtils.mkdir_p(layout_path)
16
16
 
17
- path = ::File.join(layout_path, "content.html")
17
+ path = ::File.join(layout_path, 'content.html')
18
18
  data = []
19
19
 
20
20
  attrs = {
21
- "label" => layout.label,
22
- "app_layout" => layout.app_layout,
23
- "position" => layout.position
21
+ 'label' => layout.label,
22
+ 'app_layout' => layout.app_layout,
23
+ 'position' => layout.position
24
24
  }.to_yaml
25
25
 
26
- data << { header: "attributes", content: attrs }
27
- data << { header: "content", content: layout.content }
28
- data << { header: "js", content: layout.js }
29
- data << { header: "css", content: layout.css }
26
+ data << { header: 'attributes', content: attrs }
27
+ data << { header: 'content', content: layout.content }
28
+ data << { header: 'js', content: layout.js }
29
+ data << { header: 'css', content: layout.css }
30
30
 
31
31
  write_file_content(path, data)
32
32
 
@@ -4,7 +4,7 @@ module Occams::Seeds::Layout
4
4
  class Importer < Occams::Seeds::Importer
5
5
  def initialize(from, to = from)
6
6
  super
7
- self.path = ::File.join(Occams.config.seeds_path, from, "layouts/")
7
+ self.path = ::File.join(Occams.config.seeds_path, from, 'layouts/')
8
8
  end
9
9
 
10
10
  def import!(path = self.path, parent = nil)
@@ -13,20 +13,20 @@ module Occams::Seeds::Layout
13
13
  end
14
14
 
15
15
  # cleaning up
16
- site.layouts.where("id NOT IN (?)", seed_ids).destroy_all
16
+ site.layouts.where('id NOT IN (?)', seed_ids).destroy_all
17
17
  end
18
18
 
19
19
  private
20
20
 
21
21
  def import_layout(path, parent)
22
- identifier = path.split("/").last
22
+ identifier = path.split('/').last
23
23
 
24
24
  # reading file content in, resulting in a hash
25
- content_path = File.join(path, "content.html")
25
+ content_path = File.join(path, 'content.html')
26
26
  content_hash = parse_file_content(content_path)
27
27
 
28
28
  # parsing attributes section
29
- attributes_yaml = content_hash.delete("attributes")
29
+ attributes_yaml = content_hash.delete('attributes')
30
30
  attrs = YAML.safe_load(attributes_yaml)
31
31
 
32
32
  layout = site.layouts.where(identifier: identifier).first_or_initialize
@@ -34,10 +34,10 @@ module Occams::Seeds::Layout
34
34
 
35
35
  if fresh_seed?(layout, content_path)
36
36
  layout.attributes = attrs.merge(
37
- app_layout: attrs["app_layout"] || parent.try(:app_layout),
38
- content: content_hash["content"],
39
- js: content_hash["js"],
40
- css: content_hash["css"]
37
+ app_layout: attrs['app_layout'] || parent.try(:app_layout),
38
+ content: content_hash['content'],
39
+ js: content_hash['js'],
40
+ css: content_hash['css']
41
41
  )
42
42
 
43
43
  if layout.save
@@ -4,30 +4,30 @@ module Occams::Seeds::Page
4
4
  class Exporter < Occams::Seeds::Exporter
5
5
  def initialize(from, to = from)
6
6
  super
7
- self.path = ::File.join(Occams.config.seeds_path, to, "pages/")
7
+ self.path = ::File.join(Occams.config.seeds_path, to, 'pages/')
8
8
  end
9
9
 
10
10
  def export!
11
11
  prepare_folder!(path)
12
12
 
13
13
  site.pages.each do |page|
14
- page.slug = "index" if page.slug.blank?
15
- page_path = File.join(path, page.ancestors.reverse.map { |p| p.slug.blank? ? "index" : p.slug }, page.slug)
14
+ page.slug = 'index' if page.slug.blank?
15
+ page_path = File.join(path, page.ancestors.reverse.map { |p| p.slug.blank? ? 'index' : p.slug }, page.slug)
16
16
  FileUtils.mkdir_p(page_path)
17
17
 
18
- path = ::File.join(page_path, "content.html")
18
+ path = ::File.join(page_path, 'content.html')
19
19
  data = []
20
20
 
21
21
  attrs = {
22
- "label" => page.label,
23
- "layout" => page.layout.try(:identifier),
24
- "target_page" => page.target_page.try(:full_path),
25
- "categories" => page.categories.map(&:label),
26
- "is_published" => page.is_published,
27
- "position" => page.position
22
+ 'label' => page.label,
23
+ 'layout' => page.layout.try(:identifier),
24
+ 'target_page' => page.target_page.try(:full_path),
25
+ 'categories' => page.categories.map(&:label),
26
+ 'is_published' => page.is_published,
27
+ 'position' => page.position
28
28
  }.to_yaml
29
29
 
30
- data << { header: "attributes", content: attrs }
30
+ data << { header: 'attributes', content: attrs }
31
31
  data += fragments_data(page, page_path)
32
32
 
33
33
  write_file_content(path, data)
@@ -47,12 +47,12 @@ module Occams::Seeds::Page
47
47
  data = []
48
48
 
49
49
  attrs = {
50
- "label" => translation.label,
51
- "layout" => translation.layout.try(:identifier),
52
- "is_published" => page.is_published
50
+ 'label' => translation.label,
51
+ 'layout' => translation.layout.try(:identifier),
52
+ 'is_published' => page.is_published
53
53
  }.to_yaml
54
54
 
55
- data << { header: "attributes", content: attrs }
55
+ data << { header: 'attributes', content: attrs }
56
56
  data += fragments_data(translation, page_path)
57
57
 
58
58
  write_file_content(path, data)
@@ -68,15 +68,13 @@ module Occams::Seeds::Page
68
68
  header = "#{frag.tag} #{frag.identifier}"
69
69
  content =
70
70
  case frag.tag
71
- when "datetime", "date"
71
+ when 'datetime', 'date'
72
72
  frag.datetime
73
- when "checkbox"
73
+ when 'checkbox'
74
74
  frag.boolean
75
- when "file", "files"
75
+ when 'file', 'files'
76
76
  frag.attachments.map do |attachment|
77
- ::File.open(::File.join(page_path, attachment.filename.to_s), "wb") do |f|
78
- f.write(attachment.download)
79
- end
77
+ ::File.binwrite(::File.join(page_path, attachment.filename.to_s), attachment.download)
80
78
  attachment.filename
81
79
  end.join("\n")
82
80
  else
@@ -8,23 +8,23 @@ module Occams::Seeds::Page
8
8
 
9
9
  def initialize(from, to = from)
10
10
  super
11
- self.path = ::File.join(Occams.config.seeds_path, from, "pages/")
11
+ self.path = ::File.join(Occams.config.seeds_path, from, 'pages/')
12
12
  end
13
13
 
14
14
  def import!
15
- import_page(File.join(path, "index/"), nil)
15
+ import_page(File.join(path, 'index/'), nil)
16
16
 
17
17
  link_target_pages
18
18
 
19
19
  # Remove pages not found in seeds
20
- site.pages.where("id NOT IN (?)", seed_ids).destroy_all
20
+ site.pages.where('id NOT IN (?)', seed_ids).destroy_all
21
21
  end
22
22
 
23
23
  private
24
24
 
25
25
  # Recursive function that will be called for each child page (subfolder)
26
26
  def import_page(path, parent)
27
- slug = path.split("/").last
27
+ slug = path.split('/').last
28
28
 
29
29
  # setting page record
30
30
  page =
@@ -36,7 +36,7 @@ module Occams::Seeds::Page
36
36
  site.pages.root || site.pages.new(slug: slug)
37
37
  end
38
38
 
39
- content_path = File.join(path, "content.html")
39
+ content_path = File.join(path, 'content.html')
40
40
 
41
41
  # If file is newer than page record we'll process it
42
42
  if fresh_seed?(page, content_path)
@@ -45,13 +45,13 @@ module Occams::Seeds::Page
45
45
  fragments_hash = parse_file_content(content_path)
46
46
 
47
47
  # parsing attributes section
48
- attributes_yaml = fragments_hash.delete("attributes")
48
+ attributes_yaml = fragments_hash.delete('attributes')
49
49
  attrs = YAML.safe_load(attributes_yaml)
50
50
 
51
51
  # applying attributes
52
- layout = site.layouts.find_by(identifier: attrs.delete("layout")) || parent.try(:layout)
53
- category_ids = category_names_to_ids(page, attrs.delete("categories"))
54
- target_page = attrs.delete("target_page")
52
+ layout = site.layouts.find_by(identifier: attrs.delete('layout')) || parent.try(:layout)
53
+ category_ids = category_names_to_ids(page, attrs.delete('categories'))
54
+ target_page = attrs.delete('target_page')
55
55
 
56
56
  page.attributes = attrs.merge(
57
57
  layout: layout,
@@ -113,11 +113,11 @@ module Occams::Seeds::Page
113
113
  fragments_hash = parse_file_content(file_path)
114
114
 
115
115
  # parsing attributes section
116
- attributes_yaml = fragments_hash.delete("attributes")
116
+ attributes_yaml = fragments_hash.delete('attributes')
117
117
  attrs = YAML.safe_load(attributes_yaml)
118
118
 
119
119
  # applying attributes
120
- layout = site.layouts.find_by(identifier: attrs.delete("layout")) || page.try(:layout)
120
+ layout = site.layouts.find_by(identifier: attrs.delete('layout')) || page.try(:layout)
121
121
  translation.attributes = attrs.merge(
122
122
  layout: layout
123
123
  )
@@ -164,11 +164,11 @@ module Occams::Seeds::Page
164
164
 
165
165
  # based on tag we need to cram content in proper place and proper format
166
166
  case tag
167
- when "date", "datetime"
167
+ when 'date', 'datetime'
168
168
  frag_hash[:datetime] = frag_content
169
- when "checkbox"
169
+ when 'checkbox'
170
170
  frag_hash[:boolean] = frag_content
171
- when "file", "files"
171
+ when 'file', 'files'
172
172
  files, file_ids_destroy = files_content(record, identifier, path, frag_content)
173
173
  frag_hash[:files] = files
174
174
  frag_hash[:file_ids_destroy] = file_ids_destroy
@@ -4,7 +4,7 @@ module Occams::Seeds::Snippet
4
4
  class Exporter < Occams::Seeds::Exporter
5
5
  def initialize(from, to = from)
6
6
  super
7
- self.path = ::File.join(Occams.config.seeds_path, to, "snippets/")
7
+ self.path = ::File.join(Occams.config.seeds_path, to, 'snippets/')
8
8
  end
9
9
 
10
10
  def export!
@@ -12,14 +12,14 @@ module Occams::Seeds::Snippet
12
12
 
13
13
  site.snippets.each do |snippet|
14
14
  attrs = {
15
- "label" => snippet.label,
16
- "categories" => snippet.categories.map(&:label),
17
- "position" => snippet.position
15
+ 'label' => snippet.label,
16
+ 'categories' => snippet.categories.map(&:label),
17
+ 'position' => snippet.position
18
18
  }.to_yaml
19
19
 
20
20
  data = []
21
- data << { header: "attributes", content: attrs }
22
- data << { header: "content", content: snippet.content }
21
+ data << { header: 'attributes', content: attrs }
22
+ data << { header: 'content', content: snippet.content }
23
23
 
24
24
  snippet_path = File.join(path, "#{snippet.identifier}.html")
25
25
  write_file_content(snippet_path, data)
@@ -4,28 +4,28 @@ module Occams::Seeds::Snippet
4
4
  class Importer < Occams::Seeds::Importer
5
5
  def initialize(from, to = from)
6
6
  super
7
- self.path = ::File.join(Occams.config.seeds_path, from, "snippets/")
7
+ self.path = ::File.join(Occams.config.seeds_path, from, 'snippets/')
8
8
  end
9
9
 
10
10
  def import!
11
11
  Dir.glob("#{path}/*.html").each do |path|
12
- identifier = File.basename(path, ".html")
12
+ identifier = File.basename(path, '.html')
13
13
 
14
14
  # reading file content in, resulting in a hash
15
15
  content_hash = parse_file_content(path)
16
16
 
17
17
  # parsing attributes section
18
- attributes_yaml = content_hash.delete("attributes")
18
+ attributes_yaml = content_hash.delete('attributes')
19
19
  attrs = YAML.safe_load(attributes_yaml)
20
20
 
21
21
  snippet = site.snippets.where(identifier: identifier).first_or_initialize
22
22
 
23
23
  if fresh_seed?(snippet, path)
24
- category_ids = category_names_to_ids(snippet, attrs.delete("categories"))
24
+ category_ids = category_names_to_ids(snippet, attrs.delete('categories'))
25
25
 
26
26
  snippet.attributes = attrs.merge(
27
27
  category_ids: category_ids,
28
- content: content_hash["content"]
28
+ content: content_hash['content']
29
29
  )
30
30
 
31
31
  if snippet.save
@@ -43,7 +43,7 @@ module Occams::Seeds::Snippet
43
43
  end
44
44
 
45
45
  # cleaning up
46
- site.snippets.where("id NOT IN (?)", seed_ids).destroy_all
46
+ site.snippets.where('id NOT IN (?)', seed_ids).destroy_all
47
47
  end
48
48
  end
49
49
  end
data/lib/occams/seeds.rb CHANGED
@@ -5,7 +5,7 @@ module Occams::Seeds
5
5
 
6
6
  class Error < StandardError; end
7
7
 
8
- require "mimemagic"
8
+ require 'mimemagic'
9
9
 
10
10
  class Importer
11
11
  attr_accessor :site,
@@ -21,9 +21,9 @@ module Occams::Seeds
21
21
  self.site = Occams::Cms::Site.where(identifier: to).first!
22
22
  self.seed_ids = []
23
23
 
24
- unless ::File.exist?(path = ::File.join(Occams.config.seeds_path, from))
25
- raise Error, "Folder for import: '#{path}' is not found"
26
- end
24
+ return if ::File.exist?(path = ::File.join(Occams.config.seeds_path, from))
25
+
26
+ raise Error, "Folder for import: '#{path}' is not found"
27
27
  end
28
28
 
29
29
  # if passed nil will use default seed classes
@@ -92,7 +92,7 @@ module Occams::Seeds
92
92
  # Writing to the seed file. Takes in file handler and array of hashes with
93
93
  # `header` and `content` keys
94
94
  def write_file_content(path, data)
95
- ::File.open(::File.join(path), "wb") do |f|
95
+ ::File.open(::File.join(path), 'wb') do |f|
96
96
  data.each do |item|
97
97
  f.write("[#{item[:header]}]\n#{item[:content]}")
98
98
  # adds a newline between items if not already there
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Occams
4
- VERSION = "1.0.1"
4
+ VERSION = '1.0.2'
5
5
  end
@@ -10,7 +10,7 @@ module Occams::ViewHooks
10
10
 
11
11
  # Renders hook content
12
12
  def self.render(name, template, options = {})
13
- out = ""
13
+ out = ''
14
14
  (hooks[name.to_sym] || []).each do |path|
15
15
  out += template.render({ partial: path.first }.merge(options))
16
16
  end
data/lib/occams.rb CHANGED
@@ -2,33 +2,33 @@
2
2
 
3
3
  # Loading engine only if this is not a standalone installation
4
4
  unless defined? Occams::Application
5
- require_relative "occams/engine"
5
+ require_relative 'occams/engine'
6
6
  end
7
7
 
8
- require_relative "occams/version"
9
- require_relative "occams/error"
10
- require_relative "occams/configuration"
11
- require_relative "occams/routing"
12
- require_relative "occams/access_control/admin_authentication"
13
- require_relative "occams/access_control/admin_authorization"
14
- require_relative "occams/access_control/public_authentication"
15
- require_relative "occams/access_control/public_authorization"
16
- require_relative "occams/render_methods"
17
- require_relative "occams/view_hooks"
18
- require_relative "occams/form_builder"
19
- require_relative "occams/seeds"
20
- require_relative "occams/seeds/layout/importer"
21
- require_relative "occams/seeds/layout/exporter"
22
- require_relative "occams/seeds/page/importer"
23
- require_relative "occams/seeds/page/exporter"
24
- require_relative "occams/seeds/snippet/importer"
25
- require_relative "occams/seeds/snippet/exporter"
26
- require_relative "occams/seeds/file/importer"
27
- require_relative "occams/seeds/file/exporter"
28
- require_relative "occams/extensions/acts_as_tree"
29
- require_relative "occams/extensions/has_revisions"
8
+ require_relative 'occams/version'
9
+ require_relative 'occams/error'
10
+ require_relative 'occams/configuration'
11
+ require_relative 'occams/routing'
12
+ require_relative 'occams/access_control/admin_authentication'
13
+ require_relative 'occams/access_control/admin_authorization'
14
+ require_relative 'occams/access_control/public_authentication'
15
+ require_relative 'occams/access_control/public_authorization'
16
+ require_relative 'occams/render_methods'
17
+ require_relative 'occams/view_hooks'
18
+ require_relative 'occams/form_builder'
19
+ require_relative 'occams/seeds'
20
+ require_relative 'occams/seeds/layout/importer'
21
+ require_relative 'occams/seeds/layout/exporter'
22
+ require_relative 'occams/seeds/page/importer'
23
+ require_relative 'occams/seeds/page/exporter'
24
+ require_relative 'occams/seeds/snippet/importer'
25
+ require_relative 'occams/seeds/snippet/exporter'
26
+ require_relative 'occams/seeds/file/importer'
27
+ require_relative 'occams/seeds/file/exporter'
28
+ require_relative 'occams/extensions/acts_as_tree'
29
+ require_relative 'occams/extensions/has_revisions'
30
30
 
31
- require_relative "occams/content"
31
+ require_relative 'occams/content'
32
32
 
33
33
  module Occams
34
34
  class << self
@@ -2,7 +2,7 @@
2
2
 
3
3
  namespace :occams do
4
4
  namespace :cms_seeds do
5
- desc "Import CMS Seed data into database (from: folder name, to: site identifier, classes: class name[s])"
5
+ desc 'Import CMS Seed data into database (from: folder name, to: site identifier, classes: class name[s])'
6
6
 
7
7
  task :import, %i[from to classes] => [:environment] do |_t, args|
8
8
  from = args[:from]
@@ -20,7 +20,7 @@ namespace :occams do
20
20
  Occams.logger = logger
21
21
  end
22
22
 
23
- desc "Export database data into CMS Seed files (from: site identifier, to: folder name, classes: class name[s])"
23
+ desc 'Export database data into CMS Seed files (from: site identifier, to: folder name, classes: class name[s])'
24
24
  task :export, %i[from to classes] => [:environment] do |_t, args|
25
25
  from = args[:from]
26
26
  to = args[:to] || from
data/occams.gemspec CHANGED
@@ -1,33 +1,34 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- $LOAD_PATH.unshift File.expand_path("lib", __dir__)
4
- require "occams/version"
3
+ $LOAD_PATH.unshift File.expand_path('lib', __dir__)
4
+ require 'occams/version'
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = "occams"
7
+ s.name = 'occams'
8
8
  s.version = Occams::VERSION
9
- s.authors = ["Andrew vonderLuft"]
10
- s.email = ["wonder@hey.com"]
11
- s.homepage = "http://github.com/avonderluft/occams"
12
- s.summary = "Rails 6-7+ CMS Engine"
13
- s.description = "Occams is a powerful Rails 6-7+ CMS Engine"
14
- s.license = "MIT"
9
+ s.authors = ['Andrew vonderLuft']
10
+ s.email = ['wonder@hey.com']
11
+ s.homepage = 'http://github.com/avonderluft/occams'
12
+ s.summary = 'Rails 6-7+ CMS Engine'
13
+ s.description = 'Occams is a powerful Rails 6-7+ CMS Engine'
14
+ s.license = 'MIT'
15
15
 
16
16
  s.files = `git ls-files -z`.split("\x0").reject do |f|
17
17
  f.match(%r{^(test|doc)/})
18
18
  end
19
19
 
20
- s.required_ruby_version = ">= 2.7.0"
20
+ s.required_ruby_version = '>= 2.7.0'
21
+ s.metadata['rubygems_mfa_required'] = 'true'
21
22
 
22
- s.add_runtime_dependency "active_link_to", "~> 1.0", ">= 1.0.5"
23
- s.add_runtime_dependency "comfy_bootstrap_form", "~> 4.0", ">= 4.0.0"
24
- s.add_runtime_dependency "haml-rails", "~> 2.1", ">= 2.1.0"
25
- s.add_runtime_dependency "image_processing", "~> 1.12", ">= 1.12.2"
26
- s.add_runtime_dependency "jquery-rails", "~> 4.6", ">= 4.6.0"
27
- s.add_runtime_dependency "kramdown", "~> 2.4", ">= 2.4.0"
28
- s.add_runtime_dependency "mimemagic", "~> 0.4", ">= 0.4.3"
29
- s.add_runtime_dependency "mini_magick", "~> 4.12", ">= 4.12.0"
30
- s.add_dependency "rails", ">= 6.1.7.4"
31
- s.add_runtime_dependency "rails-i18n", ">= 6.0.0"
32
- s.add_runtime_dependency "sassc-rails", "~> 2.1", ">= 2.1.2"
23
+ s.add_runtime_dependency 'active_link_to', '~> 1.0', '>= 1.0.5'
24
+ s.add_runtime_dependency 'comfy_bootstrap_form', '~> 4.0', '>= 4.0.0'
25
+ s.add_runtime_dependency 'haml-rails', '~> 2.1', '>= 2.1.0'
26
+ s.add_runtime_dependency 'image_processing', '~> 1.12', '>= 1.12.2'
27
+ s.add_runtime_dependency 'jquery-rails', '~> 4.6', '>= 4.6.0'
28
+ s.add_runtime_dependency 'kramdown', '~> 2.4', '>= 2.4.0'
29
+ s.add_runtime_dependency 'mimemagic', '~> 0.4', '>= 0.4.3'
30
+ s.add_runtime_dependency 'mini_magick', '~> 4.12', '>= 4.12.0'
31
+ s.add_dependency 'rails', '>= 6.1.7.4'
32
+ s.add_runtime_dependency 'rails-i18n', '>= 6.0.0'
33
+ s.add_runtime_dependency 'sassc-rails', '~> 2.1', '>= 2.1.2'
33
34
  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.1
4
+ version: 1.0.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-08-07 00:00:00.000000000 Z
11
+ date: 2023-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_link_to
@@ -236,9 +236,9 @@ files:
236
236
  - CONTRIBUTING.md
237
237
  - Gemfile
238
238
  - LICENSE
239
- - LICENSE.comfy
240
239
  - README.md
241
240
  - Rakefile
241
+ - TODOS.md
242
242
  - app/assets/config/manifest.js
243
243
  - app/assets/fonts/occams/admin/cms/lib/redactor-font.eot
244
244
  - app/assets/javascripts/occams/admin/cms/application.js
@@ -697,7 +697,8 @@ files:
697
697
  homepage: http://github.com/avonderluft/occams
698
698
  licenses:
699
699
  - MIT
700
- metadata: {}
700
+ metadata:
701
+ rubygems_mfa_required: 'true'
701
702
  post_install_message:
702
703
  rdoc_options: []
703
704
  require_paths:
data/LICENSE.comfy DELETED
@@ -1,20 +0,0 @@
1
- Copyright (c) 2010-2019 Oleg Khabarov
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.