cloudcannon-jekyll 0.0.6 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3db71cd9bcacadb8f15366629da8293090b1d69c978036cf268b5a92ea85df67
4
- data.tar.gz: 1f56b1012167361c96d4f1fd503fe05f966d477e514bf119049c866c611d6286
3
+ metadata.gz: 9ae3c8abe082ec3f37215dec374610ec9afdbcfdf657088948285375e847410f
4
+ data.tar.gz: 44974881ddba3a62062337da11a56d1fbdd406fa04cead477b216866d88bf5cc
5
5
  SHA512:
6
- metadata.gz: 2b937bad2c330cdb0508123e368af6ccf92d409945f25ca1c09d1c33735f2fba3b14814a4096719d45d1b7e15da785d674a3381c5e89a1bfba6306013d6b952e
7
- data.tar.gz: f4d83f61a966a9514f88d6ce45819bc89ed110cbf133fca24eb9314fa0b0b40a8d7cd0d7790236226766e5073cf57c43b97c4eb28268d2cac25b68b71f4e3864
6
+ metadata.gz: 8d894aea066bba58238ac0a2dbcc277eee56c84d3aeddea107089db51717266f313001d187ac6f5bf077f3f46c044b5842e3e02afa96a0d38fcc8f967889a1c2
7
+ data.tar.gz: f51833d3e91c35ca0e2fa0020b4844a0727c969bf026d01f83922c384ec5b4a0bc68afa11032434a8947281664daf0f5b89f44066d4fb0b76969e8a056486923
data/.gitignore CHANGED
@@ -1,6 +1,7 @@
1
1
  Gemfile.lock
2
2
  spec/dest/
3
3
  spec/fixtures/.jekyll-cache/
4
+ spec/fixtures/.jekyll-metadata
4
5
  spec/fixtures/_site/
5
6
  gemfiles/.bundle/
6
7
  gemfiles/*.gemfile.lock
@@ -4,7 +4,7 @@ inherit_gem:
4
4
  rubocop-jekyll: .rubocop.yml
5
5
 
6
6
  AllCops:
7
- TargetRubyVersion: 2.6
7
+ TargetRubyVersion: 2.4
8
8
  Include:
9
9
  - lib/**/*.rb
10
10
 
@@ -20,8 +20,33 @@ AllCops:
20
20
  - script/**/*
21
21
  - vendor/**/*
22
22
  - gemfiles/**/*
23
- - lib/cloudcannon-jekyll/safe-jsonify-filter.rb # TODO remove this and fix warnings
24
23
 
25
24
  Naming/MemoizedInstanceVariableName:
26
25
  Exclude:
27
26
  - lib/cloudcannon-jekyll/page-without-a-file.rb
27
+
28
+ Metrics/CyclomaticComplexity:
29
+ Exclude:
30
+ - lib/cloudcannon-jekyll/jsonify-filter.rb # TODO remove this and fix warnings
31
+
32
+ Metrics/PerceivedComplexity:
33
+ Exclude:
34
+ - lib/cloudcannon-jekyll/jsonify-filter.rb # TODO remove this and fix warnings
35
+
36
+ Metrics/MethodLength:
37
+ Exclude:
38
+ - lib/cloudcannon-jekyll/jsonify-filter.rb # TODO remove this and fix warnings
39
+
40
+ Metrics/AbcSize:
41
+ Exclude:
42
+ - lib/cloudcannon-jekyll/jsonify-filter.rb # TODO remove this and fix warnings
43
+
44
+ # This is excluded since the ruby target is 2.3.8 which doesn't support String.match?(Regexp)
45
+ Performance/RegexpMatch:
46
+ Exclude:
47
+ - lib/cloudcannon-jekyll/generator.rb
48
+
49
+ # This is excluded since Jekyll used this and we need to check for it
50
+ Lint/UnifiedInteger:
51
+ Exclude:
52
+ - lib/cloudcannon-jekyll/jsonify-filter.rb
@@ -1,7 +1,7 @@
1
1
  language: ruby
2
2
  cache: bundler
3
3
  rvm:
4
- - 2.6
4
+ - 2.3.8
5
5
 
6
6
  before_install:
7
7
  - gem update --system
@@ -15,5 +15,4 @@ env:
15
15
  matrix:
16
16
  - JEKYLL_VERSION="2.4.0"
17
17
  - JEKYLL_VERSION="3.0.0"
18
- - JEKYLL_VERSION="3.8.5"
19
- - JEKYLL_VERSION="4.0.0"
18
+ - JEKYLL_VERSION="3.2.1"
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source "https://rubygems.org"
2
4
 
3
5
  gemspec
data/HISTORY.md CHANGED
@@ -1,3 +1,32 @@
1
+ # 0.2.1
2
+
3
+ * Add gem information and time to output config file
4
+ * Fix missing in-place compact
5
+ * Fix source being output as full path on disk
6
+ * Read content for output config file directly from site config
7
+
8
+ # 0.2.0
9
+
10
+ * Add defaults and input-options keys to config output
11
+ * Add more ignore keys for legacy select data filter
12
+ * Reduce methods added from other plugins clashing
13
+ * Fix invalid output when unsupported class found
14
+
15
+ # 0.1.0
16
+
17
+ * Add output config file
18
+ * Add support for including only specified `data` keys
19
+ * Fix invalid JSON issue for sites built with Jekyll 2 and no collections
20
+ * Change module load style for easier dropping into _plugins
21
+
22
+ # 0.0.8
23
+
24
+ * Removed unsupported Jekyll test targets
25
+
26
+ # 0.0.7
27
+
28
+ * Fix invalid JSON issue for sites built with Jekyll 2 and no collections
29
+
1
30
  # 0.0.6
2
31
 
3
32
  * Fixed unsupported Fixnum for Ruby 2.3
