jekyll_from_to_until 1.0.1 → 1.0.3

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: 40367980839f79b78e22874ba3a0987a3c7411aa424f062f560cd97c70abaeec
4
- data.tar.gz: 2a9893e23007d9945dd1f2494399b3379102d95cd69db2c1942caf9863dcdbb0
3
+ metadata.gz: 6e9c06080cf832cfcda1eb6c9cd671885c26f512947574df19e6a6ac1fe5c35a
4
+ data.tar.gz: dd4b79b63729f6317cee948f042ce2988668115b9a0a90c654e95518c9902f1f
5
5
  SHA512:
6
- metadata.gz: dffeaed4162224160e6bbc499cb409c5123a0c9b75692617a343fb538d0eff3df54ce82ef0822f8190d1896bb5cd2ba565f548ece16e2883c733ac78ece4532f
7
- data.tar.gz: 91ce5fdae2e170e07e6867a4f53c7d4289d2d0548b02a0af3e95e8a4da4f936cd2ca9418457c4db0b2e16099e5889f4b4a50dbb5566135dddaddd746f6f0fd3b
6
+ metadata.gz: e9586ed9c90b47badb95791248aee4b8774b7c335314881902182f499be6afb173cdc085925186c164bb2bdc77192546ede605579cc39cf3b2b58f5a62f23ddd
7
+ data.tar.gz: f662add178d12e1be22f3595781e974908c6d0b637d78af8d2abd6c03aadc3b6918e4c115723bd5ebaf67966196b969569869695fb3191efea5fe48974acb44e
data/.rubocop.yml CHANGED
@@ -1,16 +1,106 @@
1
- require: rubocop-jekyll
2
- inherit_gem:
3
- rubocop-jekyll: .rubocop.yml
1
+ require:
2
+ # - rubocop-jekyll
3
+ - rubocop-md
4
+ - rubocop-performance
5
+ - rubocop-rake
6
+ - rubocop-rspec
7
+
8
+ # inherit_gem:
9
+ # rubocop-jekyll: .rubocop.yml
4
10
 
5
11
  AllCops:
6
12
  Exclude:
7
- - vendor/**/*
8
- - Gemfile*
13
+ - demo/_site/**/*
14
+ - exe/**/*
15
+ - vendor/**/*
16
+ - Gemfile*
9
17
  NewCops: enable
10
18
  TargetRubyVersion: 2.6
11
19
 
20
+ Gemspec/DeprecatedAttributeAssignment:
21
+ Enabled: false
22
+
23
+ Gemspec/RequireMFA:
24
+ Enabled: false
25
+
26
+ Layout/HashAlignment:
27
+ EnforcedColonStyle: table
28
+ Exclude:
29
+ - jekyll_from_to_until.gemspec
30
+
31
+ Layout/InitialIndentation:
32
+ Exclude:
33
+ - README.md
34
+
12
35
  Layout/LineLength:
13
36
  Max: 150
14
37
 
15
- Layout/MultilineOperationIndentation:
38
+ Layout/MultilineMethodCallIndentation:
39
+ Enabled: false
40
+
41
+ Lint/RedundantCopDisableDirective:
42
+ Exclude:
43
+ - jekyll_from_to_until.gemspec
44
+
45
+ Metrics/AbcSize:
46
+ Max: 45
47
+
48
+ Metrics/BlockLength:
49
+ Exclude:
50
+ - jekyll_from_to_until.gemspec
51
+ - spec/**/*
52
+
53
+ Metrics/ClassLength:
54
+ Exclude:
55
+ - spec/**/*
56
+ Max: 40
57
+
58
+ Metrics/CyclomaticComplexity:
59
+ Max: 20
60
+
61
+ Metrics/MethodLength:
62
+ Max: 40
63
+
64
+ Metrics/PerceivedComplexity:
65
+ Max: 15
66
+
67
+ Naming/FileName:
68
+ Exclude:
69
+ - Rakefile
70
+
71
+ RSpec/ExampleLength:
72
+ Max: 20
73
+
74
+ RSpec/MultipleExpectations:
75
+ Max: 15
76
+
77
+ Style/CommandLiteral:
78
+ Enabled: false
79
+
80
+ Style/CommentedKeyword:
16
81
  Enabled: false
