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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cff601b9555d6a0feb63219f07395e60bdabc17eaad58fa52ed356d7d00cd733
4
- data.tar.gz: 47dc258f2988a1caa405fcddc98d2b352f67aafdb1f6e20abe210b2f8aa15722
3
+ metadata.gz: 6e4a20f568ac8a0701f61643c0a9c57f29d6f49f9a822f7802853ce9797217b2
4
+ data.tar.gz: 03c1497b6792f3c88cdb8bd308b9cde9c817d765ef20fd42b568e10348717e6a
5
5
  SHA512:
6
- metadata.gz: db1fd330f3617644b24a8d7755efed984699a34cdea28e88e93e80a0b1efcf4505715e0418b3c73861a6276ec93340cd07ffbb6262e33791b209f2ad6ac59200
7
- data.tar.gz: a3fc88d31801058af1e2dd8cdbe328abbfb930c8aabf88f87dca2760964698276bf583ea8667ad8ce49bcbbca89a407ede3442ee48d4e8334c22bb9484c16eeb
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://travis-ci.org/watermarkchurch/wcc-contentful.svg?branch=master)](https://travis-ci.org/watermarkchurch/wcc-contentful)
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
- require 'bundler'
4
- Bundler::GemHelper.install_tasks
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
data/doc ADDED
@@ -0,0 +1 @@
1
+ ./../doc/wcc-contentful-middleman
@@ -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
@@ -3,7 +3,7 @@
3
3
  module WCC
4
4
  module Contentful
5
5
  module Middleman
6
- VERSION = '1.0.0-rc1'
6
+ VERSION = '1.0.1'
7
7
  end
8
8
  end
9
9
  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
- expect(WCC::Contentful.configuration.store.cdn_method).to eq(:eager_sync)
39
- expect(WCC::Contentful.configuration.store.content_delivery_params[0]).to eq(:memory)
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.0.pre.rc1
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-01-18 00:00:00.000000000 Z
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.0.pre.rc1
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.0.pre.rc1
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: 1.3.1
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://travis-ci.org/watermarkchurch/wcc-contentful.svg?branch=master)](https://travis-ci.org/watermarkchurch/wcc-contentful)
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."