better_seo 1.0.0.1 → 1.0.0.2
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 +4 -4
- data/.rubocop.yml +30 -0
- data/.rubocop_todo.yml +360 -0
- data/CHANGELOG.md +44 -0
- data/README.md +7 -25
- data/lib/better_seo/analytics/google_analytics.rb +12 -12
- data/lib/better_seo/analytics/google_tag_manager.rb +7 -7
- data/lib/better_seo/configuration.rb +11 -5
- data/lib/better_seo/dsl/base.rb +1 -1
- data/lib/better_seo/dsl/open_graph.rb +2 -6
- data/lib/better_seo/dsl/twitter_cards.rb +5 -7
- data/lib/better_seo/generators/amp_generator.rb +8 -14
- data/lib/better_seo/generators/breadcrumbs_generator.rb +14 -13
- data/lib/better_seo/generators/canonical_url_manager.rb +8 -14
- data/lib/better_seo/generators/meta_tags_generator.rb +7 -6
- data/lib/better_seo/generators/open_graph_generator.rb +5 -5
- data/lib/better_seo/generators/robots_txt_generator.rb +5 -11
- data/lib/better_seo/generators/twitter_cards_generator.rb +4 -4
- data/lib/better_seo/image/optimizer.rb +2 -0
- data/lib/better_seo/rails/helpers/controller_helpers.rb +3 -1
- data/lib/better_seo/rails/helpers/seo_helper.rb +3 -7
- data/lib/better_seo/rails/helpers/structured_data_helper.rb +2 -2
- data/lib/better_seo/sitemap/generator.rb +1 -1
- data/lib/better_seo/sitemap/sitemap_index.rb +5 -5
- data/lib/better_seo/sitemap/url_entry.rb +9 -11
- data/lib/better_seo/structured_data/base.rb +2 -1
- data/lib/better_seo/structured_data/event.rb +1 -3
- data/lib/better_seo/structured_data/generator.rb +10 -10
- data/lib/better_seo/structured_data/recipe.rb +3 -4
- data/lib/better_seo/validators/seo_recommendations.rb +7 -7
- data/lib/better_seo/validators/seo_validator.rb +33 -23
- data/lib/better_seo/version.rb +1 -1
- data/lib/generators/better_seo/templates/better_seo.rb +2 -2
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b84e5710a5341706bdb97aa9f749b144663b90902c011c48fd4cbcd238e3233f
|
|
4
|
+
data.tar.gz: 0664a50e770192833f11b6c0a62cf403448a77b57ed7edd19784a46d5baf3a4d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1171e5880886e9fa74d1b41dd6c607748c332da72d1ee3bc6658892f7ef9f5dbd9a3ba4a52fed08581a5aff25428ae33221677282647a77ad34ab164e2d054f4
|
|
7
|
+
data.tar.gz: 2172411a1032be710814367ef02efc1e14c4349111ab6d341cf8cf9349251d486e7bbe08598f46ecd633efb059c44197c4573ceaf0147ae36e7b0112b40e8415
|
data/.rubocop.yml
CHANGED
|
@@ -1,8 +1,38 @@
|
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
|
2
|
+
|
|
1
3
|
AllCops:
|
|
2
4
|
TargetRubyVersion: 3.0
|
|
5
|
+
NewCops: enable
|
|
6
|
+
|
|
7
|
+
plugins:
|
|
8
|
+
- rubocop-rake
|
|
9
|
+
- rubocop-rspec
|
|
3
10
|
|
|
4
11
|
Style/StringLiterals:
|
|
5
12
|
EnforcedStyle: double_quotes
|
|
6
13
|
|
|
7
14
|
Style/StringLiteralsInInterpolation:
|
|
8
15
|
EnforcedStyle: double_quotes
|
|
16
|
+
|
|
17
|
+
# Allow validate! and other bang methods
|
|
18
|
+
Naming/PredicateMethod:
|
|
19
|
+
Enabled: false
|
|
20
|
+
|
|
21
|
+
# Allow development dependencies in gemspec
|
|
22
|
+
Gemspec/DevelopmentDependencies:
|
|
23
|
+
Enabled: false
|
|
24
|
+
|
|
25
|
+
# These are intentional duplicate branches for clarity
|
|
26
|
+
Lint/DuplicateBranch:
|
|
27
|
+
Enabled: false
|
|
28
|
+
|
|
29
|
+
# Allow block parameters even if not explicitly referenced (used via yield)
|
|
30
|
+
Lint/UnusedMethodArgument:
|
|
31
|
+
AllowUnusedKeywordArguments: true
|
|
32
|
+
IgnoreEmptyMethods: false
|
|
33
|
+
Exclude:
|
|
34
|
+
- "lib/better_seo/rails/helpers/controller_helpers.rb"
|
|
35
|
+
|
|
36
|
+
# Allow @_better_seo_data naming to avoid conflicts
|
|
37
|
+
Naming/MemoizedInstanceVariableName:
|
|
38
|
+
Enabled: false
|
data/.rubocop_todo.yml
ADDED
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
# This configuration was generated by
|
|
2
|
+
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 10000`
|
|
3
|
+
# on 2025-10-24 11:07:58 UTC using RuboCop version 1.81.6.
|
|
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: 11
|
|
10
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
11
|
+
# Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
|
|
12
|
+
# URISchemes: http, https
|
|
13
|
+
Layout/LineLength:
|
|
14
|
+
Exclude:
|
|
15
|
+
- 'better_seo.gemspec'
|
|
16
|
+
- 'lib/better_seo/generators/breadcrumbs_generator.rb'
|
|
17
|
+
- 'lib/better_seo/sitemap/url_entry.rb'
|
|
18
|
+
- 'lib/better_seo/validators/seo_validator.rb'
|
|
19
|
+
- 'spec/structured_data/faq_page_spec.rb'
|
|
20
|
+
- 'spec/validators/seo_validator_spec.rb'
|
|
21
|
+
|
|
22
|
+
# Offense count: 3
|
|
23
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
24
|
+
# Configuration parameters: AllowComments.
|
|
25
|
+
Lint/EmptyConditionalBody:
|
|
26
|
+
Exclude:
|
|
27
|
+
- 'lib/better_seo/dsl/open_graph.rb'
|
|
28
|
+
- 'lib/better_seo/dsl/twitter_cards.rb'
|
|
29
|
+
|
|
30
|
+
# Offense count: 1
|
|
31
|
+
Lint/ReturnInVoidContext:
|
|
32
|
+
Exclude:
|
|
33
|
+
- 'lib/better_seo/generators/canonical_url_manager.rb'
|
|
34
|
+
|
|
35
|
+
# Offense count: 25
|
|
36
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
|
|
37
|
+
Metrics/AbcSize:
|
|
38
|
+
Exclude:
|
|
39
|
+
- 'lib/better_seo/configuration.rb'
|
|
40
|
+
- 'lib/better_seo/dsl/meta_tags.rb'
|
|
41
|
+
- 'lib/better_seo/dsl/twitter_cards.rb'
|
|
42
|
+
- 'lib/better_seo/generators/breadcrumbs_generator.rb'
|
|
43
|
+
- 'lib/better_seo/generators/meta_tags_generator.rb'
|
|
44
|
+
- 'lib/better_seo/generators/open_graph_generator.rb'
|
|
45
|
+
- 'lib/better_seo/generators/robots_txt_generator.rb'
|
|
46
|
+
- 'lib/better_seo/generators/twitter_cards_generator.rb'
|
|
47
|
+
- 'lib/better_seo/rails/helpers/seo_helper.rb'
|
|
48
|
+
- 'lib/better_seo/sitemap/generator.rb'
|
|
49
|
+
- 'lib/better_seo/sitemap/url_entry.rb'
|
|
50
|
+
- 'lib/better_seo/structured_data/event.rb'
|
|
51
|
+
- 'lib/better_seo/validators/seo_recommendations.rb'
|
|
52
|
+
- 'lib/better_seo/validators/seo_validator.rb'
|
|
53
|
+
|
|
54
|
+
# Offense count: 5
|
|
55
|
+
# Configuration parameters: CountComments, Max, CountAsOne.
|
|
56
|
+
Metrics/ClassLength:
|
|
57
|
+
Exclude:
|
|
58
|
+
- 'lib/better_seo/configuration.rb'
|
|
59
|
+
- 'lib/better_seo/sitemap/url_entry.rb'
|
|
60
|
+
- 'lib/better_seo/structured_data/event.rb'
|
|
61
|
+
- 'lib/better_seo/validators/seo_recommendations.rb'
|
|
62
|
+
- 'lib/better_seo/validators/seo_validator.rb'
|
|
63
|
+
|
|
64
|
+
# Offense count: 10
|
|
65
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
|
66
|
+
Metrics/CyclomaticComplexity:
|
|
67
|
+
Exclude:
|
|
68
|
+
- 'lib/better_seo/configuration.rb'
|
|
69
|
+
- 'lib/better_seo/dsl/twitter_cards.rb'
|
|
70
|
+
- 'lib/better_seo/generators/breadcrumbs_generator.rb'
|
|
71
|
+
- 'lib/better_seo/generators/robots_txt_generator.rb'
|
|
72
|
+
- 'lib/better_seo/rails/helpers/seo_helper.rb'
|
|
73
|
+
- 'lib/better_seo/sitemap/url_entry.rb'
|
|
74
|
+
- 'lib/better_seo/structured_data/event.rb'
|
|
75
|
+
- 'lib/better_seo/structured_data/recipe.rb'
|
|
76
|
+
|
|
77
|
+
# Offense count: 46
|
|
78
|
+
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
79
|
+
Metrics/MethodLength:
|
|
80
|
+
Exclude:
|
|
81
|
+
- 'lib/better_seo/analytics/google_analytics.rb'
|
|
82
|
+
- 'lib/better_seo/configuration.rb'
|
|
83
|
+
- 'lib/better_seo/dsl/base.rb'
|
|
84
|
+
- 'lib/better_seo/dsl/twitter_cards.rb'
|
|
85
|
+
- 'lib/better_seo/generators/breadcrumbs_generator.rb'
|
|
86
|
+
- 'lib/better_seo/generators/canonical_url_manager.rb'
|
|
87
|
+
- 'lib/better_seo/generators/open_graph_generator.rb'
|
|
88
|
+
- 'lib/better_seo/generators/robots_txt_generator.rb'
|
|
89
|
+
- 'lib/better_seo/generators/twitter_cards_generator.rb'
|
|
90
|
+
- 'lib/better_seo/image/optimizer.rb'
|
|
91
|
+
- 'lib/better_seo/rails/helpers/seo_helper.rb'
|
|
92
|
+
- 'lib/better_seo/sitemap/generator.rb'
|
|
93
|
+
- 'lib/better_seo/sitemap/sitemap_index.rb'
|
|
94
|
+
- 'lib/better_seo/sitemap/url_entry.rb'
|
|
95
|
+
- 'lib/better_seo/structured_data/event.rb'
|
|
96
|
+
- 'lib/better_seo/structured_data/faq_page.rb'
|
|
97
|
+
- 'lib/better_seo/structured_data/how_to.rb'
|
|
98
|
+
- 'lib/better_seo/structured_data/organization.rb'
|
|
99
|
+
- 'lib/better_seo/structured_data/product.rb'
|
|
100
|
+
- 'lib/better_seo/structured_data/recipe.rb'
|
|
101
|
+
- 'lib/better_seo/validators/seo_recommendations.rb'
|
|
102
|
+
- 'lib/better_seo/validators/seo_validator.rb'
|
|
103
|
+
|
|
104
|
+
# Offense count: 1
|
|
105
|
+
# Configuration parameters: Max, CountKeywordArgs, MaxOptionalParameters.
|
|
106
|
+
Metrics/ParameterLists:
|
|
107
|
+
Exclude:
|
|
108
|
+
- 'lib/better_seo/structured_data/recipe.rb'
|
|
109
|
+
|
|
110
|
+
# Offense count: 7
|
|
111
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
|
112
|
+
Metrics/PerceivedComplexity:
|
|
113
|
+
Exclude:
|
|
114
|
+
- 'lib/better_seo/configuration.rb'
|
|
115
|
+
- 'lib/better_seo/dsl/twitter_cards.rb'
|
|
116
|
+
- 'lib/better_seo/generators/breadcrumbs_generator.rb'
|
|
117
|
+
- 'lib/better_seo/generators/robots_txt_generator.rb'
|
|
118
|
+
- 'lib/better_seo/rails/helpers/seo_helper.rb'
|
|
119
|
+
- 'lib/better_seo/structured_data/event.rb'
|
|
120
|
+
|
|
121
|
+
# Offense count: 2
|
|
122
|
+
Naming/AccessorMethodName:
|
|
123
|
+
Exclude:
|
|
124
|
+
- 'lib/better_seo/rails/helpers/controller_helpers.rb'
|
|
125
|
+
|
|
126
|
+
# Offense count: 1
|
|
127
|
+
RSpec/BeforeAfterAll:
|
|
128
|
+
Exclude:
|
|
129
|
+
- '**/spec/spec_helper.rb'
|
|
130
|
+
- '**/spec/rails_helper.rb'
|
|
131
|
+
- '**/spec/support/**/*.rb'
|
|
132
|
+
- 'spec/image/optimizer_spec.rb'
|
|
133
|
+
|
|
134
|
+
# Offense count: 3
|
|
135
|
+
# Configuration parameters: Prefixes, AllowedPatterns.
|
|
136
|
+
# Prefixes: when, with, without
|
|
137
|
+
RSpec/ContextWording:
|
|
138
|
+
Exclude:
|
|
139
|
+
- 'spec/configuration_spec.rb'
|
|
140
|
+
|
|
141
|
+
# Offense count: 1
|
|
142
|
+
# Configuration parameters: IgnoredMetadata.
|
|
143
|
+
RSpec/DescribeClass:
|
|
144
|
+
Exclude:
|
|
145
|
+
- '**/spec/features/**/*'
|
|
146
|
+
- '**/spec/requests/**/*'
|
|
147
|
+
- '**/spec/routing/**/*'
|
|
148
|
+
- '**/spec/system/**/*'
|
|
149
|
+
- '**/spec/views/**/*'
|
|
150
|
+
- 'spec/errors_spec.rb'
|
|
151
|
+
|
|
152
|
+
# Offense count: 2
|
|
153
|
+
RSpec/DescribeMethod:
|
|
154
|
+
Exclude:
|
|
155
|
+
- 'spec/sitemap/url_entry_extensions_spec.rb'
|
|
156
|
+
- 'spec/sitemap/url_entry_hreflang_spec.rb'
|
|
157
|
+
|
|
158
|
+
# Offense count: 293
|
|
159
|
+
# Configuration parameters: Max, CountAsOne.
|
|
160
|
+
RSpec/ExampleLength:
|
|
161
|
+
Exclude:
|
|
162
|
+
- 'spec/analytics/google_analytics_spec.rb'
|
|
163
|
+
- 'spec/analytics/google_tag_manager_spec.rb'
|
|
164
|
+
- 'spec/better_seo_spec.rb'
|
|
165
|
+
- 'spec/configuration_spec.rb'
|
|
166
|
+
- 'spec/dsl/base_spec.rb'
|
|
167
|
+
- 'spec/dsl/meta_tags_spec.rb'
|
|
168
|
+
- 'spec/dsl/open_graph_spec.rb'
|
|
169
|
+
- 'spec/dsl/twitter_cards_spec.rb'
|
|
170
|
+
- 'spec/generators/amp_generator_spec.rb'
|
|
171
|
+
- 'spec/generators/breadcrumbs_generator_spec.rb'
|
|
172
|
+
- 'spec/generators/meta_tags_generator_spec.rb'
|
|
173
|
+
- 'spec/generators/open_graph_generator_spec.rb'
|
|
174
|
+
- 'spec/generators/robots_txt_generator_spec.rb'
|
|
175
|
+
- 'spec/generators/twitter_cards_generator_spec.rb'
|
|
176
|
+
- 'spec/image/optimizer_spec.rb'
|
|
177
|
+
- 'spec/rails/helpers/controller_helpers_spec.rb'
|
|
178
|
+
- 'spec/rails/helpers/seo_helper_spec.rb'
|
|
179
|
+
- 'spec/rails/helpers/structured_data_helper_spec.rb'
|
|
180
|
+
- 'spec/rails/model_helpers_spec.rb'
|
|
181
|
+
- 'spec/sitemap/builder_spec.rb'
|
|
182
|
+
- 'spec/sitemap/generator_spec.rb'
|
|
183
|
+
- 'spec/sitemap/sitemap_index_spec.rb'
|
|
184
|
+
- 'spec/sitemap/url_entry_extensions_spec.rb'
|
|
185
|
+
- 'spec/sitemap/url_entry_hreflang_spec.rb'
|
|
186
|
+
- 'spec/sitemap/url_entry_spec.rb'
|
|
187
|
+
- 'spec/structured_data/article_spec.rb'
|
|
188
|
+
- 'spec/structured_data/base_spec.rb'
|
|
189
|
+
- 'spec/structured_data/breadcrumb_list_spec.rb'
|
|
190
|
+
- 'spec/structured_data/event_spec.rb'
|
|
191
|
+
- 'spec/structured_data/faq_page_spec.rb'
|
|
192
|
+
- 'spec/structured_data/generator_spec.rb'
|
|
193
|
+
- 'spec/structured_data/how_to_spec.rb'
|
|
194
|
+
- 'spec/structured_data/local_business_spec.rb'
|
|
195
|
+
- 'spec/structured_data/organization_spec.rb'
|
|
196
|
+
- 'spec/structured_data/person_spec.rb'
|
|
197
|
+
- 'spec/structured_data/product_spec.rb'
|
|
198
|
+
- 'spec/structured_data/recipe_spec.rb'
|
|
199
|
+
- 'spec/validators/seo_recommendations_spec.rb'
|
|
200
|
+
- 'spec/validators/seo_validator_spec.rb'
|
|
201
|
+
|
|
202
|
+
# Offense count: 6
|
|
203
|
+
# Configuration parameters: AssignmentOnly.
|
|
204
|
+
RSpec/InstanceVariable:
|
|
205
|
+
Exclude:
|
|
206
|
+
- 'spec/image/optimizer_spec.rb'
|
|
207
|
+
|
|
208
|
+
# Offense count: 1
|
|
209
|
+
# Configuration parameters: .
|
|
210
|
+
# SupportedStyles: have_received, receive
|
|
211
|
+
RSpec/MessageSpies:
|
|
212
|
+
EnforcedStyle: receive
|
|
213
|
+
|
|
214
|
+
# Offense count: 357
|
|
215
|
+
# Configuration parameters: Max.
|
|
216
|
+
RSpec/MultipleExpectations:
|
|
217
|
+
Exclude:
|
|
218
|
+
- 'spec/analytics/google_analytics_spec.rb'
|
|
219
|
+
- 'spec/analytics/google_tag_manager_spec.rb'
|
|
220
|
+
- 'spec/better_seo_spec.rb'
|
|
221
|
+
- 'spec/configuration_spec.rb'
|
|
222
|
+
- 'spec/dsl/base_spec.rb'
|
|
223
|
+
- 'spec/dsl/meta_tags_spec.rb'
|
|
224
|
+
- 'spec/dsl/open_graph_spec.rb'
|
|
225
|
+
- 'spec/dsl/twitter_cards_spec.rb'
|
|
226
|
+
- 'spec/generators/amp_generator_spec.rb'
|
|
227
|
+
- 'spec/generators/breadcrumbs_generator_spec.rb'
|
|
228
|
+
- 'spec/generators/canonical_url_manager_spec.rb'
|
|
229
|
+
- 'spec/generators/meta_tags_generator_spec.rb'
|
|
230
|
+
- 'spec/generators/open_graph_generator_spec.rb'
|
|
231
|
+
- 'spec/generators/robots_txt_generator_spec.rb'
|
|
232
|
+
- 'spec/generators/twitter_cards_generator_spec.rb'
|
|
233
|
+
- 'spec/image/optimizer_spec.rb'
|
|
234
|
+
- 'spec/rails/helpers/controller_helpers_spec.rb'
|
|
235
|
+
- 'spec/rails/helpers/seo_helper_spec.rb'
|
|
236
|
+
- 'spec/rails/helpers/structured_data_helper_spec.rb'
|
|
237
|
+
- 'spec/rails/model_helpers_spec.rb'
|
|
238
|
+
- 'spec/sitemap/builder_spec.rb'
|
|
239
|
+
- 'spec/sitemap/generator_spec.rb'
|
|
240
|
+
- 'spec/sitemap/sitemap_index_spec.rb'
|
|
241
|
+
- 'spec/sitemap/url_entry_extensions_spec.rb'
|
|
242
|
+
- 'spec/sitemap/url_entry_hreflang_spec.rb'
|
|
243
|
+
- 'spec/sitemap/url_entry_spec.rb'
|
|
244
|
+
- 'spec/structured_data/article_spec.rb'
|
|
245
|
+
- 'spec/structured_data/base_spec.rb'
|
|
246
|
+
- 'spec/structured_data/breadcrumb_list_spec.rb'
|
|
247
|
+
- 'spec/structured_data/event_spec.rb'
|
|
248
|
+
- 'spec/structured_data/faq_page_spec.rb'
|
|
249
|
+
- 'spec/structured_data/generator_spec.rb'
|
|
250
|
+
- 'spec/structured_data/how_to_spec.rb'
|
|
251
|
+
- 'spec/structured_data/local_business_spec.rb'
|
|
252
|
+
- 'spec/structured_data/organization_spec.rb'
|
|
253
|
+
- 'spec/structured_data/person_spec.rb'
|
|
254
|
+
- 'spec/structured_data/product_spec.rb'
|
|
255
|
+
- 'spec/structured_data/recipe_spec.rb'
|
|
256
|
+
- 'spec/validators/seo_recommendations_spec.rb'
|
|
257
|
+
- 'spec/validators/seo_validator_spec.rb'
|
|
258
|
+
|
|
259
|
+
# Offense count: 6
|
|
260
|
+
RSpec/RepeatedExample:
|
|
261
|
+
Exclude:
|
|
262
|
+
- 'spec/dsl/twitter_cards_spec.rb'
|
|
263
|
+
- 'spec/structured_data/event_spec.rb'
|
|
264
|
+
|
|
265
|
+
# Offense count: 39
|
|
266
|
+
# Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata.
|
|
267
|
+
RSpec/SpecFilePathFormat:
|
|
268
|
+
Exclude:
|
|
269
|
+
- '**/spec/routing/**/*'
|
|
270
|
+
- 'spec/analytics/google_analytics_spec.rb'
|
|
271
|
+
- 'spec/analytics/google_tag_manager_spec.rb'
|
|
272
|
+
- 'spec/configuration_spec.rb'
|
|
273
|
+
- 'spec/dsl/base_spec.rb'
|
|
274
|
+
- 'spec/dsl/meta_tags_spec.rb'
|
|
275
|
+
- 'spec/dsl/open_graph_spec.rb'
|
|
276
|
+
- 'spec/dsl/twitter_cards_spec.rb'
|
|
277
|
+
- 'spec/generators/amp_generator_spec.rb'
|
|
278
|
+
- 'spec/generators/breadcrumbs_generator_spec.rb'
|
|
279
|
+
- 'spec/generators/canonical_url_manager_spec.rb'
|
|
280
|
+
- 'spec/generators/meta_tags_generator_spec.rb'
|
|
281
|
+
- 'spec/generators/open_graph_generator_spec.rb'
|
|
282
|
+
- 'spec/generators/robots_txt_generator_spec.rb'
|
|
283
|
+
- 'spec/generators/twitter_cards_generator_spec.rb'
|
|
284
|
+
- 'spec/image/optimizer_spec.rb'
|
|
285
|
+
- 'spec/rails/helpers/controller_helpers_spec.rb'
|
|
286
|
+
- 'spec/rails/helpers/seo_helper_spec.rb'
|
|
287
|
+
- 'spec/rails/helpers/structured_data_helper_spec.rb'
|
|
288
|
+
- 'spec/rails/model_helpers_spec.rb'
|
|
289
|
+
- 'spec/sitemap/builder_spec.rb'
|
|
290
|
+
- 'spec/sitemap/generator_spec.rb'
|
|
291
|
+
- 'spec/sitemap/sitemap_index_spec.rb'
|
|
292
|
+
- 'spec/sitemap/url_entry_extensions_spec.rb'
|
|
293
|
+
- 'spec/sitemap/url_entry_hreflang_spec.rb'
|
|
294
|
+
- 'spec/sitemap/url_entry_spec.rb'
|
|
295
|
+
- 'spec/structured_data/article_spec.rb'
|
|
296
|
+
- 'spec/structured_data/base_spec.rb'
|
|
297
|
+
- 'spec/structured_data/breadcrumb_list_spec.rb'
|
|
298
|
+
- 'spec/structured_data/event_spec.rb'
|
|
299
|
+
- 'spec/structured_data/faq_page_spec.rb'
|
|
300
|
+
- 'spec/structured_data/generator_spec.rb'
|
|
301
|
+
- 'spec/structured_data/how_to_spec.rb'
|
|
302
|
+
- 'spec/structured_data/local_business_spec.rb'
|
|
303
|
+
- 'spec/structured_data/organization_spec.rb'
|
|
304
|
+
- 'spec/structured_data/person_spec.rb'
|
|
305
|
+
- 'spec/structured_data/product_spec.rb'
|
|
306
|
+
- 'spec/structured_data/recipe_spec.rb'
|
|
307
|
+
- 'spec/validators/seo_recommendations_spec.rb'
|
|
308
|
+
- 'spec/validators/seo_validator_spec.rb'
|
|
309
|
+
|
|
310
|
+
# Offense count: 1
|
|
311
|
+
RSpec/SubjectStub:
|
|
312
|
+
Exclude:
|
|
313
|
+
- 'spec/dsl/base_spec.rb'
|
|
314
|
+
|
|
315
|
+
# Offense count: 40
|
|
316
|
+
# Configuration parameters: AllowedConstants.
|
|
317
|
+
Style/Documentation:
|
|
318
|
+
Exclude:
|
|
319
|
+
- 'spec/**/*'
|
|
320
|
+
- 'test/**/*'
|
|
321
|
+
- 'lib/better_seo.rb'
|
|
322
|
+
- 'lib/better_seo/analytics/google_analytics.rb'
|
|
323
|
+
- 'lib/better_seo/analytics/google_tag_manager.rb'
|
|
324
|
+
- 'lib/better_seo/configuration.rb'
|
|
325
|
+
- 'lib/better_seo/dsl/base.rb'
|
|
326
|
+
- 'lib/better_seo/dsl/meta_tags.rb'
|
|
327
|
+
- 'lib/better_seo/dsl/open_graph.rb'
|
|
328
|
+
- 'lib/better_seo/dsl/twitter_cards.rb'
|
|
329
|
+
- 'lib/better_seo/generators/amp_generator.rb'
|
|
330
|
+
- 'lib/better_seo/generators/breadcrumbs_generator.rb'
|
|
331
|
+
- 'lib/better_seo/generators/canonical_url_manager.rb'
|
|
332
|
+
- 'lib/better_seo/generators/meta_tags_generator.rb'
|
|
333
|
+
- 'lib/better_seo/generators/open_graph_generator.rb'
|
|
334
|
+
- 'lib/better_seo/generators/robots_txt_generator.rb'
|
|
335
|
+
- 'lib/better_seo/generators/twitter_cards_generator.rb'
|
|
336
|
+
- 'lib/better_seo/image/optimizer.rb'
|
|
337
|
+
- 'lib/better_seo/rails/helpers/controller_helpers.rb'
|
|
338
|
+
- 'lib/better_seo/rails/helpers/seo_helper.rb'
|
|
339
|
+
- 'lib/better_seo/rails/helpers/structured_data_helper.rb'
|
|
340
|
+
- 'lib/better_seo/rails/model_helpers.rb'
|
|
341
|
+
- 'lib/better_seo/rails/railtie.rb'
|
|
342
|
+
- 'lib/better_seo/sitemap/builder.rb'
|
|
343
|
+
- 'lib/better_seo/sitemap/generator.rb'
|
|
344
|
+
- 'lib/better_seo/sitemap/sitemap_index.rb'
|
|
345
|
+
- 'lib/better_seo/sitemap/url_entry.rb'
|
|
346
|
+
- 'lib/better_seo/structured_data/article.rb'
|
|
347
|
+
- 'lib/better_seo/structured_data/base.rb'
|
|
348
|
+
- 'lib/better_seo/structured_data/breadcrumb_list.rb'
|
|
349
|
+
- 'lib/better_seo/structured_data/event.rb'
|
|
350
|
+
- 'lib/better_seo/structured_data/faq_page.rb'
|
|
351
|
+
- 'lib/better_seo/structured_data/generator.rb'
|
|
352
|
+
- 'lib/better_seo/structured_data/how_to.rb'
|
|
353
|
+
- 'lib/better_seo/structured_data/local_business.rb'
|
|
354
|
+
- 'lib/better_seo/structured_data/organization.rb'
|
|
355
|
+
- 'lib/better_seo/structured_data/person.rb'
|
|
356
|
+
- 'lib/better_seo/structured_data/product.rb'
|
|
357
|
+
- 'lib/better_seo/structured_data/recipe.rb'
|
|
358
|
+
- 'lib/better_seo/validators/seo_recommendations.rb'
|
|
359
|
+
- 'lib/better_seo/validators/seo_validator.rb'
|
|
360
|
+
- 'lib/generators/better_seo/install_generator.rb'
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,50 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.0.0.2] - 2025-01-24
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- Resolved all RuboCop offenses by establishing baseline configuration
|
|
14
|
+
- Added `.rubocop_todo.yml` for incremental code quality improvements
|
|
15
|
+
- Updated `.rubocop.yml` with `NewCops: enable` and project-specific settings
|
|
16
|
+
- Applied auto-corrections for 39 offenses (string interpolations, operator precedence, etc.)
|
|
17
|
+
- Fixed breadcrumbs generator for better code readability
|
|
18
|
+
- Preserved block parameters in controller helpers
|
|
19
|
+
- Maintained 94.16% code coverage with all 916 tests passing
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
- Comprehensive RuboCop configuration with baseline approach
|
|
23
|
+
- `.rubocop_todo.yml` documenting existing offenses for future fixes
|
|
24
|
+
|
|
25
|
+
## [1.0.0.1] - 2025-01-24
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
- Fixed nested configuration setters to support syntax like `config.open_graph.default_image.url = "value"`
|
|
29
|
+
- Modified `NestedConfiguration#initialize` to automatically wrap nested hashes
|
|
30
|
+
- Modified `NestedConfiguration#[]=` to wrap hash values
|
|
31
|
+
- Modified `NestedConfiguration#method_missing` setter to wrap hash values
|
|
32
|
+
- Modified `NestedConfiguration#merge!` to wrap nested hashes after merge
|
|
33
|
+
- Modified `NestedConfiguration#to_h` to recursively convert back to plain hashes
|
|
34
|
+
- Fixed SEO helper to automatically merge with configuration defaults
|
|
35
|
+
- Added `build_seo_config` private method in `SeoHelper`
|
|
36
|
+
- Automatic site_name appending to titles when configured
|
|
37
|
+
- Automatic generation of Open Graph and Twitter Card tags with defaults
|
|
38
|
+
- Support for `default_title` when not set in controller
|
|
39
|
+
- Fixed Railtie loading by adding require in `lib/better_seo.rb`
|
|
40
|
+
- Updated README with improved footer (Made with ❤️ by Alessio Bussolari)
|
|
41
|
+
- Removed Roadmap section from README (version history moved to CHANGELOG)
|
|
42
|
+
|
|
43
|
+
### Added
|
|
44
|
+
- 17 new tests for nested configuration hash wrapping
|
|
45
|
+
- Tests for initialization, assignment, merge, and edge cases
|
|
46
|
+
- Real-world generator template syntax tests
|
|
47
|
+
- Total: 916 tests passing (899 + 17)
|
|
48
|
+
|
|
49
|
+
### Enhanced
|
|
50
|
+
- Improved user experience with automatic defaults in SEO tags
|
|
51
|
+
- Better configuration system with deep nested object support
|
|
52
|
+
- More intuitive initializer template generation
|
|
53
|
+
|
|
10
54
|
## [1.0.0] - 2025-01-23 🎉
|
|
11
55
|
|
|
12
56
|
### 🚀 First Stable Release - Production Ready!
|
data/README.md
CHANGED
|
@@ -2241,30 +2241,6 @@ Everyone interacting in the BetterSeo project's codebases, issue trackers, chat
|
|
|
2241
2241
|
|
|
2242
2242
|
---
|
|
2243
2243
|
|
|
2244
|
-
## 🗺️ Roadmap
|
|
2245
|
-
|
|
2246
|
-
See [docs/00_OVERVIEW.md](docs/00_OVERVIEW.md) for the complete implementation roadmap.
|
|
2247
|
-
|
|
2248
|
-
### 📅 Version History
|
|
2249
|
-
|
|
2250
|
-
- ✅ **v0.1.0** - Core configuration system
|
|
2251
|
-
- ✅ **v0.2.0** - DSL builders (Meta Tags, Open Graph, Twitter Cards)
|
|
2252
|
-
- ✅ **v0.3.0** - HTML generators (Meta Tags, Open Graph, Twitter Cards)
|
|
2253
|
-
- ✅ **v0.4.0** - Rails view helpers integration
|
|
2254
|
-
- ✅ **v0.5.0** - Sitemap generation
|
|
2255
|
-
- ✅ **v0.6.0** - Structured data (JSON-LD)
|
|
2256
|
-
- ✅ **v0.7.0** - Advanced Rails integration
|
|
2257
|
-
- ✅ **v0.8.0** - Structured data helpers
|
|
2258
|
-
- ✅ **v0.9.0** - Additional structured data types
|
|
2259
|
-
- ✅ **v0.10.0** - Rails model helpers
|
|
2260
|
-
- ✅ **v0.11.0** - Advanced sitemap features
|
|
2261
|
-
- ✅ **v0.12.0** - Advanced generators (Breadcrumbs, AMP, Canonical)
|
|
2262
|
-
- ✅ **v0.13.0** - SEO tools (Robots.txt, Validator, Image Optimizer, Analytics)
|
|
2263
|
-
- ✅ **v0.14.0** - SEO intelligence (GTM, Recommendations)
|
|
2264
|
-
- 🎉 **v1.0.0** - **Production Ready** ← **Current**
|
|
2265
|
-
|
|
2266
|
-
---
|
|
2267
|
-
|
|
2268
2244
|
## 🌟 Why BetterSeo?
|
|
2269
2245
|
|
|
2270
2246
|
- ✅ **Production-Ready**: 899 tests, 94.3% coverage
|
|
@@ -2278,4 +2254,10 @@ See [docs/00_OVERVIEW.md](docs/00_OVERVIEW.md) for the complete implementation r
|
|
|
2278
2254
|
|
|
2279
2255
|
---
|
|
2280
2256
|
|
|
2281
|
-
|
|
2257
|
+
<div align="center">
|
|
2258
|
+
|
|
2259
|
+
Made with ❤️ by **Alessio Bussolari**
|
|
2260
|
+
|
|
2261
|
+
[Report Bug](https://github.com/alessiobussolari/better_seo/issues) · [Request Feature](https://github.com/alessiobussolari/better_seo/issues) · [Documentation](https://github.com/alessiobussolari/better_seo#readme)
|
|
2262
|
+
|
|
2263
|
+
</div>
|
|
@@ -16,7 +16,7 @@ module BetterSeo
|
|
|
16
16
|
def to_script_tag(nonce: nil, **config)
|
|
17
17
|
nonce_attr = nonce ? %( nonce="#{escape_html(nonce)}") : ""
|
|
18
18
|
|
|
19
|
-
config_options = {
|
|
19
|
+
config_options = { "anonymize_ip" => @anonymize_ip } if @anonymize_ip
|
|
20
20
|
config_options ||= {}
|
|
21
21
|
config_options.merge!(config.transform_keys(&:to_s))
|
|
22
22
|
|
|
@@ -44,8 +44,8 @@ module BetterSeo
|
|
|
44
44
|
|
|
45
45
|
# Track page view
|
|
46
46
|
def track_page_view(page_path, title: nil)
|
|
47
|
-
params = {
|
|
48
|
-
params[
|
|
47
|
+
params = { "page_path" => page_path }
|
|
48
|
+
params["page_title"] = title if title
|
|
49
49
|
|
|
50
50
|
<<~JS.strip
|
|
51
51
|
gtag('config', '#{@measurement_id}', #{JSON.generate(params)});
|
|
@@ -55,10 +55,10 @@ module BetterSeo
|
|
|
55
55
|
# Track e-commerce purchase
|
|
56
56
|
def ecommerce_purchase(transaction_id:, value:, currency: "USD", items: [])
|
|
57
57
|
params = {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
"transaction_id" => transaction_id,
|
|
59
|
+
"value" => value,
|
|
60
|
+
"currency" => currency,
|
|
61
|
+
"items" => items.map { |item| item.transform_keys(&:to_s) }
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
<<~JS.strip
|
|
@@ -72,11 +72,11 @@ module BetterSeo
|
|
|
72
72
|
return "" if text.nil?
|
|
73
73
|
|
|
74
74
|
text.to_s
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
.gsub("&", "&")
|
|
76
|
+
.gsub("<", "<")
|
|
77
|
+
.gsub(">", ">")
|
|
78
|
+
.gsub('"', """)
|
|
79
|
+
.gsub("'", "'")
|
|
80
80
|
end
|
|
81
81
|
end
|
|
82
82
|
end
|
|
@@ -43,8 +43,8 @@ module BetterSeo
|
|
|
43
43
|
# Push e-commerce data
|
|
44
44
|
def push_ecommerce(event:, ecommerce:)
|
|
45
45
|
data = {
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
"event" => event,
|
|
47
|
+
"ecommerce" => ecommerce.transform_keys(&:to_s)
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
<<~JS.strip
|
|
@@ -63,11 +63,11 @@ module BetterSeo
|
|
|
63
63
|
return "" if text.nil?
|
|
64
64
|
|
|
65
65
|
text.to_s
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
.gsub("&", "&")
|
|
67
|
+
.gsub("<", "<")
|
|
68
|
+
.gsub(">", ">")
|
|
69
|
+
.gsub('"', """)
|
|
70
|
+
.gsub("'", "'")
|
|
71
71
|
end
|
|
72
72
|
end
|
|
73
73
|
end
|
|
@@ -142,9 +142,7 @@ module BetterSeo
|
|
|
142
142
|
end
|
|
143
143
|
|
|
144
144
|
# Validate sitemap
|
|
145
|
-
if sitemap.enabled && sitemap.host.nil?
|
|
146
|
-
errors << "sitemap.host is required when sitemap is enabled"
|
|
147
|
-
end
|
|
145
|
+
errors << "sitemap.host is required when sitemap is enabled" if sitemap.enabled && sitemap.host.nil?
|
|
148
146
|
|
|
149
147
|
# Validate meta tags lengths
|
|
150
148
|
if meta_tags.default_title && meta_tags.default_title.length > 60
|
|
@@ -225,7 +223,15 @@ module BetterSeo
|
|
|
225
223
|
|
|
226
224
|
def deep_dup(hash)
|
|
227
225
|
hash.transform_values do |value|
|
|
228
|
-
value.is_a?(Hash)
|
|
226
|
+
if value.is_a?(Hash)
|
|
227
|
+
deep_dup(value)
|
|
228
|
+
else
|
|
229
|
+
begin
|
|
230
|
+
value.dup
|
|
231
|
+
rescue StandardError
|
|
232
|
+
value
|
|
233
|
+
end
|
|
234
|
+
end
|
|
229
235
|
end
|
|
230
236
|
end
|
|
231
237
|
|
|
@@ -299,7 +305,7 @@ module BetterSeo
|
|
|
299
305
|
end
|
|
300
306
|
|
|
301
307
|
def define_accessors!
|
|
302
|
-
@data.
|
|
308
|
+
@data.each_key { |key| define_accessor(key) }
|
|
303
309
|
end
|
|
304
310
|
|
|
305
311
|
def define_accessor(key)
|
data/lib/better_seo/dsl/base.rb
CHANGED
|
@@ -23,10 +23,8 @@ module BetterSeo
|
|
|
23
23
|
return get(:image) if value.nil?
|
|
24
24
|
|
|
25
25
|
if value.is_a?(Hash)
|
|
26
|
-
set(:image, value)
|
|
27
|
-
else
|
|
28
|
-
set(:image, value)
|
|
29
26
|
end
|
|
27
|
+
set(:image, value)
|
|
30
28
|
end
|
|
31
29
|
|
|
32
30
|
def site_name(value = nil)
|
|
@@ -55,10 +53,8 @@ module BetterSeo
|
|
|
55
53
|
return get(:video) if value.nil?
|
|
56
54
|
|
|
57
55
|
if value.is_a?(Hash)
|
|
58
|
-
set(:video, value)
|
|
59
|
-
else
|
|
60
|
-
set(:video, value)
|
|
61
56
|
end
|
|
57
|
+
set(:video, value)
|
|
62
58
|
end
|
|
63
59
|
|
|
64
60
|
def audio(value = nil)
|