wcc-blogs-client 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +10 -6
- data/lib/wcc/blogs/post.rb +18 -4
- data/lib/wcc/blogs/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cc54b2ea711debb4b4cd66ff1741ad5c159316d
|
4
|
+
data.tar.gz: e1c666d7b2f98185a8e8b7bd668f2ec95d6d3769
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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-
|
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:
|
46
|
+
# Offense count: 6
|
43
47
|
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
44
48
|
# URISchemes: http, https
|
45
49
|
Metrics/LineLength:
|
data/lib/wcc/blogs/post.rb
CHANGED
@@ -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
|
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
|
data/lib/wcc/blogs/version.rb
CHANGED