@@ -1,6 +1,6 @@
1
- # coding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path("../lib", __FILE__)
3
+ lib = File.expand_path("lib", __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  require "cloudcannon-jekyll/version"
@@ -21,8 +21,9 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.add_dependency "jekyll", ">= 2.4.0", "< 4"
23
23
 
24
+ spec.add_development_dependency "json_schemer", "~> 0.2.4"
24
25
  spec.add_development_dependency "rake", "~> 13.0"
25
26
  spec.add_development_dependency "rspec", "~> 3.9"
26
- spec.add_development_dependency "rubocop", "~> 0.71"
27
- spec.add_development_dependency "rubocop-jekyll", "~> 0.10"
27
+ spec.add_development_dependency "rubocop", "~> 0.80"
28
+ spec.add_development_dependency "rubocop-jekyll", "~> 0.11"
28
29
  end
@@ -2,15 +2,13 @@
2
2
 
3
3
  require "jekyll"
4
4
 
5
- module CloudCannonJekyll
6
- autoload :PageWithoutAFile, "cloudcannon-jekyll/page-without-a-file"
7
- autoload :Generator, "cloudcannon-jekyll/generator"
8
- autoload :Configuration, "cloudcannon-jekyll/configuration"
9
- autoload :SafeJsonifyFilter, "cloudcannon-jekyll/safe-jsonify-filter"
10
- autoload :VERSION, "cloudcannon-jekyll/version"
11
- end
5
+ require_relative "cloudcannon-jekyll/page-without-a-file"
6
+ require_relative "cloudcannon-jekyll/generator"
7
+ require_relative "cloudcannon-jekyll/configuration"
8
+ require_relative "cloudcannon-jekyll/jsonify-filter"
9
+ require_relative "cloudcannon-jekyll/version"
12
10
 
13
- Liquid::Template.register_filter(CloudCannonJekyll::SafeJsonifyFilter)
11
+ Liquid::Template.register_filter(CloudCannonJekyll::JsonifyFilter)
14
12
 
15
13
  # Hooks didn't exist in Jekyll 2 so we monkey patch to get an :after_reset hook
16
14
  if Jekyll::VERSION.start_with? "2"
@@ -0,0 +1,35 @@
1
+ {
2
+ "time": {{ site.time | cc_jsonify }},
3
+ "cloudcannon": {
4
+ "name": "cloudcannon-jekyll",
5
+ "version": {{ gem_version | cc_jsonify }}
6
+ },
7
+ {% if config.timezone %}"timezone": {{ config.timezone | cc_jsonify }},{% endif %}
8
+ "include": {{ config.include | cc_jsonify }},
9
+ "exclude": {{ config.exclude | cc_jsonify }},
10
+ {% if config.baseurl %}"base-url": {{ config.baseurl | cc_jsonify }},{% endif %}
11
+ {% if config.collections %}"comments": {{ config.collections | cc_jsonify: 'collections' }},{% endif %}
12
+ {% if config._comments %}"comments": {{ config._comments | cc_jsonify }},{% endif %}
13
+ {% if config._options %}"input-options": {{ config._options | cc_jsonify }},{% endif %}
14
+ {% if config.defaults %}"defaults": {{ config.defaults | cc_jsonify }},{% endif %}
15
+ {% if config._editor %}"editor": {
16
+ "default-path": {{ config._editor.default_path | cc_jsonify }}
17
+ },{% endif %}
18
+ {% if config._source_editor %}"source-editor": {
19
+ "tab-size": {{ config._source_editor.tab_size | cc_jsonify }},
20
+ "show-gutter": {{ config._source_editor.show_gutter | cc_jsonify }},
21
+ "theme": {{ config._source_editor.theme | cc_jsonify }}
22
+ },{% endif %}
23
+ {% if config._explore %}"explore": {{ config._explore | cc_jsonify }},{% endif %}
24
+ "paths": {
25
+ "uploads": {{ config.uploads_dir | cc_jsonify }},
26
+ "plugins": {{ config.plugins_dir | cc_jsonify }},
27
+ "data": {{ config.data_dir | cc_jsonify }},
28
+ "collections": {{ config.collections_dir | cc_jsonify }},
29
+ "includes": {{ config.includes_dir | cc_jsonify }},
30
+ "layouts": {{ config.layouts_dir | cc_jsonify }}
31
+ },
32
+ {% if config._array_structures %}"array-structures": {{ config._array_structures | cc_jsonify }},{% endif %}
33
+ {% assign select_data = config | cc_select_data_jsonify %}{% if select_data %}"select-data": {{ select_data }},{% endif %}
34
+ "source": {{ config.source | replace: pwd, "" | cc_jsonify }}
35
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "time": {{ site.time | cc_jsonify }},
3
+ "cloudcannon": {
4
+ "name": "cloudcannon-jekyll",
5
+ "version": {{ gem_version | cc_jsonify }}
6
+ },
7
+ {% if config.timezone %}"timezone": {{ config.timezone | cc_jsonify }},{% endif %}
8
+ "include": {{ config.include | cc_jsonify }},
9
+ "exclude": {{ config.exclude | cc_jsonify }},
10
+ {% if config.baseurl %}"base-url": {{ config.baseurl | cc_jsonify }},{% endif %}
11
+ {% if config.collections %}"comments": {{ config.collections | cc_jsonify: 'collections' }},{% endif %}
12
+ {% if config._comments %}"comments": {{ config._comments | cc_jsonify }},{% endif %}
13
+ {% if config._options %}"input-options": {{ config._options | cc_jsonify }},{% endif %}
14
+ {% if config.defaults %}"defaults": {{ config.defaults | cc_jsonify }},{% endif %}
15
+ {% if config._editor %}"editor": {
16
+ "default-path": {{ config._editor.default_path | cc_jsonify }}
17
+ },{% endif %}
18
+ {% if config._source_editor %}"source-editor": {
19
+ "tab-size": {{ config._source_editor.tab_size | cc_jsonify }},
20
+ "show-gutter": {{ config._source_editor.show_gutter | cc_jsonify }},
21
+ "theme": {{ config._source_editor.theme | cc_jsonify }}
22
+ },{% endif %}
23
+ {% if config._explore %}"explore": {{ config._explore | cc_jsonify }},{% endif %}
24
+ "paths": {
25
+ "uploads": {{ config.uploads_dir | cc_jsonify }},
26
+ "plugins": {{ config.plugins_dir | cc_jsonify }},
27
+ "data": {{ config.data_dir | cc_jsonify }},
28
+ "collections": {{ config.collections_dir | cc_jsonify }},
29
+ "includes": {{ config.includes_dir | cc_jsonify }},
30
+ "layouts": {{ config.layouts_dir | cc_jsonify }}
31
+ },
32
+ {% if config._array_structures %}"array-structures": {{ config._array_structures | cc_jsonify }},{% endif %}
33
+ {% assign select_data = config | cc_select_data_jsonify %}{% if select_data %}"select-data": {{ select_data }},{% endif %}
34
+ "source": {{ config.source | replace: pwd, "" | cc_jsonify }}
35
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "time": {{ site.time | cc_jsonify }},
3
+ "cloudcannon": {
4
+ "name": "cloudcannon-jekyll",
5
+ "version": {{ gem_version | cc_jsonify }}
6
+ },
7
+ {% if config.timezone -%}
8
+ "timezone": {{ config.timezone | cc_jsonify }},
9
+ {%- endif %}
10
+ "include": {{ config.include | cc_jsonify }},
11
+ "exclude": {{ config.exclude | cc_jsonify }},
12
+ {% if config.baseurl -%}
13
+ "base-url": {{ config.baseurl | cc_jsonify }},
14
+ {%- endif %}
15
+ {% if config.collections -%}
16
+ "collections": {{ config.collections | cc_jsonify: 'collections' }},
17
+ {%- endif %}
18
+ {% if config._comments -%}
19
+ "comments": {{ config._comments | cc_jsonify }},
20
+ {%- endif %}
21
+ {% if config._options -%}
22
+ "input-options": {{ config._options | cc_jsonify }},
23
+ {%- endif %}
24
+ {% if config.defaults -%}
25
+ "defaults": {{ config.defaults | cc_jsonify }},
26
+ {%- endif %}
27
+ {% if config._editor -%}
28
+ "editor": {
29
+ "default-path": {{ config._editor.default_path | cc_jsonify }}
30
+ },
31
+ {%- endif %}
32
+ {% if config._source_editor -%}
33
+ "source-editor": {
34
+ "tab-size": {{ config._source_editor.tab_size | cc_jsonify }},
35
+ "show-gutter": {{ config._source_editor.show_gutter | cc_jsonify }},
36
+ "theme": {{ config._source_editor.theme | cc_jsonify }}
37
+ },
38
+ {%- endif %}
39
+ {% if config._explore -%}
40
+ "explore": {{ config._explore | cc_jsonify }},
41
+ {%- endif %}
42
+ "paths": {
43
+ "uploads": {{ config.uploads_dir | cc_jsonify }},
44
+ "plugins": {{ config.plugins_dir | cc_jsonify }},
45
+ "data": {{ config.data_dir | cc_jsonify }},
46
+ "collections": {{ config.collections_dir | cc_jsonify }},
47
+ "includes": {{ config.includes_dir | cc_jsonify }},
48
+ "layouts": {{ config.layouts_dir | cc_jsonify }}
49
+ },
50
+ {% if config._array_structures -%}
51
+ "array-structures": {{ config._array_structures | cc_jsonify }},
52
+ {%- endif %}
53
+ {% assign select_data = config | cc_select_data_jsonify -%}
54
+ {% if select_data -%}
55
+ "select-data": {{ select_data }},
56
+ {%- endif %}
57
+ "source": {{ config.source | replace: pwd, "" | cc_jsonify }}
58
+ }
@@ -1,25 +1,27 @@
1
1
  {
2
- "time": {{ site.time | jsonify }},
2
+ "time": {{ site.time | cc_jsonify }},
3
3
  "cloudcannon": {
4
4
  "name": "cloudcannon-jekyll",
5
- "version": {{ gem_version | jsonify }}
5
+ "version": {{ gem_version | cc_jsonify }}
6
6
  },
7
7
  "generator": {
8
8
  "name": "jekyll",
9
- "version": {{ jekyll.version | jsonify }},
10
- "environment": {{ jekyll.env | jsonify }},
9
+ "version": {{ jekyll.version | cc_jsonify }},
10
+ "environment": {{ jekyll.env | cc_jsonify }},
11
11
  "metadata": {
12
- "markdown": {{ site.markdown | cc_safe_jsonify }},
13
- "kramdown": {{ site.kramdown | cc_safe_jsonify }},
14
- "commonmark": {{ site.commonmark | cc_safe_jsonify }}
12
+ "markdown": {{ site.markdown | cc_jsonify }},
13
+ "kramdown": {{ site.kramdown | cc_jsonify }},
14
+ "commonmark": {{ site.commonmark | cc_jsonify }}
15
15
  }
16
- },{% if site.cloudcannon.data %}
17
- "data": {{ site.data | cc_safe_jsonify }},{% endif %}
16
+ },{% if site.cloudcannon.data.first %}{% assign data_seen = false %}
17
+ "data": {
18
+ {% for data in site.data %}{% assign key = data[0] %}{% if site.cloudcannon.data[key] %}{% if data_seen %},{% endif %}{{ data[0] | cc_jsonify }}: {{ data[1] | cc_jsonify }}{% assign data_seen = true %}{% endif %}{% endfor %}},
19
+ {% elsif site.cloudcannon.data %}"data": {{ site.data | cc_jsonify }},{% endif %}
18
20
  "collections": {
19
- "posts": {{ site.posts | reverse | cc_safe_jsonify }},
20
- {% for collection in site.collections %}"{{ collection[0] | xml_escape }}": {{ collection[1].docs | cc_safe_jsonify }}{% unless forloop.last %},{% endunless %}
21
+ "posts": {{ site.posts | reverse | cc_jsonify }}{% if site.collections.size > 0 %},{% endif %}
22
+ {% for collection in site.collections %}"{{ collection[0] | xml_escape }}": {{ collection[1].docs | cc_jsonify }}{% unless forloop.last %},{% endunless %}
21
23
  {% endfor %}
22
24
  },
23
- "pages": {{ site.pages | cc_safe_jsonify }},
25
+ "pages": {{ site.pages | cc_jsonify }},
24
26
  "static": {{ site.static_files | cc_static_files_jsonify }}
25
27
  }
