wcc-blogs-client 0.7.3 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 877882f8f0a84886bda0d722f5c2193c4590556c
4
- data.tar.gz: eaeb84c5dee20a2cc375a020d3d664141e433d19
2
+ SHA256:
3
+ metadata.gz: 87ed8ad6c2bba6a5ec40b965ac6e851d83500a937772af594031025641477d10
4
+ data.tar.gz: 0f8da147c4fd4351c8b49330eed0b137135ae06a1563c1c87ce733eacf228ca4
5
5
  SHA512:
6
- metadata.gz: 1cc0ed72da511f3726da0b564f32d9e613c38a9196aeae1d9bce18bd8684de44b58d89d85ac8d908cb0a4ed709e81aa4723914aa6a9ff8847377257fa918d8bc
7
- data.tar.gz: b4a19b7f2b0b0fafd90a80d0b822041c2ed0083d104899bcd99e1934eeff04c851512a98616aeb93dda7250ec5b4977e13b8c65acd71be781b39ff5f09d13b4e
6
+ metadata.gz: 5955d420482431af87ef23296d2bc5824b129afcae1ee6b7c3311ad28db927d53252b6ed3a366f829e6151f5b099b23ade0b857afa608afd5a315dcdbb646824
7
+ data.tar.gz: 6c2735ee2b49e9ec94c73a6501d116954ddc32ec8584cd92dfa419a2b3db2768085e3cddf2b14fe8097a9575e4da34807eab1605068450bf7811d7e9cbeb311e
data/.rubocop.yml CHANGED
@@ -1,31 +1,13 @@
1
- inherit_from: .rubocop_todo.yml
2
-
3
1
  AllCops:
4
- DisplayCopNames: true
5
2
  TargetRubyVersion: 2.3
6
-
7
- Lint/AssignmentInCondition:
8
- Enabled: false
9
-
10
- Metrics/BlockLength:
3
+ # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
4
+ # to ignore them, so only the ones explicitly set in this file are enabled.
5
+ DisabledByDefault: true
11
6
  Exclude:
7
+ - '**/templates/**/*'
8
+ - '**/vendor/**/*'
9
+ Include:
10
+ - 'lib/**/*'
11
+ - 'Gemfile'
12
12
  - 'wcc-blogs-client.gemspec'
13
- - 'spec/**/*'
14
-
15
- Style/ClassAndModuleChildren:
16
- Enabled: false
17
-
18
- Style/Documentation:
19
- Enabled: false
20
13
 
21
- Style/DoubleNegation:
22
- Enabled: false
23
-
24
- Style/MultilineBlockChain:
25
- Exclude:
26
- - 'spec/**/*'
27
-
28
- Style/BlockDelimiters:
29
- Exclude:
30
- # we like the `let(:foo) {}` syntax in specs
31
- - 'spec/**/*.rb'
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.6
@@ -8,6 +8,15 @@ module WCC::Blogs
8
8
  class Client
9
9
  attr_reader :base_url, :default_property, :base_path
10
10
 
11
+ def options
12
+ {
13
+ default_property: @default_property,
14
+ base_url: @base_url,
15
+ connection: @connection,
16
+ query_defaults: @query_defaults
17
+ }
18
+ end
19
+
11
20
  def initialize(**options)
12
21
  if options[:publishing_target]
13
22
  raise ArgumentError, 'publishing_target has been renamed to default_property'
@@ -18,7 +27,9 @@ module WCC::Blogs
18
27
  @base_path = base_url.path == '' ? '/api/v1' : base_url.path
19
28
  @base_url = base_url.to_s
20
29
  @connection = options[:connection] || default_connection
21
- @query_defaults = options[:query_defaults] || {}
30
+ @query_defaults = options.slice(:preview)
31
+ @query_defaults[:preview] = 'devslikepizza' if options[:preview] == true
32
+ @query_defaults.merge!(options[:query_defaults] || {})
22
33
  end
23
34
 
24
35
  # performs an HTTP GET request to the specified path within the configured
@@ -99,7 +110,6 @@ module WCC::Blogs
99
110
  store: default_cache_store,
100
111
  serializer: Marshal
101
112
  faraday.response :logger, (Rails.logger if defined?(Rails)), headers: false, bodies: false
102
- faraday.adapter :typhoeus
103
113
  end
104
114
  end
105
115
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module WCC
4
4
  module Blogs
5
- VERSION = '0.7.3'
5
+ VERSION = '0.7.4'
6
6
  end
7
7
  end
data/lib/wcc/blogs.rb CHANGED
@@ -17,10 +17,14 @@ require 'wcc/blogs/collection_summary'
17
17
 
18
18
  module WCC::Blogs
19
19
  class << self
20
- attr_writer :client
20
+ attr_writer :client, :preview_client
21
21
 
