cloudcannon-jekyll 0.1.0 → 0.2.0

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
- SHA256:
3
- metadata.gz: 9af7a56d0f7ae1c2fbf46678eef968a8ea4d906a88394b2704093b8d6a375017
4
- data.tar.gz: ed492b3cc15a707238dc083be5063c20f7e9c6664fb545f8e4fc7bed54c90b05
2
+ SHA1:
3
+ metadata.gz: 71e33735df4c89f5a837224c14fc5830262d6296
4
+ data.tar.gz: 748068f64fd86fb1514533a9b84f8576c7cd79e1
5
5
  SHA512:
6
- metadata.gz: a38d6d1a314062fe832fed516f188da8d0a299f0e8a41e3701b1cf1166d50b88a5ef34a1828eec093993803be5c8ac21937da77b876d6f0840610e28ac7593fd
7
- data.tar.gz: b49cec3b53386c5422cffc485d610d386c0cb692078890abf1b030f764afc55b3329d5ebe53c28815a73d5b2e55bcb7127d02945cb16d230e03ef7cdefc5e031
6
+ metadata.gz: '0872a4182a09614927851140c865ad761c5f2ee41c8e79798ad27efc08ef270b1ec9acf60c75da436aea327cf4e11cade050f308921807116fb18e8d8d07fbe5'
7
+ data.tar.gz: 6f9207baa8d6084af8a968c2aad4f3d7c9e16e1ec6283408c372e5db156cc890b75e9f22cd98e59619f37172d4981fb859b728f5935d0d3fac40ad17b589ee0e
@@ -25,3 +25,8 @@ AllCops:
25
25
  Naming/MemoizedInstanceVariableName:
26
26
  Exclude:
27
27
  - lib/cloudcannon-jekyll/page-without-a-file.rb
28
+
29
+ # This is excluded since the ruby target is 2.3.8 which doesn't support String.match?(Regexp)
30
+ Performance/RegexpMatch:
31
+ Exclude:
32
+ - lib/cloudcannon-jekyll/generator.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,3 +15,4 @@ env:
15
15
  matrix:
16
16
  - JEKYLL_VERSION="2.4.0"
17
17
  - JEKYLL_VERSION="3.0.0"
18
+ - JEKYLL_VERSION="3.2.1"
data/HISTORY.md CHANGED
@@ -1,3 +1,10 @@
1
+ # 0.2.0
2
+
3
+ * Add defaults and input-options keys to config output
4
+ * Add more ignore keys for legacy select data filter
5
+ * Reduce methods added from other plugins clashing
6
+ * Fix invalid output when unsupported class found
7
+
1
8
  # 0.1.0
2
9
 
3
10
  * Add output config file
@@ -25,5 +25,5 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency "rspec", "~> 3.9"
26
26
  spec.add_development_dependency "rubocop", "~> 0.80"
27
27
  spec.add_development_dependency "rubocop-jekyll", "~> 0.11"
28
- spec.add_development_dependency "json_schemer", "~> 0.2.13"
28
+ spec.add_development_dependency "json_schemer", "~> 0.2.4"
29
29
  end
@@ -20,6 +20,8 @@
20
20
  {% endfor %}
21
21
  },
22
22
  {% if site._comments %}"comments": {{ site._comments | cc_safe_jsonify }},{% endif %}
23
+ {% if site._options %}"input-options": {{ site._options | cc_safe_jsonify }},{% endif %}
24
+ {% if site.defaults %}"defaults": {{ site.defaults | cc_safe_jsonify }},{% endif %}
23
25
  {% if site._editor %}"editor": {
24
26
  "default-path": {{ site._editor.default_path | jsonify }}
25
27
  },{% endif %}
@@ -20,6 +20,8 @@
20
20
  {% endfor %}
21
21
  },
22
22
  {% if site._comments %}"comments": {{ site._comments | cc_safe_jsonify }},{% endif %}
23
+ {% if site._options %}"input-options": {{ site._options | cc_safe_jsonify }},{% endif %}
24
+ {% if site.defaults %}"defaults": {{ site.defaults | cc_safe_jsonify }},{% endif %}
23
25
  {% if site._editor %}"editor": {
24
26
  "default-path": {{ site._editor.default_path | jsonify }}
25
27
  },{% endif %}