@@ -0,0 +1,26 @@
1
+ {
2
+ "time": {{ site.time | cc_jsonify }},
3
+ "cloudcannon": {
4
+ "name": "cloudcannon-jekyll",
5
+ "version": {{ gem_version | cc_jsonify }}
6
+ },
7
+ "generator": {
8
+ "name": "jekyll",
9
+ "version": {{ jekyll.version | cc_jsonify }},
10
+ "environment": {{ jekyll.env | cc_jsonify }},
11
+ "metadata": {
12
+ "markdown": {{ site.markdown | cc_jsonify }},
13
+ "kramdown": {{ site.kramdown | cc_jsonify }},
14
+ "commonmark": {{ site.commonmark | cc_jsonify }}
15
+ }
16
+ },{% if site.cloudcannon.data.first %}{% assign data_seen = false %}
17
+ "data": {
18
+ {% for data in site.data %}{% assign key = data[0] %}{% if site.cloudcannon.data[key] %}{% if data_seen %},{% endif %}{{ data[0] | cc_jsonify }}: {{ data[1] | cc_jsonify }}{% assign data_seen = true %}{% endif %}{% endfor %}},
19
+ {% elsif site.cloudcannon.data %}"data": {{ site.data | cc_jsonify }},{% endif %}
20
+ "collections": {
21
+ {% for collection in site.collections %}"{{ collection.label | xml_escape }}": {{ collection.docs | cc_jsonify }}{% unless forloop.last %},{% endunless %}
22
+ {% endfor %}
23
+ },
24
+ "pages": {{ site.pages | cc_jsonify }},
25
+ "static": {{ site.static_files | cc_static_files_jsonify }}
26
+ }
@@ -1,28 +1,40 @@
1
1
  {
2
- "time": {{ site.time | jsonify }},
2
+ "time": {{ site.time | cc_jsonify }},
3
3
  "cloudcannon": {
4
4
  "name": "cloudcannon-jekyll",
5
- "version": {{ gem_version | jsonify }}
5
+ "version": {{ gem_version | cc_jsonify }}
6
6
  },
7
7
  "generator": {
8
8
  "name": "jekyll",
9
- "version": {{ jekyll.version | jsonify }},
10
- "environment": {{ jekyll.env | jsonify }},
9
+ "version": {{ jekyll.version | cc_jsonify }},
10
+ "environment": {{ jekyll.env | cc_jsonify }},
11
11
  "metadata": {
12
- "markdown": {{ site.markdown | cc_safe_jsonify }},
13
- "kramdown": {{ site.kramdown | cc_safe_jsonify }},
14
- "commonmark": {{ site.commonmark | cc_safe_jsonify }}
12
+ "markdown": {{ site.markdown | cc_jsonify }},
13
+ "kramdown": {{ site.kramdown | cc_jsonify }},
14
+ "commonmark": {{ site.commonmark | cc_jsonify }}
15
15
  }
16
16
  },
17
- {%- if site.cloudcannon.data %}
18
- "data": {{ site.data | cc_safe_jsonify }},
19
- {% endif %}
17
+ {% if site.cloudcannon.data.first -%}
18
+ "data": {
19
+ {%- assign data_seen = false %}
20
+ {%- for data in site.data %}
21
+ {%- assign key = data[0] %}
22
+ {%- if site.cloudcannon.data[key] %}
23
+ {%- if data_seen %},{% endif -%}
24
+ {{ data[0] | cc_jsonify }}: {{ data[1] | cc_jsonify }}
25
+ {%- assign data_seen = true %}
26
+ {%- endif %}
27
+ {%- endfor -%}
28
+ },
29
+ {% elsif site.cloudcannon.data -%}
30
+ "data": {{ site.data | cc_jsonify }},
31
+ {%- endif %}
20
32
  "collections": {
21
- {% for collection in site.collections -%}
22
- "{{ collection.label | xml_escape }}": {{ collection.docs | cc_safe_jsonify }}
33
+ {%- for collection in site.collections -%}
34
+ "{{ collection.label | xml_escape }}": {{ collection.docs | cc_jsonify }}
23
35
  {%- unless forloop.last %},{% endunless %}
24
- {%- endfor %}
36
+ {%- endfor -%}
25
37
  },
26
- "pages": {{ site.pages | cc_safe_jsonify }},
38
+ "pages": {{ site.pages | cc_jsonify }},
27
39
  "static": {{ site.static_files | cc_static_files_jsonify }}
28
40
  }