22
22
  def client
23
23
  @client || raise(WCC::Blogs::NotConfiguredException, 'Not configured')
24
24
  end
25
+
26
+ def preview_client
27
+ @preview_client ||= WCC::Blogs::Client.new(**client.options.merge(preview: true))
28
+ end
25
29
  end
26
30
  end
@@ -24,8 +24,8 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.require_paths = ['lib']
26
26
 
27
- spec.add_runtime_dependency 'faraday', '~> 0.15.4'
28
- spec.add_runtime_dependency 'faraday-http-cache', '~> 1.3'
27
+ spec.add_runtime_dependency 'faraday', '>= 0.15.4'
28
+ spec.add_runtime_dependency 'faraday-http-cache', '>= 1.3'
29
29
  spec.add_runtime_dependency 'wcc-base'
30
30
 
31
31
  spec.add_development_dependency 'guard', '~> 2.15'
@@ -34,7 +34,6 @@ Gem::Specification.new do |spec|
34
34
  spec.add_development_dependency 'rake', '~> 12.3'
35
35
  spec.add_development_dependency 'rspec', '~> 3.0'
36
36
  spec.add_development_dependency 'rspec_junit_formatter', '~> 0.3.0'
37
- spec.add_development_dependency 'rubocop', '~> 0.60.0'
38
- spec.add_development_dependency 'typhoeus'
37
+ spec.add_development_dependency 'rubocop', '~> 0.71.0'
39
38
  spec.add_development_dependency 'webmock', '~> 3.0'
40
39
  end
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wcc-blogs-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Watermark Dev
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-16 00:00:00.000000000 Z
11
+ date: 2022-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.15.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.15.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faraday-http-cache
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.3'
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
40
  version: '1.3'
41
41
  - !ruby/object:Gem::Dependency
@@ -142,28 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 0.60.0
145
+ version: 0.71.0
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 0.60.0
153
- - !ruby/object:Gem::Dependency
154
- name: typhoeus
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: '0'
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: '0'
152
+ version: 0.71.0
167
153
  - !ruby/object:Gem::Dependency
168
154
  name: webmock
169
155
  requirement: !ruby/object:Gem::Requirement
@@ -187,7 +173,7 @@ extra_rdoc_files: []
187
173
  files:
188
174
  - ".gitignore"
189
175
  - ".rubocop.yml"
190
- - ".rubocop_todo.yml"
176
+ - ".ruby-version"
191
177
  - Gemfile
192
178
  - Guardfile
193
179
  - README.md
@@ -211,7 +197,7 @@ homepage: https://github.com/watermarkchurch/papyrus/wcc-blogs-client
211
197
  licenses:
212
198
  - MIT
213
199
  metadata: {}
214
- post_install_message:
200
+ post_install_message:
215
201
  rdoc_options: []
216
202
  require_paths:
217
203
  - lib
@@ -226,9 +212,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
226
212
  - !ruby/object:Gem::Version
227
213
  version: '0'
228
214
  requirements: []
229
- rubyforge_project:
230
- rubygems_version: 2.5.2.3
231
- signing_key:
215
+ rubygems_version: 3.1.6
216
+ signing_key:
232
217
  specification_version: 4
233
218
  summary: ''
234
219
  test_files: []
data/.rubocop_todo.yml DELETED
@@ -1,44 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2019-05-13 14:26:19 -0500 using RuboCop version 0.60.0.
4
- # The point is for the user to remove these configuration records
5
- # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
8
-
9
- # Offense count: 1
10
- # Configuration parameters: Include.
11
- # Include: **/*.gemspec
12
- Gemspec/RequiredRubyVersion:
13
- Exclude:
14
- - 'wcc-blogs-client.gemspec'
15
-
16
- # Offense count: 3
17
- # Cop supports --auto-correct.
18
- # Configuration parameters: EnforcedStyle.
19
- # SupportedStyles: line_count_dependent, lambda, literal
20
- Style/Lambda:
21
- Exclude:
22
- - 'lib/wcc/blogs/client.rb'
23
-
24
- # Offense count: 1
25
- # Cop supports --auto-correct.
26
- # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
27
- # SupportedStyles: single_quotes, double_quotes
28
- Style/StringLiterals:
29
- Exclude:
30
- - 'Rakefile'
31
-
32
- # Offense count: 1
33
- # Cop supports --auto-correct.
34
- # Configuration parameters: EnforcedStyleForMultiline.
35
- # SupportedStylesForMultiline: comma, consistent_comma, no_comma
36
- Style/TrailingCommaInHashLiteral:
37
- Exclude:
38
- - 'lib/wcc/blogs/client.rb'
39
-
40
- # Offense count: 8
41
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
42
- # URISchemes: http, https
43
- Metrics/LineLength:
44
- Max: 106