82
+
83
+ Style/Documentation:
84
+ Enabled: false
85
+
86
+ Style/FrozenStringLiteralComment:
87
+ Enabled: false
88
+
89
+ Style/PercentLiteralDelimiters:
90
+ Enabled: false
91
+
92
+ Style/RegexpLiteral:
93
+ Enabled: false
94
+
95
+ Style/StringConcatenation:
96
+ Exclude:
97
+ - spec/**/*
98
+
99
+ Style/StringLiterals:
100
+ Enabled: false
101
+
102
+ Style/StringLiteralsInInterpolation:
103
+ Enabled: false
104
+
105
+ Style/TrailingCommaInHashLiteral:
106
+ EnforcedStyleForMultiline: comma
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 1.0.3 / 2023-02-25
2
+ * Fixed `undefined method 'registers' for nil:NilClass (NoMethodError)`
3
+
4
+ ## 1.0.2 / 2023-02-21
5
+ * Improved how the logger was used.
6
+ * Added `demo` website
7
+
1
8
  ## 1.0.1 / 2022-04-05
2
9
  * Updated to `jekyll_plugin_logger` v2.1.0
3
10
 
data/README.md CHANGED
@@ -23,14 +23,10 @@ Add this line to your application's Gemfile:
23
23
  gem 'jekyll_from_to_until'
24
24
  ```
25
25
 
26
- And then execute:
26
+ And then install in the usual fashion:
27
27
 
28
28
  $ bundle install
29
29
 
30
- Or install it yourself as:
31
-
32
- $ gem install jekyll_from_to_until
33
-
34
30
 
35
31
  ## Syntax
36
32
  The regular expression may be enclosed in single quotes, double quotes, or nothing.
@@ -92,7 +88,6 @@ target/
92
88
  .idea
93
89
  .jekyll-cache/
94
90
  .jekyll-metadata
95
- .makeAwsBucketAndDistribution.log
96
91
  .sass-cache/
97
92
  .yardoc/
98
93
  __pycache__/
@@ -237,7 +232,9 @@ mslinn_aws.tar
237
232
  ```
238
233
 
239
234
  ### More Complex Regular Expressions
240
- The from, to and until filters can all accept more complex regular expressions. This regular expression matches lines that have either the string sun or cloud at the beginning of the line.
235
+ The `from`, `to` and `until` filters can all accept regular expressions.
236
+ The regular expression matches lines that have either the string `sun` or `cloud`
237
+ at the beginning of the line.
241
238
  ```
242
239
  {{ gitignore | from: '^(cloud|sun)' }}
243
240
  ```
@@ -259,11 +256,6 @@ You can also run `bin/console` for an interactive prompt that will allow you to
259
256
  ### Build and Install Locally
260
257
  To build and install this gem onto your local machine, run:
261
258
  ```shell
262
- $ rake install:local
263
- ```
264
-
265
- The following also does the same thing:
266
- ```shell
267
259
  $ bundle exec rake install
268
260
  ```
269
261
 
@@ -283,6 +275,40 @@ jekyll_from_to_until (1.0.0)
283
275
  Generates Jekyll logger with colored output.
284
276
  ```
285
277
 
278
+ ## Demo Website
279
+ A test/demo website is provided in the `demo` directory.
280
+ You can run it under a debugger, or let it run free.
281
+
282
+ The `demo/_bin/debug` script can set various parameters for the demo.
283
+ View the help information with the `-h` option:
284
+ ```shell
285
+ $ demo/_bin/debug -h
286
+
287
+ debug - Run the demo Jekyll website.
288
+
289
+ By default the demo Jekyll website runs without restriction under ruby-debug-ide and debase.
290
+ View it at http://localhost:4444
291
+
292
+ Options:
293
+ -h Show this error message
294
+
295
+ -r Run freely, without a debugger
296
+ ```
297
+
298
+
299
+ ### Debugging the Demo
300
+ To run under a debugger, for example Visual Studio Code:
301
+ 1. Set breakpoints.
302
+
303
+ 2. Initiate a debug session from the command line:
304
+ ```shell
305
+ $ demo/bin/debug
306
+ ```
307
+
308
+ 3. Once the `Fast Debugger` signon appears, launch the Visual Studio Code launch configuration called `Attach rdebug-ide`.
309
+
310
+ 4. View the generated website at [`http://localhost:4444`](http://localhost:4444).
311
+
286
312
 
287
313
  ### Build and Push to RubyGems
288
314
  To release a new version,
data/Rakefile CHANGED
@@ -1,4 +1,2 @@
1
- # frozen_string_literal: true
2
-
3
1
  require "bundler/gem_tasks"