@@ -9,33 +9,53 @@ module CloudCannonJekyll
9
9
 
10
10
  def generate(site)
11
11
  @site = site
12
- FileUtils.mkdir_p(File.dirname(destination_path))
13
- File.open(destination_path, "w") { |f| f.write(file_content) }
12
+
13
+ payload = @site.site_payload.merge({
14
+ "gem_version" => CloudCannonJekyll::VERSION,
15
+ "pwd" => Dir.pwd,
16
+ "config" => @site.config,
17
+ })
18
+
19
+ generate_file("details", payload)
20
+ generate_file("config", payload)
21
+
14
22
  @site.keep_files ||= []
15
- @site.keep_files << "_cloudcannon/details.json"
23
+ @site.keep_files << path("details")
24
+ @site.keep_files << path("config")
25
+ end
26
+
27
+ def generate_file(filename, data)
28
+ dest = destination_path(filename)
29
+ FileUtils.mkdir_p(File.dirname(dest))
30
+ File.open(dest, "w") { |f| f.write(file_content(filename, data)) }
16
31
  end
17
32
 
18
- def source_path
19
- path = "_cloudcannon/details.json"
20
- path = "_cloudcannon/details-2.x.json" if Jekyll::VERSION.start_with? "2."
21
- path = "_cloudcannon/details-3.0.x.json" unless (%r!3\.[0-4]\.! =~ Jekyll::VERSION).nil?
33
+ def version_path_suffix
34
+ return "-2.x" if Jekyll::VERSION.start_with? "2."
35
+ return "-3.0-4.x" if %r!3\.[0-4]\.! =~ Jekyll::VERSION
22
36
 
