wcc-contentful-middleman 1.0.0.pre.rc1 → 1.0.0.pre.rc2

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: 2776907d930efab974f3498cd8752699a6c899b128f5c68ec33f625d4e3b9608
4
+ data.tar.gz: 10c7eec0192cdd2e5ccc37d9c4bac28d7b6c8a56f6d6f5e07fc2e07d3ffe80d8
5
5
  SHA512:
6
- metadata.gz: db1fd330f3617644b24a8d7755efed984699a34cdea28e88e93e80a0b1efcf4505715e0418b3c73861a6276ec93340cd07ffbb6262e33791b209f2ad6ac59200
7
- data.tar.gz: a3fc88d31801058af1e2dd8cdbe328abbfb930c8aabf88f87dca2760964698276bf583ea8667ad8ce49bcbbca89a407ede3442ee48d4e8334c22bb9484c16eeb
6
+ metadata.gz: e982271ab42e35f6232306900ca39344ac620000195dc63708ba33b8596fc77e305468085cce9dd46edd910660a2c9b9bae96c1d867cadfd5496dac1a868c013
7
+ data.tar.gz: 50649b23b42da025a6d3fe6da61d41d97badb7f29a7ca1ac66b88a6b699167d4106f4be6477215e97111eb27e46f8b97f84dc31929a3a4a8263f6c6ea0fab369
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.0-rc2'
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.0.pre.rc2
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-02-10 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.0.pre.rc2
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.0.pre.rc2
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: