wcc-blogs-client 0.1.1 → 0.2.0

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
2
  SHA1:
3
- metadata.gz: 27de74feed4c2e7fd78759c6c765997bbbb153ff
4
- data.tar.gz: a2e77e9b7b45eb4c98a41b60d4b5df97c48e484d
3
+ metadata.gz: 9cc54b2ea711debb4b4cd66ff1741ad5c159316d
4
+ data.tar.gz: e1c666d7b2f98185a8e8b7bd668f2ec95d6d3769
5
5
  SHA512:
6
- metadata.gz: 583115f14a9479d9096f6bda4e3c8fcb53b0221f89f60d241e1fd2dc5a2b362056e84912f9403a70cd6b835a77642afa2069ae5fe46fd02979696cfcaaf2cfe8
7
- data.tar.gz: b0330df0bb0d4206322217c073b5d5b82fe65d77f083205b4687c4f98777e69f7acb7d8babec286a46358d975d02fcb5868f039bd0952145255e3a6722410977
6
+ metadata.gz: 4f09bf8377c4c0e7ab5e5842ea587f4138bec8278acd4ff8cb1ad04eafe0761f2f88f700bfb674f4b20ae2f19d850cf99c8b2cc6ea0d071a5ef974c1db66b61e
7
+ data.tar.gz: eefc6154686859afbd7b1db05726ca756820dbd25f2009359112f5b353fcc6b66dec552f3bb5f777c35da4c49bbc75acd079407660a272a2fddc06f6f42f4796
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2019-05-09 17:07:57 -0500 using RuboCop version 0.60.0.
3
+ # on 2019-05-10 13:54:26 -0500 using RuboCop version 0.60.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -19,10 +19,6 @@ Lint/AssignmentInCondition:
19
19
  Exclude:
20
20
  - 'lib/wcc/blogs/client.rb'
21
21
 
22
- # Offense count: 1
23
- Metrics/AbcSize:
24
- Max: 17
25
-
26
22
  # Offense count: 3
27
23
  # Cop supports --auto-correct.
28
24
  # Configuration parameters: EnforcedStyle.
@@ -31,6 +27,14 @@ Style/Lambda:
31
27
  Exclude:
32
28
  - 'lib/wcc/blogs/client.rb'
33
29
 
30
+ # Offense count: 1
31
+ # Cop supports --auto-correct.
32
+ # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
33
+ # SupportedStyles: single_quotes, double_quotes
34
+ Style/StringLiterals:
35
+ Exclude:
36
+ - 'Rakefile'
37
+
34
38
  # Offense count: 1
35
39
  # Cop supports --auto-correct.
36
40
  # Configuration parameters: EnforcedStyleForMultiline.
@@ -39,7 +43,7 @@ Style/TrailingCommaInHashLiteral:
39
43
  Exclude:
40
44
  - 'lib/wcc/blogs/client.rb'
41
45
 
42
- # Offense count: 7
46
+ # Offense count: 6
43
47
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
44
48
  # URISchemes: http, https
45
49
  Metrics/LineLength:
@@ -38,7 +38,7 @@ module WCC::Blogs
38
38
  return false if publishing_targets.empty?
39
39
 
40
40
  publishing_targets.any? { |t| t['key'] == WCC::Blogs.config.publishing_target } &&
41
- (publish_at.nil? || publish_at.empty? || (Time.parse(publish_at) <= Time.now))
41
+ (!publish_at || (publish_at <= Time.now))
42
42
  end
43
43
 
44
44
  def time_to_read
@@ -62,9 +62,6 @@ module WCC::Blogs
62
62
  host
63
63
  path
64
64
  digest
65
- updated_at
66
- created_at
67
- publish_at
68
65
  fragment_path
69
66
  ].each do |method|
70
67
  attribute = camelcase(method)
@@ -76,6 +73,23 @@ module WCC::Blogs
76
73
  alias_method attribute, method if attribute != method
77
74
  end
78
75
 
76
+ %w[
77
+ created_at
78
+ publish_at
79
+ updated_at
80
+ ].each do |method|
81
+ attribute = camelcase(method)
82
+
83
+ define_method method do
84
+ value = raw[attribute]
85
+ return unless value && value.length
86
+
87
+ Time.parse(value)
88
+ end
89
+
90
+ alias_method attribute, method if attribute != method
91
+ end
92
+
79
93
  %w[
80
94
  author
81
95
  hero_image
@@ -2,6 +2,6 @@
2
2
 
3
3
  module WCC
4
4
  module Blogs
5
- VERSION = '0.1.1'.freeze
5
+ VERSION = '0.2.0'.freeze
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wcc-blogs-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Watermark Dev