23
- File.expand_path(path, File.dirname(__FILE__))
37
+ ""
24
38
  end
25
39
 
26
- def destination_path
27
- Jekyll.sanitized_path(@site.dest, "_cloudcannon/details.json")
40
+ def path(filename, suffix = "")
41
+ "_cloudcannon/#{filename}#{suffix}.json"
28
42
  end
29
43
 
30
- def file_content
31
- json = PageWithoutAFile.new(@site, File.dirname(__FILE__), "", "_cloudcannon/details.json")
32
- json.content = File.read(source_path)
44
+ def source_path(filename)
45
+ File.expand_path(path(filename, version_path_suffix), File.dirname(__FILE__))
46
+ end
47
+
48
+ def destination_path(filename)
49
+ Jekyll.sanitized_path(@site.dest, path(filename))
50
+ end
33
51
 
52
+ def file_content(filename, data)
53
+ json = PageWithoutAFile.new(@site, File.dirname(__FILE__), "", path(filename))
54
+ json.content = File.read(source_path(filename))
34
55
  json.data["layout"] = nil
35
56
  json.data["sitemap"] = false
36
- json.data["permalink"] = "/_cloudcannon/details.json"
37
-
38
- json.render({}, @site.site_payload.merge("gem_version" => CloudCannonJekyll::VERSION))
57
+ json.data["permalink"] = "/#{path(filename)}"
58
+ json.render({}, data)
39
59
  json.output
40
60
  end
41
61
  end
