wcc-contentful-middleman 1.0.0.pre.rc1 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/Rakefile +2 -13
- data/doc +1 -0
- data/lib/wcc/contentful/middleman/extension.rb +4 -5
- data/lib/wcc/contentful/middleman/version.rb +1 -1
- data/spec/wcc/contentful/middleman/extension_spec.rb +8 -6
- data/wcc-contentful-middleman.gemspec +8 -0
- metadata +10 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e4a20f568ac8a0701f61643c0a9c57f29d6f49f9a822f7802853ce9797217b2
|
4
|
+
data.tar.gz: 03c1497b6792f3c88cdb8bd308b9cde9c817d765ef20fd42b568e10348717e6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5d42fdada045d63e6be9827c593a9a9f915e40ebe53437b8605731aff29ad0ae5bd76b783a56efe5425458c468cef01724712b7a3e5ba56d68cf35833949432
|
7
|
+
data.tar.gz: d64d2983e5f9e85977a537f474579008005ca71566ed30ab5e97f08cc39600698b79e4adf1c40d0edb73f6f0fbd50d3fcdf949a4984f1eac00b72e5789cff641
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
[![Gem Version](https://badge.fury.io/rb/wcc-contentful-middleman.svg)](https://rubygems.org/gems/wcc-contentful-middleman)
|
2
|
-
[![Build Status](https://
|
2
|
+
[![Build Status](https://circleci.com/gh/watermarkchurch/wcc-contentful.svg?style=svg)](https://circleci.com/gh/watermarkchurch/wcc-contentful)
|
3
3
|
[![Coverage Status](https://coveralls.io/repos/github/watermarkchurch/wcc-contentful/badge.svg?branch=master)](https://coveralls.io/github/watermarkchurch/wcc-contentful?branch=master)
|
4
4
|
|
5
5
|
# WCC::Contentful::Middleman
|
data/Rakefile
CHANGED
@@ -1,16 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
require 'cucumber/rake/task'
|
7
|
-
|
8
|
-
Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t|
|
9
|
-
t.cucumber_opts = '--color --tags ~@wip --strict'
|
3
|
+
task :release do
|
4
|
+
raise StandardError, 'Please run rake release only from the root folder.'
|
10
5
|
end
|
11
|
-
|
12
|
-
require 'rake/clean'
|
13
|
-
|
14
|
-
task test: ['cucumber']
|
15
|
-
|
16
|
-
task default: :test
|
@@ -60,25 +60,24 @@ class WCC::Contentful::Middleman::Extension < ::Middleman::Extension
|
|
60
60
|
def initialize(app)
|
61
61
|
@app = app
|
62
62
|
end
|
63
|
-
|
63
|
+
|
64
64
|
def call(env)
|
65
65
|
if (Time.now - ContentfulSyncUpdate.last_sync) > 10.seconds
|
66
66
|
::WCC::Contentful::Services.instance.sync_engine&.next
|
67
67
|
ContentfulSyncUpdate.last_sync = Time.now
|
68
68
|
end
|
69
|
-
|
69
|
+
|
70
70
|
@app.call(env)
|
71
71
|
end
|
72
72
|
|
73
73
|
class << self
|
74
74
|
def last_sync
|
75
|
-
@@last_sync ||= Time.at(0)
|
75
|
+
@@last_sync ||= Time.at(0) # rubocop:disable Style/ClassVars
|
76
76
|
end
|
77
77
|
|
78
78
|
def last_sync=(time)
|
79
|
-
@@last_sync = time
|
79
|
+
@@last_sync = time # rubocop:disable Style/ClassVars
|
80
80
|
end
|
81
81
|
end
|
82
82
|
end
|
83
|
-
|
84
83
|
end
|
@@ -5,10 +5,15 @@ require 'wcc/contentful/middleman/extension'
|
|
5
5
|
|
6
6
|
RSpec.describe WCC::Contentful::Middleman::Extension do
|
7
7
|
let(:app) {
|
8
|
-
double('app', after_configuration: nil)
|
8
|
+
double('app', after_configuration: nil, ready: nil)
|
9
9
|
}
|
10
10
|
|
11
11
|
describe '#initialize' do
|
12
|
+
before do
|
13
|
+
stub_request(:get, /https:\/\/cdn.contentful.com\/spaces\/.+\/sync/)
|
14
|
+
.to_return(body: load_fixture('contentful/sync.json'))
|
15
|
+
end
|
16
|
+
|
12
17
|
it 'sets contentful config variables' do
|
13
18
|
described_class.new(app,
|
14
19
|
space: 'testspace',
|
@@ -35,8 +40,8 @@ RSpec.describe WCC::Contentful::Middleman::Extension do
|
|
35
40
|
described_class.new(app)
|
36
41
|
|
37
42
|
# middleman uses memory store by default to sync all content over
|
38
|
-
|
39
|
-
expect(
|
43
|
+
store = WCC::Contentful::Services.instance.store.store
|
44
|
+
expect(store).to be_a WCC::Contentful::Store::MemoryStore
|
40
45
|
end
|
41
46
|
|
42
47
|
it 'passes block' do
|
@@ -54,9 +59,6 @@ RSpec.describe WCC::Contentful::Middleman::Extension do
|
|
54
59
|
end
|
55
60
|
|
56
61
|
it 'syncs over new content' do
|
57
|
-
stub_request(:get, /https:\/\/cdn.contentful.com\/spaces\/.+\/sync/)
|
58
|
-
.to_return(body: load_fixture('contentful/sync.json'))
|
59
|
-
|
60
62
|
described_class.new(app)
|
61
63
|
|
62
64
|
store = WCC::Contentful::Services.instance.store
|
@@ -4,6 +4,9 @@ lib = File.expand_path('lib', __dir__)
|
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
5
|
require 'wcc/contentful/middleman/version'
|
6
6
|
|
7
|
+
doc_version = Gem::Version.new(WCC::Contentful::Middleman::VERSION).release.to_s.sub(/\.\d+$/, '')
|
8
|
+
|
9
|
+
# rubocop:disable Metrics/LineLength
|
7
10
|
Gem::Specification.new do |spec|
|
8
11
|
spec.name = 'wcc-contentful-middleman'
|
9
12
|
spec.version = WCC::Contentful::Middleman::VERSION
|
@@ -17,6 +20,10 @@ Gem::Specification.new do |spec|
|
|
17
20
|
|
18
21
|
spec.required_ruby_version = '>= 2.3'
|
19
22
|
|
23
|
+
spec.metadata = {
|
24
|
+
'documentation_uri' => "https://watermarkchurch.github.io/wcc-contentful/#{doc_version}/wcc-contentful-graphql"
|
25
|
+
}
|
26
|
+
|
20
27
|
spec.files =
|
21
28
|
`git ls-files -z`.split("\x0").reject do |f|
|
22
29
|
f.match(%r{^(test|spec|features)/})
|
@@ -46,3 +53,4 @@ Gem::Specification.new do |spec|
|
|
46
53
|
spec.add_development_dependency 'guard-rubocop', '~> 1.3.0'
|
47
54
|
spec.add_development_dependency 'guard-shell', '~> 0.7.1'
|
48
55
|
end
|
56
|
+
# rubocop:enable Metrics/LineLength
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wcc-contentful-middleman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Watermark Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: middleman-core
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.0.
|
33
|
+
version: 1.0.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.0.
|
40
|
+
version: 1.0.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: dotenv
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -217,6 +217,7 @@ files:
|
|
217
217
|
- Guardfile
|
218
218
|
- README.md
|
219
219
|
- Rakefile
|
220
|
+
- doc
|
220
221
|
- lib/wcc/contentful/middleman.rb
|
221
222
|
- lib/wcc/contentful/middleman/extension.rb
|
222
223
|
- lib/wcc/contentful/middleman/version.rb
|
@@ -231,7 +232,8 @@ files:
|
|
231
232
|
homepage: https://github.com/watermarkchurch/wcc-contentful
|
232
233
|
licenses:
|
233
234
|
- MIT
|
234
|
-
metadata:
|
235
|
+
metadata:
|
236
|
+
documentation_uri: https://watermarkchurch.github.io/wcc-contentful/1.0/wcc-contentful-graphql
|
235
237
|
post_install_message:
|
236
238
|
rdoc_options: []
|
237
239
|
require_paths:
|
@@ -243,16 +245,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
243
245
|
version: '2.3'
|
244
246
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
245
247
|
requirements:
|
246
|
-
- - "
|
248
|
+
- - ">="
|
247
249
|
- !ruby/object:Gem::Version
|
248
|
-
version:
|
250
|
+
version: '0'
|
249
251
|
requirements: []
|
250
252
|
rubyforge_project:
|
251
253
|
rubygems_version: 2.7.6.2
|
252
254
|
signing_key:
|
253
255
|
specification_version: 4
|
254
256
|
summary: "[![Gem Version](https://badge.fury.io/rb/wcc-contentful-middleman.svg)](https://rubygems.org/gems/wcc-contentful-middleman)
|
255
|
-
[![Build Status](https://
|
257
|
+
[![Build Status](https://circleci.com/gh/watermarkchurch/wcc-contentful.svg?style=svg)](https://circleci.com/gh/watermarkchurch/wcc-contentful)
|
256
258
|
[![Coverage Status](https://coveralls.io/repos/github/watermarkchurch/wcc-contentful/badge.svg?branch=master)](https://coveralls.io/github/watermarkchurch/wcc-contentful?branch=master)
|
257
259
|
\ # WCC::Contentful::Middleman A plugin for middleman static sites to use the [wcc-contentful](https://rubygems.org/gems/wcc-contentful)
|
258
260
|
gem for connecting to Contentful."
|