@@ -27,6 +27,12 @@
27
27
  {% if site._comments -%}
28
28
  "comments": {{ site._comments | cc_safe_jsonify }},
29
29
  {%- endif %}
30
+ {% if site._options -%}
31
+ "input-options": {{ site._options | cc_safe_jsonify }},
32
+ {%- endif %}
33
+ {% if site.defaults -%}
34
+ "defaults": {{ site.defaults | cc_safe_jsonify }},
35
+ {%- endif %}
30
36
  {% if site._editor -%}
31
37
  "editor": {
32
38
  "default-path": {{ site._editor.default_path | jsonify }}
@@ -28,7 +28,7 @@ module CloudCannonJekyll
28
28
 
29
29
  def version_path_suffix
30
30
  return "-2.x" if Jekyll::VERSION.start_with? "2."
31
- return "-3.0-4.x" if Jekyll::VERSION.match? %r!3\.[0-4]\.!
31
+ return "-3.0-4.x" if %r!3\.[0-4]\.! =~ Jekyll::VERSION
32
32
 
33
33
  ""
34
34
  end
@@ -136,25 +136,31 @@ module CloudCannonJekyll
136
136
  documents posts related_posts time source timezone include exclude
137
137
  baseurl collections _comments _editor _source_editor _explore
138
138
  uploads_dir plugins_dir data_dir collections_dir includes_dir
139
- layouts_dir _array_structures cloudcannon rdiscount redcarpet redcloth)
139
+ layouts_dir _array_structures _options cloudcannon rdiscount redcarpet
140
+ redcloth jekyll-archives archives)
140
141
 
141
142
  if Jekyll::VERSION.start_with?("2.")
143
+ prevent.push "gems"
142
144
  prevent = prevent.concat input["collections"].keys
145
+ elsif %r!3\.[0-4]\.! =~ Jekyll::VERSION
143
146
  prevent.push "gems"
144
- elsif Jekyll::VERSION.match?(%r!3\.[0-4]\.!)
145
- prevent = prevent.concat input["collections"].map { |c| c["label"] }
146
- prevent = prevent.concat %w(plugins gems)
147
+ prevent.push "plugins"
148
+ prevent = prevent.concat(input["collections"].map { |c| c["label"] })
147
149
  else
148
150
  prevent.push "plugins"
151
+ prevent = prevent.concat(input.content_methods).uniq
149
152
  end
150
153
 
151
- out = input.map { |key, value|
152
- next unless value.is_a?(Array) || value.is_a?(Hash)
154
+ out = []
155
+
156
+ input.each_key { |key|
153
157
  next if prevent.include? key
154
158
  prevent.push key
155
159
 
156
- "#{key.to_json}: #{SafeJsonifyFilter.to_json(value, depth + 1)}"
157
- }.compact
160
+ next unless input[key].is_a?(Array) || input[key].is_a?(Hash)
161
+
162
+ out << "#{key.to_json}: #{SafeJsonifyFilter.to_json(input[key], depth + 1)}"
163
+ }
158
164
 
159
165
  "{#{out.join(",")}}" if out.any?
160
166
  end
@@ -177,7 +183,7 @@ module CloudCannonJekyll
177
183
  elsif input.is_a?(Hash)
178
184
  SafeJsonifyFilter.hash_to_json(input, depth)
179
185
  else
180
- "\"UNSUPPORTED:#{input.class.to_json}\""
186
+ input.class.to_s.prepend("UNSUPPORTED:").to_json
181
187
  end
182
188
  end
183
189
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CloudCannonJekyll
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
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.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - CloudCannon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-31 00:00:00.000000000 Z
11
+ date: 2020-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -92,14 +92,14 @@ dependencies:
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: 0.2.13
95
+ version: 0.2.4
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: 0.2.13
102
+ version: 0.2.4
103
103
  description: Creates CloudCannon editor details for Jekyll
104
104
  email:
105
105
  - support@cloudcannon.com
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  version: '0'
153
153
  requirements: []
154
154
  rubyforge_project:
155
- rubygems_version: 2.7.6.2
155
+ rubygems_version: 2.5.2.3
156
156
  signing_key:
157
157
  specification_version: 4
158
158
  summary: CloudCannon Jekyll integration