@@ -0,0 +1,218 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "jekyll"
4
+
5
+ module CloudCannonJekyll
6
+ module JsonifyFilter
7
+ CC_JSONIFY_KEY_SWAPS = {
8
+ "collections" => {
9
+ "_sort_key" => "_sort-key",
10
+ "_subtext_key" => "_subtext-key",
11
+ "_image_key" => "_image-key",
12
+ "_image_size" => "_image-size",
13
+ "_singular_name" => "_singular-name",
14
+ "_singular_key" => "_singular-key",
15
+ "_disable_add" => "_disable-add",
16
+ "_add_options" => "_add-options",
17
+ },
18
+ }.freeze
19
+
20
+ @simple_types = [
21
+ String,
22
+ Numeric,
23
+ Integer,
24
+ Float,
25
+ Date,
26
+ Time,
27
+ NilClass,
28
+ Object.const_defined?("Fixnum") ? Fixnum : nil,
29
+ ].compact.freeze
30
+
31
+ @document_types = [
32
+ Jekyll::Document,
33
+ Jekyll::Page,
34
+ Jekyll::VERSION.start_with?("2.") ? Jekyll::Post : nil,
35
+ ].compact.freeze
36
+
37
+ def self.document_type?(input)
38
+ @document_types.include?(input.class)
39
+ end
40
+
41
+ def self.simple_type?(input)
42
+ @simple_types.include?(input.class) || [true, false].include?(input)
43
+ end
44
+
45
+ def self.static_file_to_json(input, depth)
46
+ out = [
47
+ "\"extname\": #{JsonifyFilter.to_json(input.extname, depth + 1)}",
48
+ "\"path\": #{JsonifyFilter.to_json(input.relative_path, depth + 1)}",
49
+ ]
50
+
51
+ # modified_time isn't defined in Jekyll 2.4.0
52
+ if input.respond_to? :modified_time
53
+ out.push("\"modified_time\": #{JsonifyFilter.to_json(input.modified_time, depth + 1)}")
54
+ end
55
+
56
+ "{#{out.join(",")}}"
57
+ end
58
+
59
+ def self.document_data_to_json(data, out, prevent, depth)
60
+ prevent += %w(content output next previous excerpt)
61
+
62
+ data.each do |key, value|
63
+ next if prevent.include? key
64
+
65
+ prevent.push key
66
+ out.push("#{key.to_json}: #{JsonifyFilter.to_json(value, depth + 1)}")
67
+ end
68
+
69
+ "{#{out.join(",")}}"
70
+ end
71
+
72
+ def self.legacy_post_to_json(input, depth)
73
+ prevent = %w(dir name path url date id categories tags)
74
+
75
+ out = [
76
+ "\"dir\": #{JsonifyFilter.to_json(input.dir, depth + 1)}",
77
+ "\"name\": #{JsonifyFilter.to_json(input.name, depth + 1)}",
78
+ "\"path\": #{JsonifyFilter.to_json(input.path, depth + 1)}",
79
+ "\"url\": #{JsonifyFilter.to_json(input.url, depth + 1)}",
80
+ "\"date\": #{JsonifyFilter.to_json(input.date, depth + 1)}",
81
+ "\"id\": #{JsonifyFilter.to_json(input.id, depth + 1)}",
82
+ "\"categories\": #{JsonifyFilter.to_json(input.categories, depth + 1)}",
83
+ "\"tags\": #{JsonifyFilter.to_json(input.tags, depth + 1)}",
84
+ ]
85
+
86
+ JsonifyFilter.document_data_to_json(input.data, out, prevent, depth)
87
+ end
88
+
89
+ def self.page_to_json(input, depth)
90
+ prevent = %w(dir name path url)
91
+
92
+ out = [
93
+ "\"dir\": #{JsonifyFilter.to_json(input.dir, depth + 1)}",
94
+ "\"name\": #{JsonifyFilter.to_json(input.name, depth + 1)}",
95
+ "\"path\": #{JsonifyFilter.to_json(input.path, depth + 1)}",
96
+ "\"url\": #{JsonifyFilter.to_json(input.url, depth + 1)}",
97
+ ]
98
+
99
+ # Merge Jekyll Defaults into data for pages (missing at v3.8.5)
100
+ defaults = input.site.frontmatter_defaults.all(input.relative_path, :pages).tap do |h|
101
+ h.delete("date")
102
+ end
103
+
104
+ data = Jekyll::Utils.deep_merge_hashes(defaults, input.data)
105
+ JsonifyFilter.document_data_to_json(data, out, prevent, depth)
106
+ end
107
+
108
+ def self.document_to_json(input, depth)
109
+ prevent = %w(dir id relative_path url collection)
110
+
111
+ out = [
112
+ "\"path\": #{JsonifyFilter.to_json(input.relative_path, depth + 1)}",
113
+ "\"relative_path\": #{JsonifyFilter.to_json(input.relative_path, depth + 1)}",
114
+ "\"url\": #{JsonifyFilter.to_json(input.url, depth + 1)}",
115
+ ]
116
+
117
+ unless input.collection.nil?
118
+ out.push("\"collection\": #{JsonifyFilter.to_json(input.collection.label, depth + 1)}")
119
+ end
120
+
121
+ # id isn't defined in Jekyll 2.4.0
122
+ out.push("\"id\": #{JsonifyFilter.to_json(input.id, depth + 1)}") if input.respond_to? :id
123
+
124
+ JsonifyFilter.document_data_to_json(input.data, out, prevent, depth)
125
+ end
126
+
127
+ def self.array_to_json(input, depth, key_swaps = {})
128
+ array = input.map do |value|
129
+ JsonifyFilter.to_json(value, depth + 1, key_swaps)
130
+ end
131
+
132
+ "[#{array.join(",")}]"
133
+ end
134
+
135
+ def self.hash_to_json(input, depth, key_swaps = {})
136
+ hash = input.map do |key, value|
137
+ "#{(key_swaps[key] || key).to_json}: #{JsonifyFilter.to_json(value, depth + 1, key_swaps)}"
138
+ end
139
+
140
+ "{#{hash.join(",")}}"
141
+ end
142
+
143
+ def self.config_to_select_data_json(input, depth)
144
+ prevent = %w(source destination collections_dir cache_dir plugins_dir layouts_dir data_dir
145
+ includes_dir collections safe include exclude keep_files encoding markdown_ext
146
+ strict_front_matter show_drafts limit_posts future unpublished whitelist
147
+ plugins markdown highlighter lsi excerpt_separator incremental detach port host
148
+ baseurl show_dir_listing permalink paginate_path timezone quiet verbose defaults
149
+ liquid kramdown title url description uploads_dir _comments _options _editor
150
+ _explore _source_editor _array_structures maruku redcloth rdiscount redcarpet
151
+ gems plugins)
152
+
153
+ out = input.map do |key, value|
154
+ next unless value.is_a?(Array) || value.is_a?(Hash)
155
+ next if prevent.include? key
156
+
157
+ prevent.push key
158
+ "#{key.to_json}: #{JsonifyFilter.to_json(value, depth + 1)}"
159
+ end
160
+
161
+ out.compact!
162
+
163
+ "{#{out.join(",")}}" if out.any?
164
+ end
165
+
166
+ def self.to_json(input, depth, key_swaps = {})
167
+ if depth > 8 || (depth > 2 && JsonifyFilter.document_type?(input))
168
+ '"MAXIMUM_DEPTH"'
169
+ elsif JsonifyFilter.simple_type?(input)
170
+ input.to_json
171
+ elsif input.is_a?(Jekyll::StaticFile)
172
+ JsonifyFilter.static_file_to_json(input, depth)
173
+ elsif input.is_a?(Jekyll::Page)
174
+ JsonifyFilter.page_to_json(input, depth)
175
+ elsif Jekyll::VERSION.start_with?("2.") && input.is_a?(Jekyll::Post)
176
+ JsonifyFilter.legacy_post_to_json(input, depth)
177
+ elsif input.is_a?(Jekyll::Document)
178
+ JsonifyFilter.document_to_json(input, depth)
179
+ elsif input.is_a?(Array)
180
+ JsonifyFilter.array_to_json(input, depth, key_swaps)
181
+ elsif input.is_a?(Hash)
182
+ JsonifyFilter.hash_to_json(input, depth, key_swaps)
183
+ else
184
+ input.class.to_s.prepend("UNSUPPORTED:").to_json
185
+ end
186
+ end
187
+
188
+ def cc_static_files_jsonify(input)
189
+ out = []
190
+ input.each do |page|
191
+ next if page.extname != ".html" &&
192
+ page.extname != ".htm" &&
193
+ page.path != "/robots.txt" &&
194
+ page.path != "/sitemap.xml"
195
+
196
+ out.push(JsonifyFilter.to_json(page, 1))
197
+ end
198
+
199
+ "[#{out.join(",")}]"
200
+ end
201
+
202
+ def cc_select_data_jsonify(input)
203
+ if input.key? "_select_data"
204
+ JsonifyFilter.to_json(input["_select_data"], 0)
205
+ else
206
+ JsonifyFilter.config_to_select_data_json(input, 0)
207
+ end
208
+ end
209
+
210
+ def cc_jsonify(input, key_swaps_key = nil)
211
+ if CC_JSONIFY_KEY_SWAPS.key? key_swaps_key
212
+ JsonifyFilter.to_json(input, 0, CC_JSONIFY_KEY_SWAPS[key_swaps_key])
213
+ else
214
+ JsonifyFilter.to_json(input, 0)
215
+ end
216
+ end
217
+ end
218
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CloudCannonJekyll
4
- VERSION = "0.0.6"
4
+ VERSION = "0.2.1"
5
5
  end
@@ -0,0 +1,10 @@
1
+ #!/bin/sh
2
+
3
+ set -ex
4
+
5
+ # Checks to see the build is likely to fail on Travis.
6
+ # Duplicated the versions from .travis.yml
7
+
8
+ JEKYLL_VERSION=2.4.0 bundle update && $(dirname "$0")/test &&
9
+ JEKYLL_VERSION=3.0.0 bundle update && $(dirname "$0")/test &&
10
+ JEKYLL_VERSION=3.2.1 bundle update && $(dirname "$0")/test
@@ -2,6 +2,5 @@
2
2
 
3
3
  set -ex
4
4
 
5
- bundle exec rspec "$@"
6
- bundle exec rubocop -S
5
+ $(dirname "$0")/test
7
6
  bundle exec gem build cloudcannon-jekyll.gemspec
@@ -33,5 +33,7 @@ git fetch -t origin
33
33
 
34
34
  # Push tag and upload new gem
35
35
 
