Skip to content

Commit

Permalink
Add time and gem version info to config
Browse files Browse the repository at this point in the history
  • Loading branch information
rphillips-nz committed Sep 13, 2020
1 parent 5d71dad commit 1473c58
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 2 deletions.
5 changes: 5 additions & 0 deletions lib/cloudcannon-jekyll/_cloudcannon/config-2.x.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"time": {{ site.time | cc_jsonify }},
"cloudcannon": {
"name": "cloudcannon-jekyll",
"version": {{ gem_version | cc_jsonify }}
},
{% if config.timezone %}"timezone": {{ config.timezone | cc_jsonify }},{% endif %}
"include": {{ config.include | cc_jsonify }},
"exclude": {{ config.exclude | cc_jsonify }},
Expand Down
5 changes: 5 additions & 0 deletions lib/cloudcannon-jekyll/_cloudcannon/config-3.0-4.x.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"time": {{ site.time | cc_jsonify }},
"cloudcannon": {
"name": "cloudcannon-jekyll",
"version": {{ gem_version | cc_jsonify }}
},
{% if config.timezone %}"timezone": {{ config.timezone | cc_jsonify }},{% endif %}
"include": {{ config.include | cc_jsonify }},
"exclude": {{ config.exclude | cc_jsonify }},
Expand Down
5 changes: 5 additions & 0 deletions lib/cloudcannon-jekyll/_cloudcannon/config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"time": {{ site.time | cc_jsonify }},
"cloudcannon": {
"name": "cloudcannon-jekyll",
"version": {{ gem_version | cc_jsonify }}
},
{% if config.timezone -%}
"timezone": {{ config.timezone | cc_jsonify }},
{%- endif %}
Expand Down
1 change: 0 additions & 1 deletion lib/cloudcannon-jekyll/jsonify-filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module JsonifyFilter
"_singular_name" => "_singular-name",
"_singular_key" => "_singular-key",
"_disable_add" => "_disable-add",
"_icon" => "_icon",
"_add_options" => "_add-options",
},
}.freeze
Expand Down
2 changes: 1 addition & 1 deletion lib/cloudcannon-jekyll/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module CloudCannonJekyll
VERSION = "1.3.2"
VERSION = "1.3.3"
end
9 changes: 9 additions & 0 deletions spec/generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,15 @@ def log_schema_error(error)
expect(schemer.valid?(config)).to eq(true)
end

it "contains valid time" do
expect(details["time"]).to match(%r!\d{4}\-\d\d\-\d\d \d\d:\d\d:\d\d [+-]\d{4}!)
end

it "contains gem information" do
expect(details["cloudcannon"]["name"]).to eq("cloudcannon-jekyll")
expect(details["cloudcannon"]["version"]).to eq(CloudCannonJekyll::VERSION)
end

it "has populated source" do
# Usually this would be output without a trailing slash, but spec_helper.rb
# does some overwriting which doesn't fully replicate a normal build.
Expand Down

0 comments on commit 1473c58

Please sign in to comment.