4
- task :default => %i[]
2
+ task default: %i[]
@@ -1,47 +1,37 @@
1
- # frozen_string_literal: true
1
+ require_relative 'lib/jekyll_from_to_until/version'
2
2
 
3
- require_relative "lib/jekyll_from_to_until/version"
4
-
5
- # rubocop:disable Metrics/BlockLength
6
3
  Gem::Specification.new do |spec|
7
- github = "https://github.com/mslinn/jekyll_from_to_until"
4
+ github = 'https://github.com/mslinn/jekyll_from_to_until'
8
5
 
9
- spec.authors = ["Mike Slinn"]
10
- spec.bindir = "exe"
6
+ spec.authors = ['Mike Slinn']
7
+ spec.bindir = 'exe'
11
8
  spec.description = <<~END_DESC
12
9
  This Jekyll plugin provides 3 filters that return portions of a multiline string: from, to and until.
13
10
  Regular expression is used to specify matches; the simplest regular expression is a string.
14
11
  END_DESC
15
- spec.email = ["mslinn@mslinn.com"]
16
- spec.files = Dir[".rubocop.yml", "LICENSE.*", "Rakefile", "{lib,spec}/**/*", "*.gemspec", "*.md"]
17
- spec.homepage = "https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html#from_to_until"
18
- spec.license = "MIT"
12
+ spec.email = ['mslinn@mslinn.com']
13
+ spec.files = Dir['.rubocop.yml', 'LICENSE.*', 'Rakefile', '{lib,spec}/**/*', '*.gemspec', '*.md']
14
+ spec.homepage = 'https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html#from_to_until'
15
+ spec.license = 'MIT'
19
16
  spec.metadata = {
20
- "allowed_push_host" => "https://rubygems.org",
21
- "bug_tracker_uri" => "#{github}/issues",
22
- "changelog_uri" => "#{github}/CHANGELOG.md",
23
- "homepage_uri" => spec.homepage,
24
- "source_code_uri" => github,
17
+ 'allowed_push_host' => 'https://rubygems.org',
18
+ 'bug_tracker_uri' => "#{github}/issues",
19
+ 'changelog_uri' => "#{github}/CHANGELOG.md",
20
+ 'homepage_uri' => spec.homepage,
21
+ 'source_code_uri' => github,
25
22
  }
26
- spec.name = "jekyll_from_to_until"
23
+ spec.name = 'jekyll_from_to_until'
27
24
  spec.post_install_message = <<~END_MESSAGE
28
25
 
29
- Thanks for installing #{spec.name}!
26
+ Thanks for installing #{spec.name} v#{JekyllFromToUntilVersion::VERSION}!
30
27
 
31
28
  END_MESSAGE
32
- spec.require_paths = ["lib"]
33
- spec.required_ruby_version = ">= 2.6.0"
34
- spec.summary = "This Jekyll plugin provides 3 filters that return portions of a multiline string: from, to and until."
29
+ spec.require_paths = ['lib']
30
+ spec.required_ruby_version = '>= 2.6.0'
31
+ spec.summary = 'This Jekyll plugin provides 3 filters that return portions of a multiline string: from, to and until.'
35
32
  spec.test_files = spec.files.grep(%r!^(test|spec|features)/!)
36
33
  spec.version = JekyllFromToUntilVersion::VERSION
37
34
 
38
- spec.add_dependency "jekyll", ">= 3.5.0"
39
- spec.add_dependency "jekyll_plugin_logger"
40
-
41
- spec.add_development_dependency "debase"
42
- # spec.add_development_dependency "rubocop-jekyll"
43
- # spec.add_development_dependency "rubocop-rake"
44
- # spec.add_development_dependency "rubocop-rspec"
45
- spec.add_development_dependency "ruby-debug-ide"
35
+ spec.add_dependency 'jekyll', '>= 3.5.0'
36
+ spec.add_dependency 'jekyll_plugin_logger'
46
37
  end
47
- # rubocop:enable Metrics/BlockLength
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module JekyllFromToUntilVersion
4
- VERSION = "1.0.1"
2
+ VERSION = '1.0.3'.freeze
5
3
  end
@@ -1,18 +1,16 @@
1
- # frozen_string_literal: true
2
-
3
1
  # @author Copyright 2020 Michael Slinn
4
2
  # Jekyll filters for working with multiline strings.
5
3
 
6
- require "jekyll_plugin_logger"
7
- require "liquid"
8
- require_relative "jekyll_from_to_until/version"
4
+ require 'jekyll_plugin_logger'
5
+ require 'liquid'
6
+ require_relative 'jekyll_from_to_until/version'
9
7
 