36
- gem push cloudcannon-jekyll-*.gem && git tag "$tag" &&
37
- git push origin master && git push origin "$tag"
36
+ git tag "$tag" &&
37
+ git push origin master &&
38
+ git push origin "$tag" &&
39
+ gem push cloudcannon-jekyll-*.gem
@@ -3,3 +3,4 @@
3
3
  set -ex
4
4
 
5
5
  bundle exec rspec "$@"
6
+ bundle exec rubocop -S
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudcannon-jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - CloudCannon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-21 00:00:00.000000000 Z
11
+ date: 2020-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -30,6 +30,20 @@ dependencies:
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '4'
33
+ - !ruby/object:Gem::Dependency
34
+ name: json_schemer
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: 0.2.4
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: 0.2.4
33
47
  - !ruby/object:Gem::Dependency
34
48
  name: rake
35
49
  requirement: !ruby/object:Gem::Requirement
@@ -64,28 +78,28 @@ dependencies:
64
78
  requirements:
65
79
  - - "~>"
66
80
  - !ruby/object:Gem::Version
67
- version: '0.71'
81
+ version: '0.80'
68
82
  type: :development
69
83
  prerelease: false
70
84
  version_requirements: !ruby/object:Gem::Requirement
71
85
  requirements:
72
86
  - - "~>"
73
87
  - !ruby/object:Gem::Version
74
- version: '0.71'
88
+ version: '0.80'
75
89
  - !ruby/object:Gem::Dependency
76
90
  name: rubocop-jekyll
77
91
  requirement: !ruby/object:Gem::Requirement
78
92
  requirements:
79
93
  - - "~>"
80
94
  - !ruby/object:Gem::Version
81
- version: '0.10'
95
+ version: '0.11'
82
96
  type: :development
83
97
  prerelease: false
84
98
  version_requirements: !ruby/object:Gem::Requirement
85
99
  requirements:
86
100
  - - "~>"
87
101
  - !ruby/object:Gem::Version
88
- version: '0.10'
102
+ version: '0.11'
89
103
  description: Creates CloudCannon editor details for Jekyll
90
104
  email:
91
105
  - support@cloudcannon.com
@@ -104,14 +118,18 @@ files:
104
118
  - Rakefile
105
119
  - cloudcannon-jekyll.gemspec
106
120
  - lib/cloudcannon-jekyll.rb
121
+ - lib/cloudcannon-jekyll/_cloudcannon/config-2.x.json
122
+ - lib/cloudcannon-jekyll/_cloudcannon/config-3.0-4.x.json
123
+ - lib/cloudcannon-jekyll/_cloudcannon/config.json
107
124
  - lib/cloudcannon-jekyll/_cloudcannon/details-2.x.json
108
- - lib/cloudcannon-jekyll/_cloudcannon/details-3.0.x.json
125
+ - lib/cloudcannon-jekyll/_cloudcannon/details-3.0-4.x.json
109
126
  - lib/cloudcannon-jekyll/_cloudcannon/details.json
110
127
  - lib/cloudcannon-jekyll/configuration.rb
111
128
  - lib/cloudcannon-jekyll/generator.rb
129
+ - lib/cloudcannon-jekyll/jsonify-filter.rb
112
130
  - lib/cloudcannon-jekyll/page-without-a-file.rb
113
- - lib/cloudcannon-jekyll/safe-jsonify-filter.rb
114
131
  - lib/cloudcannon-jekyll/version.rb
132
+ - script/ci-smoke-test
115
133
  - script/cibuild
116
134
  - script/release
117
135
  - script/test
@@ -134,8 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
152
  - !ruby/object:Gem::Version
135
153
  version: '0'
136
154
  requirements: []
137
- rubyforge_project:
138
- rubygems_version: 2.7.6.2
155
+ rubygems_version: 3.0.3
139
156
  signing_key:
140
157
  specification_version: 4
141
158
  summary: CloudCannon Jekyll integration
