jekyll_quote 0.3.0 → 0.4.0

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: 9cbfed4188300ddb73dc023ece7c80e583d1fd9ed0f75e48304d64196441f7c5
4
- data.tar.gz: e907bb7aa7569a6bb54e96f581b7380391ae70949bf33f58fb5934b844fc3d39
3
+ metadata.gz: 410dc88a139c0b1b0769b3896a644e6276f20a45ced9864a01d7f8f540a8e567
4
+ data.tar.gz: 79f5d5b5963ad4f062d3fe8bd772698749025388f72f2672133fba63b83fadbd
5
5
  SHA512:
6
- metadata.gz: 25679145652ff7d0aab9278339ae235c6b4dcaaf50efc887999dfd3c9f58f9fa9043705a87e604a9bb38d6f1f56e19a47ad7dd180bdaa48275c64a7b78472b27
7
- data.tar.gz: 25870ef2184b6faa36355909288b7e1ae1c7fb0a5df71860f494f6b32d025b70477c5ea1808283f313ab6f03b8e0bdef0476c28d54904eb61afe7d79dc4bbdc9
6
+ metadata.gz: 4f3ede950a0fbfefcf9c2731948cd1a3a6b58935ad9cab8b47824a8bfeb4e97d58350c00a61ff52c2bf4ef0f4c2d8df456872015e572a02a94e59f8fbd5f2993
7
+ data.tar.gz: e8449f5ea4015b67cd5726b18fb8675ec3fa21901cf6fcb661de1c4bd1c2acc0d092ce06ef13360a21bc49e264b14a54e53a8f3e5a86ad9a1e2c9167727281e0
data/.rubocop.yml CHANGED
@@ -1,27 +1,103 @@
1
+ require:
2
+ # - rubocop-jekyll
3
+ - rubocop-md
4
+ - rubocop-performance
5
+ - rubocop-rake
6
+ - rubocop-rspec
7
+
1
8
  AllCops:
2
9
  Exclude:
3
- - vendor/**/*
4
- - exe/**/*
5
- - Gemfile*
6
- - Rakefile
7
- - '*.gemspec'
10
+ - demo/_site/**/*
11
+ - exe/**/*
12
+ - vendor/**/*
13
+ - Gemfile*
14
+ - Rakefile
15
+ - jekyll_quote.gemspec
8
16
  NewCops: enable
9
17
  TargetRubyVersion: 2.6
10
18
 
11
- Layout/HashAlignment:
19
+ Gemspec/DeprecatedAttributeAssignment:
20
+ Enabled: false
21
+
22
+ Gemspec/RequireMFA:
12
23
  Enabled: false
13
24
 
25
+ Layout/InitialIndentation:
26
+ Exclude:
27
+ - README.md
28
+
29
+ Layout/HashAlignment:
30
+ EnforcedColonStyle: table
31
+ EnforcedHashRocketStyle: table
32
+
14
33
  Layout/LineLength:
15
34
  Max: 150
16
35
 
17
- Metrics/MethodLength:
18
- Max: 30
19
-
20
36
  Layout/MultilineMethodCallIndentation:
21
37
  Enabled: false
22
38
 
39
+ Lint/RedundantCopDisableDirective:
40
+ Exclude:
41
+ - jekyll_quote.gemspec
42
+
43
+ Metrics/AbcSize:
44
+ Max: 25
45
+
46
+ Metrics/BlockLength:
47
+ Exclude:
48
+ - jekyll_quote.gemspec
49
+ - spec/**/*
50
+
51
+ Metrics/ClassLength:
52
+ Exclude:
53
+ - spec/**/*
54
+
55
+ Metrics/MethodLength:
56
+ Max: 30
57
+
23
58
  Metrics/CyclomaticComplexity:
24
59
  Max: 10
25
60
 
26
61
  Metrics/PerceivedComplexity:
27
62
  Max: 10