10
8
  module JekyllPluginFromToUntilName
11
- PLUGIN_NAME = "jekyll_from_to_until"
9
+ PLUGIN_NAME = 'jekyll_from_to_until'.freeze
12
10
  end
13
11
 
14
12
  module FromToUntil
15
- @logger = PluginMetaLogger.instance.new_logger(self, PluginMetaLogger.instance.config)
13
+ @logger = PluginMetaLogger.instance.new_logger("FromToUntil", PluginMetaLogger.instance.config)
16
14
 
17
15
  # Filters a multiline string, returning the portion beginning with the line that satisfies a regex.
18
16
  # The regex could be enclosed in single quotes, double quotes, or nothing.
@@ -22,11 +20,11 @@ module FromToUntil
22
20
  # @example Returns remaining lines starting with the line containing the word `module`.
23
21
  # {{ flexible_include '/blog/2020/10/03/jekyll-plugins.html' | from 'module' }}
24
22
  def from(input_strings, regex)
25
- return "" unless check_parameters(input_strings, regex)
23
+ return '' unless check_parameters(input_strings, regex)
26
24
 
27
25
  regex = remove_quotations(regex.to_s.strip)
28
26
  matched = false
29
- result = ""
27
+ result = ''
30
28
  input_strings.each_line do |line|
31
29
  matched = true if !matched && line =~ %r!#{regex}!
32
30
  result += line if matched
@@ -39,10 +37,10 @@ module FromToUntil
39
37
  # @example Returns lines up to and including the line containing the word `module`.
40
38
  # {{ flexible_include '/blog/2020/10/03/jekyll-plugins.html' | to 'module' }}
41
39
  def to(input_strings, regex)
42
- return "" unless check_parameters(input_strings, regex)
40
+ return '' unless check_parameters(input_strings, regex)
43
41
 
44
42
  regex = remove_quotations(regex.to_s.strip)
45
- result = ""
43
+ result = ''
46
44
  input_strings.each_line do |line|
47
45
  result += line
48
46
  return result if line.match?(%r!#{regex}!)
@@ -55,10 +53,10 @@ module FromToUntil
55
53
  # @example Returns lines up to but not including the line containing the word `module`.
56
54
  # {{ flexible_include '/blog/2020/10/03/jekyll-plugins.html' | until 'module' }}
57
55
  def until(input_strings, regex)
58
- return "" unless check_parameters(input_strings, regex)
56
+ return '' unless check_parameters(input_strings, regex)
59
57
 
60
58
  regex = remove_quotations(regex.to_s.strip)
61
- result = ""
59
+ result = ''
62
60
  input_strings.each_line do |line|
63
61
  return result if line.match?(%r!#{regex}!)
64
62
 
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  require 'jekyll'
4
2
  require 'fileutils'
5
3
  require_relative '../lib/jekyll_from_to_until'
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  require 'jekyll'
4
2
  require 'fileutils'
5
3
  require_relative '../lib/jekyll_from_to_until'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll_from_to_until
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Slinn
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-06 00:00:00.000000000 Z
11
+ date: 2023-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -38,34 +38,6 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: debase
43
- requirement: !ruby/object:Gem::Requirement
44
- 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: ruby-debug-ide
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
41
  description: |
70
42
  This Jekyll plugin provides 3 filters that return portions of a multiline string: from, to and until.
71
43
  Regular expression is used to specify matches; the simplest regular expression is a string.
@@ -96,7 +68,7 @@ metadata:
96
68
  source_code_uri: https://github.com/mslinn/jekyll_from_to_until
97
69
  post_install_message: |2+
98
70
 
99
- Thanks for installing jekyll_from_to_until!
71
+ Thanks for installing jekyll_from_to_until v1.0.3!
100
72
 
101
73
  rdoc_options: []
102
74
  require_paths:
@@ -112,11 +84,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
84
  - !ruby/object:Gem::Version
113
85
  version: '0'
114
86
  requirements: []
115
- rubygems_version: 3.1.4
116
- signing_key:
87
+ rubygems_version: 3.3.3
88
+ signing_key:
117
89
  specification_version: 4
118
90
  summary: 'This Jekyll plugin provides 3 filters that return portions of a multiline
119
91
  string: from, to and until.'
120
92
  test_files:
121
93
  - spec/from_to_until_spec.rb
122
94
  - spec/spec_helper.rb
95
+ ...