@@ -1,24 +0,0 @@
1
- {
2
- "time": {{ site.time | jsonify }},
3
- "cloudcannon": {
4
- "name": "cloudcannon-jekyll",
5
- "version": {{ gem_version | jsonify }}
6
- },
7
- "generator": {
8
- "name": "jekyll",
9
- "version": {{ jekyll.version | jsonify }},
10
- "environment": {{ jekyll.env | jsonify }},
11
- "metadata": {
12
- "markdown": {{ site.markdown | cc_safe_jsonify }},
13
- "kramdown": {{ site.kramdown | cc_safe_jsonify }},
14
- "commonmark": {{ site.commonmark | cc_safe_jsonify }}
15
- }
16
- },{% if site.cloudcannon.data %}
17
- "data": {{ site.data | cc_safe_jsonify }},{% endif %}
18
- "collections": {
19
- {% for collection in site.collections %}"{{ collection.label | xml_escape }}": {{ collection.docs | cc_safe_jsonify }}{% unless forloop.last %},{% endunless %}
20
- {% endfor %}
21
- },
22
- "pages": {{ site.pages | cc_safe_jsonify }},
23
- "static": {{ site.static_files | cc_static_files_jsonify }}
24
- }
@@ -1,170 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "jekyll"
4
-
5
- module CloudCannonJekyll
6
- module SafeJsonifyFilter
7
- @simple_types = [
8
- String,
9
- Numeric,
10
- Integer,
11
- Float,
12
- Date,
13
- Time,
14
- NilClass,
15
- Object.const_defined?("Fixnum") ? Fixnum : nil,
16
- ].compact.freeze
17
-
18
- @document_types = [
19
- Jekyll::Document,
20
- Jekyll::Page,
21
- Jekyll::VERSION.start_with?("2.") ? Jekyll::Post : nil,
22
- ].compact.freeze
23
-
24
- def self.document_type?(input)
25
- @document_types.include?(input.class)
26
- end
27
-
28
- def self.simple_type?(input)
29
- @simple_types.include?(input.class) || [true, false].include?(input)
30
- end
31
-
32
- def self.static_file_to_json(input, depth)
33
- out = [
34
- "\"extname\": #{SafeJsonifyFilter.to_json(input.extname, depth + 1)}",
35
- "\"path\": #{SafeJsonifyFilter.to_json(input.relative_path, depth + 1)}",
36
- ]
37
-
38
- # modified_time isn't defined in Jekyll 2.4.0
39
- if input.respond_to? :modified_time
40
- out.push("\"modified_time\": #{SafeJsonifyFilter.to_json(input.modified_time, depth + 1)}")
41
- end
42
-
43
- "{#{out.join(",")}}"
44
- end
45
-
46
- def self.document_data_to_json(data, out, prevent, depth)
47
- prevent += %w(content output next previous excerpt)
48
-
49
- data.map do |key, value|
50
- unless prevent.include? key
51
- out.push("\"#{key}\": #{SafeJsonifyFilter.to_json(value, depth + 1)}")
52
- prevent.push(key)
53
- end
54
- end
55
-
56
- "{#{out.join(",")}}"
57
- end
58
-
59
- def self.legacy_post_to_json(input, depth)
60
- prevent = %w(dir name path url date id categories tags)
61
-
62
- out = [
63
- "\"dir\": #{SafeJsonifyFilter.to_json(input.dir, depth + 1)}",
64
- "\"name\": #{SafeJsonifyFilter.to_json(input.name, depth + 1)}",
65
- "\"path\": #{SafeJsonifyFilter.to_json(input.path, depth + 1)}",
66
- "\"url\": #{SafeJsonifyFilter.to_json(input.url, depth + 1)}",
67
- "\"date\": #{SafeJsonifyFilter.to_json(input.date, depth + 1)}",
68
- "\"id\": #{SafeJsonifyFilter.to_json(input.id, depth + 1)}",
69
- "\"categories\": #{SafeJsonifyFilter.to_json(input.categories, depth + 1)}",
70
- "\"tags\": #{SafeJsonifyFilter.to_json(input.tags, depth + 1)}",
71
- ]
72
-
73
- SafeJsonifyFilter.document_data_to_json(input.data, out, prevent, depth)
74
- end
75
-
76
- def self.page_to_json(input, depth)
77
- prevent = %w(dir name path url)
78
-
79
- out = [
80
- "\"dir\": #{SafeJsonifyFilter.to_json(input.dir, depth + 1)}",
81
- "\"name\": #{SafeJsonifyFilter.to_json(input.name, depth + 1)}",
82
- "\"path\": #{SafeJsonifyFilter.to_json(input.path, depth + 1)}",
83
- "\"url\": #{SafeJsonifyFilter.to_json(input.url, depth + 1)}",
84
- ]
85
-
86
- # Merge Jekyll Defaults into data for pages (missing at v3.8.5)
87
- defaults = input.site.frontmatter_defaults.all(input.relative_path, :pages).tap do |h|
88
- h.delete("date")
89
- end
90
-
91
- data = Jekyll::Utils.deep_merge_hashes(defaults, input.data)
92
- SafeJsonifyFilter.document_data_to_json(data, out, prevent, depth)
93
- end
94
-
95
- def self.document_to_json(input, depth)
96
- prevent = %w(dir id relative_path url collection)
97
-
98
- out = [
99
- "\"path\": #{SafeJsonifyFilter.to_json(input.relative_path, depth + 1)}",
100
- "\"relative_path\": #{SafeJsonifyFilter.to_json(input.relative_path, depth + 1)}",
101
- "\"url\": #{SafeJsonifyFilter.to_json(input.url, depth + 1)}",
102
- ]
103
-
104
- unless input.collection.nil?
105
- out.push("\"collection\": #{SafeJsonifyFilter.to_json(input.collection.label, depth + 1)}")
106
- end
107
-
108
- # id isn't defined in Jekyll 2.4.0
109
- out.push("\"id\": #{SafeJsonifyFilter.to_json(input.id, depth + 1)}") if input.respond_to? :id
110
-
111
- SafeJsonifyFilter.document_data_to_json(input.data, out, prevent, depth)
112
- end
113
-
114
- def self.array_to_json(input, depth)
115
- array = input.map do |value|
116
- SafeJsonifyFilter.to_json(value, depth + 1)
117
- end
118
-
119
- "[#{array.join(",")}]"
120
- end
121
-
122
- def self.hash_to_json(input, depth)
123
- hash = input.map do |key, value|
124
- "\"#{key}\": #{SafeJsonifyFilter.to_json(value, depth + 1)}"
125
- end
126
-
127
- "{#{hash.join(",")}}"
128
- end
129
-
130
- def self.to_json(input, depth)
131
- if depth > 8 || (depth > 2 && SafeJsonifyFilter.document_type?(input))
132
- '"MAXIMUM_DEPTH"'
133
- elsif SafeJsonifyFilter.simple_type?(input)
134
- input.to_json
135
- elsif input.is_a?(Jekyll::StaticFile)
136
- SafeJsonifyFilter.static_file_to_json(input, depth)
137
- elsif input.is_a?(Jekyll::Page)
138
- SafeJsonifyFilter.page_to_json(input, depth)
139
- elsif Jekyll::VERSION.start_with?("2.") && input.is_a?(Jekyll::Post)
140
- SafeJsonifyFilter.legacy_post_to_json(input, depth)
141
- elsif input.is_a?(Jekyll::Document)
142
- SafeJsonifyFilter.document_to_json(input, depth)
143
- elsif input.is_a?(Array)
144
- SafeJsonifyFilter.array_to_json(input, depth)
145
- elsif input.is_a?(Hash)
146
- SafeJsonifyFilter.hash_to_json(input, depth)
147
- else
148
- "\"UNSUPPORTED:#{input.class}\""
149
- end
150
- end
151
-
152
- def cc_static_files_jsonify(input)
153
- out = []
154
- input.each do |page|
155
- next if page.extname != ".html" &&
156
- page.extname != ".htm" &&
157
- page.path != "/robots.txt" &&
158
- page.path != "/sitemap.xml"
159
-
160
- out.push(SafeJsonifyFilter.to_json(page, 1))
161
- end
162
-
163
- "[#{out.join(",")}]"
164
- end
165
-
166
- def cc_safe_jsonify(input)
167
- SafeJsonifyFilter.to_json(input, 0)
168
- end
169
- end
170
- end