63
+
64
+ Naming/FileName:
65
+ Exclude:
66
+ - Rakefile
67
+
68
+ RSpec/ExampleLength:
69
+ Max: 20
70
+
71
+ RSpec/MultipleExpectations:
72
+ Max: 15
73
+
74
+ Style/CommandLiteral:
75
+ Enabled: false
76
+
77
+ Style/CommentedKeyword:
78
+ Enabled: false
79
+
80
+ Style/Documentation:
81
+ Enabled: false
82
+
83
+ Style/FrozenStringLiteralComment:
84
+ Enabled: false
85
+
86
+ Style/PercentLiteralDelimiters:
87
+ Enabled: false
88
+
89
+ Style/RegexpLiteral:
90
+ Enabled: false
91
+
92
+ Style/StringConcatenation:
93
+ Exclude:
94
+ - spec/**/*
95
+
96
+ Style/StringLiterals:
97
+ Enabled: false
98
+
99
+ Style/StringLiteralsInInterpolation:
100
+ Enabled: false
101
+
102
+ Style/TrailingCommaInHashLiteral:
103
+ EnforcedStyleForMultiline: comma
data/CHANGELOG.md CHANGED
@@ -1,8 +1,14 @@
1
- ## 0.1.0 / 2023-01-12
2
- * Initial version
1
+ ## 0.4.0 / 2023-04-05
2
+ * Added [`attribution` support](https://github.com/mslinn/jekyll_plugin_support#subclass-attribution).
3
3
 
4
- ## 0.2.0 / 2023-01-14
5
- * Added options: `break`, `by`, and `noprep`
4
+ ## 0.3.1 / 2023-03-15
5
+ * Added CSS class: `clearfix`
6
6
 
7
7
  ## 0.3.0 / 2023-01-14
8
8
  * Added CSS classes: `quoteAttribution` and `quoteText`
9
+
10
+ ## 0.2.0 / 2023-01-14
11
+ * Added options: `break`, `by`, and `noprep`
12
+
13
+ ## 0.1.0 / 2023-01-12
14
+ * Initial version
data/README.md CHANGED
@@ -8,8 +8,7 @@ See [demo/index.html](demo/index.html) for examples.
8
8
 
9
9
 
10
10
  ## Installation
11
-
12
- Add this line to your Jekyll project's Gemfile, within the `jekyll_plugins` group:
11
+ Add the following line to your Jekyll project's Gemfile, within the `jekyll_plugins` group:
13
12
 
14
13
  ```ruby
15
14
  group :jekyll_plugins do
@@ -17,19 +16,13 @@ group :jekyll_plugins do
17
16
  end
18
17
  ```
19
18
 
20
- Also add it to `_config.yml`:
21
- ```yaml
22
- plugins:
23
- - jekyll_quote
24
- ```
25
-
26
19
  And then execute:
27
20
 
28
21
  $ bundle install
29
22
 
30
- Or install it yourself as:
31
23
 
32
- $ gem install jekyll_quote
24
+ ## Attribution
25
+ See [`jekyll_plugin_support` for `attribution`](https://github.com/mslinn/jekyll_plugin_support#subclass-attribution)
33
26
 
34
27
 
35
28
  ## Additional Information
@@ -66,7 +59,7 @@ jekyll_quote (0.1.0)
66
59
  Generates Jekyll logger with colored output.
67
60
  ```
68
61
 
69
- ### Testing
62
+ ### Demo
70
63
  Examine the output by running:
71
64
  ```shell
72
65
  $ demo/_bin/debug -r
data/Rakefile CHANGED
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  require 'bundler/gem_tasks'
4
2
  require 'rspec/core/rake_task'
5
3
 
data/jekyll_quote.gemspec CHANGED
@@ -1,16 +1,13 @@
1
- # frozen_string_literal: true
2
-
3
1
  require_relative 'lib/jekyll_quote/version'
4
2
 
5
- # rubocop:disable Metrics/BlockLength
6
- Gem::Specification.new do |spec|
3
+ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
7
4
  github = 'https://github.com/mslinn/jekyll_quote'
8
5
 
9
6
  spec.bindir = 'exe'
10
7
  spec.authors = ['Mike Slinn']
11
8
  spec.email = ['mslinn@mslinn.com']
12
9
  spec.files = Dir['.rubocop.yml', 'LICENSE.*', 'Rakefile', '{lib,spec}/**/*', '*.gemspec', '*.md']
13
- spec.homepage = 'https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html#quote'
10
+ spec.homepage = 'https://www.mslinn.com/jekyll/3000-jekyll-plugins.html#jekyll_quote'
14
11
  spec.license = 'MIT'
15
12
  spec.metadata = {
16
13
  'allowed_push_host' => 'https://rubygems.org',
@@ -32,14 +29,5 @@ Gem::Specification.new do |spec|
32
29
  spec.version = JekyllQuoteVersion::VERSION
33
30
 
34
31
  spec.add_dependency 'jekyll', '>= 3.5.0'
35
-
36
- spec.add_development_dependency 'debase'
37
- spec.add_development_dependency 'jekyll_plugin_support'
38
- spec.add_development_dependency 'rspec-match_ignoring_whitespace'
39
- spec.add_development_dependency 'rubocop'
40
- # spec.add_development_dependency 'rubocop-jekyll'
41
- spec.add_development_dependency 'rubocop-rake'
42
- spec.add_development_dependency 'rubocop-rspec'
43
- spec.add_development_dependency 'ruby-debug-ide'
32
+ spec.add_dependency 'jekyll_plugin_support', '~> 0.6.0'
44
33
  end
45
- # rubocop:enable Metrics/BlockLength
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module JekyllQuoteVersion
4
- VERSION = '0.3.0'
2
+ VERSION = '0.4.0'.freeze
5
3
  end
data/lib/jekyll_quote.rb CHANGED
@@ -1,14 +1,12 @@
1
- # frozen_string_literal: true
2
-
3
1
  require 'jekyll_plugin_support'
4
- require 'jekyll_plugin_support_helper'
2
+ require 'jekyll_plugin_helper'
5
3
  require_relative 'jekyll_quote/version'
6
4
 
7
5
  # @author Copyright 2022 Michael Slinn
8
6
  # @license SPDX-License-Identifier: Apache-2.0
9
7
 
10
8
  module QuoteModule
11
- PLUGIN_NAME = 'quote'
9
+ PLUGIN_NAME = 'quote'.freeze
12
10
  end
13
11
 
14
12
  module Jekyll
@@ -21,7 +19,11 @@ module Jekyll
21
19
  class Quote < JekyllSupport::JekyllBlock
22
20
  attr_accessor :cite, :url
23
21
 
22
+ include JekyllQuoteVersion
23
+
24
24
  def render_impl(text)
25
+ @helper.gem_file __FILE__ # This enables plugin attribution
26
+
25
27
  @break = @helper.parameter_specified? 'break' # enforced by CSS if a list ends the body
26
28
  @by = @helper.parameter_specified? 'by'
27
29
  @cite = @helper.parameter_specified? 'cite'
@@ -32,23 +34,23 @@ module Jekyll
32
34
  preposition = 'By' if @by
33
35
  preposition = '' if @noprep
34
36
  if @cite
35
- attribution = if @url && !@url.empty?
36
- "<a href='#{@url}' rel='nofollow' target='_blank'>#{@cite}</a>"
37
- else
38
- "#{@cite}\n"
39
- end
37
+ quote_attribution = if @url && !@url.empty?
38
+ "<a href='#{@url}' rel='nofollow' target='_blank'>#{@cite}</a>"
39
+ else
40
+ "#{@cite}\n"
41
+ end
40
42
  tag = @break ? 'div' : 'span'
41
- attribution = "<#{tag} class='quoteAttribution'> &nbsp;&ndash; #{preposition} #{attribution}</#{tag}>\n"
42
- text = "<div class='quoteText'>#{text}</div>" if @break
43
+ quote_attribution = "<#{tag} class='quoteAttribution'> &nbsp;&ndash; #{preposition} #{quote_attribution}</#{tag}>\n"
44
+ text = "<div class='quoteText clearfix'>#{text}</div>" if @break
43
45
  end
44
46
  <<~END_HERE
45
47
  <div class='quote'>
46
- #{text}#{attribution}
48
+ #{text}#{quote_attribution}
49
+ #{@helper.attribute if @helper.attribution}
47
50
  </div>
48
51
  END_HERE
49
52
  end
53
+
54
+ JekyllPluginHelper.register(self, QuoteModule::PLUGIN_NAME)
50
55
  end
51
56
  end
52
-
53
- PluginMetaLogger.instance.info { "Loaded #{QuoteModule::PLUGIN_NAME} v0.1.0 plugin." }
54
- Liquid::Template.register_tag(QuoteModule::PLUGIN_NAME, Jekyll::Quote)
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  require 'jekyll'
4
2
  require 'jekyll_plugin_logger'
5
3
  require 'rspec/match_ignoring_whitespace'
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  require 'jekyll'
4
2
  require_relative '../lib/jekyll_quote'
5
3
 
@@ -0,0 +1,6 @@
1
+ example_id | status | run_time |
2
+ -------------------------------- | ------ | --------------- |
3
+ ./spec/jekyll_quote_spec.rb[1:1] | failed | 0.01849 seconds |
4
+ ./spec/jekyll_quote_spec.rb[1:2] | failed | 0.00035 seconds |
5
+ ./spec/jekyll_quote_spec.rb[1:3] | failed | 0.00018 seconds |
6
+ ./spec/jekyll_quote_spec.rb[1:4] | failed | 0.00009 seconds |
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll_quote
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Slinn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-19 00:00:00.000000000 Z
11
+ date: 2023-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -24,104 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 3.5.0
27
- - !ruby/object:Gem::Dependency
28
- name: debase
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: jekyll_plugin_support
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: rspec-match_ignoring_whitespace
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: rubocop
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
31
+ - - "~>"
74
32
  - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: rubocop-rake
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: rubocop-rspec
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: ruby-debug-ide
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
33
+ version: 0.6.0
34
+ type: :runtime
119
35
  prerelease: false
120
36
  version_requirements: !ruby/object:Gem::Requirement
121
37
  requirements:
122
- - - ">="
38
+ - - "~>"
123
39
  - !ruby/object:Gem::Version
124
- version: '0'
40
+ version: 0.6.0
125
41
  description:
126
42
  email:
127
43
  - mslinn@mslinn.com
@@ -139,14 +55,15 @@ files:
139
55
  - lib/jekyll_quote/version.rb
140
56
  - spec/jekyll_quote_spec.rb
141
57
  - spec/spec_helper.rb
142
- homepage: https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html#quote
58
+ - spec/status_persistence.txt
59
+ homepage: https://www.mslinn.com/jekyll/3000-jekyll-plugins.html#jekyll_quote
143
60
  licenses:
144
61
  - MIT
145
62
  metadata:
146
63
  allowed_push_host: https://rubygems.org
147
64
  bug_tracker_uri: https://github.com/mslinn/jekyll_quote/issues
148
65
  changelog_uri: https://github.com/mslinn/jekyll_quote/CHANGELOG.md
149
- homepage_uri: https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html#quote
66
+ homepage_uri: https://www.mslinn.com/jekyll/3000-jekyll-plugins.html#jekyll_quote
150
67
  source_code_uri: https://github.com/mslinn/jekyll_quote
151
68
  post_install_message: |2+
152
69
 
@@ -173,4 +90,5 @@ summary: Provides a Jekyll filter that creates formatted quotes.
173
90
  test_files:
174
91
  - spec/jekyll_quote_spec.rb
175
92
  - spec/spec_helper.rb
93
+ - spec/status_persistence.txt
176
94
  ...