jekyll_from_to_until 1.0.0 → 1.0.2

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: 9517266ec097c2c09c61fff55305331cbb8bdc7948f83c9aebf65ba389f92c98
4
- data.tar.gz: aba3d59ca29e51fe632f48963bf9a1bbc28a2d794e8c4c1de244ac1857f67432
3
+ metadata.gz: ae2bab81284396893b6c47b1bd67c4e95c95f2d44ed2521405eb1ce8905d05f8
4
+ data.tar.gz: 98decead66f66d2a77dc55e752ee6d2a17cb947adbd259783a5e992f32b95480
5
5
  SHA512:
6
- metadata.gz: 430b2dce1ce0819671b3fd0b424bbd697ccde1edeac0e80ae78e2c531c9b852c3f9b6ac00b8d6cb4c9ecbeff2f2aaed0b10ace4e5e56e394b236e6e6e5ef5dec
7
- data.tar.gz: 10e2dff6a413bd310af07e719b6a654ced0cf6572f46720eb248ec30a26380f11b5f8780edb557c4b3b701f820998f46a52e5546f647f7cdfb06029d4af514a3
6
+ metadata.gz: 881d77fdb20184c3062ee5da4faf129bb8a0e7bac2311308de006f63ace6183906075b19a886e84f1814ed6dbd00bd53faba10bcba4e6d95af27efadce0e86fd
7
+ data.tar.gz: 2220e933a40ec1a17231c21f7d620e1734bad5402147dc5f5ddeb5961246ef7a9bb84637b0836a5be0b1a7f6dd299c2653d81732752a14e3681490c66ec5604c
data/.rubocop.yml CHANGED
@@ -1,24 +1,88 @@
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/InitialIndentation:
27
+ Exclude:
28
+ - README.md
29
+
30
+ Layout/HashAlignment:
31
+ EnforcedColonStyle: table
32
+ Exclude:
33
+ - jekyll_from_to_until.gemspec
34
+
12
35
  Layout/LineLength:
13
36
  Max: 150
14
37
 
15
38
  Layout/MultilineMethodCallIndentation:
16
39
  Enabled: false
17
40
 
18
- Layout/MultilineOperationIndentation:
19
- Enabled: false
41
+ Lint/RedundantCopDisableDirective:
42
+ Exclude:
43
+ - jekyll_from_to_until.gemspec
44
+
45
+ Metrics/AbcSize:
46
+ Max: 45
20
47
 
21
48
  Metrics/BlockLength:
49
+ Exclude:
50
+ - jekyll_from_to_until.gemspec
51
+ - spec/**/*
52
+
53
+ Metrics/ClassLength:
54
+ Exclude:
55
+ - spec/**/*
56
+
57
+ Metrics/CyclomaticComplexity:
58
+ Max: 20
59
+
60
+ Metrics/MethodLength:
61
+ Max: 40
62
+
63
+ Metrics/PerceivedComplexity:
64
+ Max: 15
65
+
66
+ Naming/FileName:
67
+ Exclude:
68
+ - Rakefile
69
+
70
+ RSpec/ExampleLength:
71
+ Max: 20
72
+
73
+ RSpec/MultipleExpectations:
74
+ Max: 15
75
+
76
+ Style/CommandLiteral:
77
+ Enabled: false
78
+
79
+ Style/CommentedKeyword:
80
+ Enabled: false
81
+
82
+ Style/Documentation:
83
+ Enabled: false
84
+
85
+ Style/FrozenStringLiteralComment:
22
86
  Enabled: false
23
87
 
24
88
  Style/PercentLiteralDelimiters:
@@ -27,8 +91,15 @@ Style/PercentLiteralDelimiters:
27
91
  Style/RegexpLiteral:
28
92
  Enabled: false
29
93
 
94
+ Style/StringConcatenation:
95
+ Exclude:
96
+ - spec/**/*
97
+
30
98
  Style/StringLiterals:
31
99
  Enabled: false
32
100
 
33
101
  Style/StringLiteralsInInterpolation:
34
102
  Enabled: false
103
+
104
+ Style/TrailingCommaInHashLiteral:
105
+ EnforcedStyleForMultiline: comma
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 1.0.2 / 2023-02-21
2
+ * Improved how the logger was used.
3
+ * Added `demo` website
4
+
5
+ ## 1.0.1 / 2022-04-05
6
+ * Updated to `jekyll_plugin_logger` v2.1.0
7
+
1
8
  ## 1.0.0 / 2022-03-14
2
9
  * Made into a Ruby gem and published on RubyGems.org as [jekyll_from_to_until](https://rubygems.org/gems/jekyll_from_to_until).
3
10
  * `bin/attach` script added for debugging
data/README.md CHANGED
@@ -10,6 +10,11 @@ Regular expression is used to specify matches; the simplest regular expression i
10
10
 
11
11
  [Rubular](https://rubular.com/) is a handy online tool to try out regular expressions.
12
12
 
13
+
14
+ ### Additional Information
15
+ More information is available on my web site about [my Jekyll plugins](https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html).
16
+
17
+
13
18
  ## Installation
14
19
 
15
20
  Add this line to your application's Gemfile:
@@ -18,14 +23,10 @@ Add this line to your application's Gemfile:
18
23
  gem 'jekyll_from_to_until'
19
24
  ```
20
25
 
21
- And then execute:
26
+ And then install in the usual fashion:
22
27
 
23
28
  $ bundle install
24
29
 
25
- Or install it yourself as:
26
-
27
- $ gem install jekyll_from_to_until
28
-
29
30
 
30
31
  ## Syntax
31
32
  The regular expression may be enclosed in single quotes, double quotes, or nothing.
@@ -56,7 +57,7 @@ All of these examples perform identically.
56
57
  :warning: Important: the name of the filter must be followed by a colon (:). If you fail to do that an error will be generated and the Jekyll site building process will halt. The error message looks something like this: `Liquid Warning: Liquid syntax error (line 285): Expected end_of_string but found string in "{{ lines | from '2' | until: '4' | xml_escape }}" in /some_directory/some_files.html Liquid Exception: Liquid error (line 285): wrong number of arguments (given 1, expected 2) in /some_directory/some_file.html Error: Liquid error (line 285): wrong number of arguments (given 1, expected 2)`
57
58
  ## Usage
58
59
 
59
- Some of the following examples use a multiline string containing 5 lines, called lines, which was created this way:
60
+ Some of the following examples use a multiline string called `lines` that contains 5 lines, which was created this way:
60
61
 
61
62
  ```
62
63
  {% capture lines %}line 1
@@ -67,7 +68,7 @@ line 5
67
68
  {% endcapture %}
68
69
  ```
69
70
 
70
- Other examples use a multiline string containing the contents of .gitignore, which looks like this:
71
+ Other examples use a multiline string called `gitignore` that contains the contents of a mythical `.gitignore` file, which looks like this:
71
72
  ```
72
73
  .bsp/
73
74
  project/
@@ -87,7 +88,6 @@ target/
87
88
  .idea
88
89
  .jekyll-cache/
89
90
  .jekyll-metadata
90
- .makeAwsBucketAndDistribution.log
91
91
  .sass-cache/
92
92
  .yardoc/
93
93
  __pycache__/
@@ -143,7 +143,7 @@ mslinn_aws.tar
143
143
  ```
144
144
 
145
145
  ### To the third line of string
146
- These examples return the lines of the file from the first line until a line with the string "3" is found, including the matched line. The only difference between the examples is the delimiter around the regular expression.
146
+ These examples return the lines of the file from the first line until a line with the string `"3"` is found, including the matched line. The only difference between the examples is the delimiter around the regular expression.
147
147
  ```
148
148
  {{ lines | to: '3' }}
149
149
  {{ lines | to: "3" }}
@@ -175,7 +175,7 @@ target/
175
175
  ```
176
176
 
177
177
  ### Until the third line of string
178
- These examples return the lines of the file until a line with the string "3" is found, excluding the matched line. The only difference between the examples is the delimiter around the regular expression.
178
+ These examples return the lines of the file until a line with the string `"3"` is found, excluding the matched line. The only difference between the examples is the delimiter around the regular expression.
179
179
  ```
180
180
  {{ lines | until: '3' }}
181
181
  {{ lines | until: "3" }}
@@ -205,7 +205,7 @@ target/
205
205
  ```
206
206
 
207
207
  ### From the string "2" until the string "4"
208
- These examples return the lines of the file until a line with the string "3" is found, excluding the matched line. The only difference between the examples is the delimiter around the regular expression.
208
+ These examples return the lines of the file until a line with the string `"3"` is found, excluding the matched line. The only difference between the examples is the delimiter around the regular expression.
209
209
  ```
210
210
  {{ lines | from: '2' | until: '4' }}
211
211
  {{ lines | from: "2" | until: "4" }}
@@ -232,7 +232,9 @@ mslinn_aws.tar
232
232
  ```
233
233
 
234
234
  ### More Complex Regular Expressions
235
- 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.
236
238
  ```
237
239
  {{ gitignore | from: '^(cloud|sun)' }}
238
240
  ```
@@ -246,18 +248,87 @@ mslinn_aws.tar
246
248
 
247
249
  ## Development
248
250
 
249
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
251
+ After checking out the repo, run `bin/setup` to install dependencies.
252
+
253
+ You can also run `bin/console` for an interactive prompt that will allow you to experiment.
254
+
250
255
 
251
- Install development dependencies like this:
256
+ ### Build and Install Locally
257
+ To build and install this gem onto your local machine, run:
258
+ ```shell
259
+ $ bundle exec rake install
252
260
  ```
253
- $ BUNDLE_WITH="development" bundle install
261
+
262
+ Examine the newly built gem:
263
+ ```shell
264
+ $ gem info jekyll_from_to_until
265
+
266
+ *** LOCAL GEMS ***
267
+
268
+ jekyll_from_to_until (1.0.0)
269
+ Author: Mike Slinn
270
+ Homepage:
271
+ https://github.com/mslinn/jekyll_from_to_until
272
+ License: MIT
273
+ Installed at: /home/mslinn/.gems
274
+
275
+ Generates Jekyll logger with colored output.
276
+ ```
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
254
296
  ```
255
297
 
256
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
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
+
312
+
313
+ ### Build and Push to RubyGems
314
+ To release a new version,
315
+ 1. Update the version number in `version.rb`.
316
+ 2. Commit all changes to git; if you don't the next step might fail with an unexplainable error message.
317
+ 3. Run the following:
318
+ ```shell
319
+ $ bundle exec rake release
320
+ ```
321
+ The above creates a git tag for the version, commits the created tag,
322
+ and pushes the new `.gem` file to [RubyGems.org](https://rubygems.org).
323
+
257
324
 
258
325
  ## Contributing
259
326
 
260
- Bug reports and pull requests are welcome on GitHub at https://github.com/mslinn/jekyll_from_to_until.
327
+ 1. Fork the project
328
+ 2. Create a descriptively named feature branch
329
+ 3. Add your feature
330
+ 4. Submit a pull request
331
+
261
332
 
262
333
  ## License
263
334
 
data/Rakefile CHANGED
@@ -1,4 +1,2 @@
1
- # frozen_string_literal: true
2
-
3
1
  require "bundler/gem_tasks"
4
2
  task default: %i[]
@@ -1,49 +1,37 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "lib/jekyll_from_to_until/version"
1
+ require_relative 'lib/jekyll_from_to_until/version'
4
2
 
5
3
  Gem::Specification.new do |spec|
6
- spec.name = "jekyll_from_to_until"
7
- spec.version = JekyllFromToUntil::VERSION
8
- spec.authors = ["Mike Slinn"]
9
- spec.email = ["mslinn@mslinn.com"]
4
+ github = 'https://github.com/mslinn/jekyll_from_to_until'
10
5
 
11
- spec.summary = "This Jekyll plugin provides 3 filters that return portions of a multiline string: from, to and until."
6
+ spec.authors = ['Mike Slinn']
7
+ spec.bindir = 'exe'
12
8
  spec.description = <<~END_DESC
13
9
  This Jekyll plugin provides 3 filters that return portions of a multiline string: from, to and until.
14
10
  Regular expression is used to specify matches; the simplest regular expression is a string.
15
11
  END_DESC
16
- spec.homepage = 'https://github.com/mslinn/jekyll_from_to_until'
17
- spec.license = "MIT"
18
- spec.required_ruby_version = ">= 2.6.0"
19
-
20
- spec.metadata["allowed_push_host"] = "https://rubygems.org/"
21
-
22
- spec.metadata["homepage_uri"] = spec.homepage
23
- spec.metadata["source_code_uri"] = 'https://github.com/mslinn/jekyll_from_to_until'
24
- spec.metadata["changelog_uri"] = 'https://github.com/mslinn/jekyll_from_to_until/CHANGELOG.md'
25
-
26
- # Specify which files should be added to the gem when it is released.
27
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
28
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
29
- `git ls-files -z`.split("\x0").reject do |f|
30
- (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
31
- end
32
- end
33
- spec.bindir = "exe"
34
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
35
- spec.require_paths = ["lib"]
36
-
37
- spec.add_dependency 'jekyll'
38
-
39
- spec.add_development_dependency 'bundler'
40
- spec.add_development_dependency 'debase'
41
- spec.add_development_dependency 'jekyll'
42
- spec.add_development_dependency 'pry'
43
- spec.add_development_dependency 'rake'
44
- spec.add_development_dependency 'rspec'
45
- spec.add_development_dependency 'rubocop'
46
- spec.add_development_dependency 'rubocop-jekyll'
47
- spec.add_development_dependency 'rubocop-rake'
48
- spec.add_development_dependency 'ruby-debug-ide'
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'
16
+ spec.metadata = {
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,
22
+ }
23
+ spec.name = 'jekyll_from_to_until'
24
+ spec.post_install_message = <<~END_MESSAGE
25
+
26
+ Thanks for installing #{spec.name}!
27
+
28
+ END_MESSAGE
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.'
32
+ spec.test_files = spec.files.grep(%r!^(test|spec|features)/!)
33
+ spec.version = JekyllFromToUntilVersion::VERSION
34
+
35
+ spec.add_dependency 'jekyll', '>= 3.5.0'
36
+ spec.add_dependency 'jekyll_plugin_logger'
49
37
  end
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
- module JekyllFromToUntil
4
- VERSION = "1.0.0"
1
+ module JekyllFromToUntilVersion
2
+ VERSION = '1.0.2'.freeze
5
3
  end
@@ -1,12 +1,18 @@
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_relative "jekyll_from_to_until/version"
4
+ require 'jekyll_plugin_logger'
5
+ require 'liquid'
6
+ require_relative 'jekyll_from_to_until/version'
7
+
8
+ module JekyllPluginFromToUntilName
9
+ PLUGIN_NAME = 'jekyll_from_to_until'.freeze
10
+ end
7
11
 
8
- module JekyllFromToUntil
9
- class Error < StandardError; end
12
+ module FromToUntil
13
+ def initialize(_)
14
+ @logger = PluginMetaLogger.instance.new_logger("FromToUntil", PluginMetaLogger.instance.config)
15
+ end
10
16
 
11
17
  # Filters a multiline string, returning the portion beginning with the line that satisfies a regex.
12
18
  # The regex could be enclosed in single quotes, double quotes, or nothing.
@@ -22,7 +28,7 @@ module JekyllFromToUntil
22
28
  matched = false
23
29
  result = ''
24
30
  input_strings.each_line do |line|
25
- matched = true if !matched && line =~ /#{regex}/
31
+ matched = true if !matched && line =~ %r!#{regex}!
26
32
  result += line if matched
27
33
  end
28
34
  result
@@ -39,7 +45,7 @@ module JekyllFromToUntil
39
45
  result = ''
40
46
  input_strings.each_line do |line|
41
47
  result += line
42
- return result if line.match?(/#{regex}/)
48
+ return result if line.match?(%r!#{regex}!)
43
49
  end
44
50
  result
45
51
  end
@@ -54,7 +60,7 @@ module JekyllFromToUntil
54
60
  regex = remove_quotations(regex.to_s.strip)
55
61
  result = ''
56
62
  input_strings.each_line do |line|
57
- return result if line.match?(/#{regex}/)
63
+ return result if line.match?(%r!#{regex}!)
58
64
 
59
65
  result += line
60
66
  end
@@ -65,13 +71,13 @@ module JekyllFromToUntil
65
71
 
66
72
  def check_parameters(input_strings, regex)
67
73
  if input_strings.nil? || input_strings.empty?
68
- Jekyll.logger.warn "Warning: Plugin 'from' received no input for regex #{regex}."
74
+ @logger.warn { "Warning: Plugin 'from' received no input for regex #{regex}." }
69
75
  return false
70
76
  end
71
77
 
72
78
  regex = regex.to_s
73
79
  if regex.nil? || regex.empty?
74
- Jekyll.logger.warn "Warning: Plugin 'from' received no regex for input #{input_strings}."
80
+ @logger.warn { "Warning: Plugin 'from' received no regex for input #{input_strings}." }
75
81
  return false
76
82
  end
77
83
  true
@@ -84,4 +90,5 @@ module JekyllFromToUntil
84
90
  end
85
91
  end
86
92
 
87
- Liquid::Template.register_filter(JekyllFromToUntil)
93
+ PluginMetaLogger.instance.info { "Loaded #{JekyllPluginFromToUntilName::PLUGIN_NAME} v#{JekyllFromToUntilVersion::VERSION} plugin." }
94
+ Liquid::Template.register_filter(FromToUntil)
@@ -0,0 +1,85 @@
1
+ require 'jekyll'
2
+ require 'fileutils'
3
+ require_relative '../lib/jekyll_from_to_until'
4
+
5
+ RSpec.describe(JekyllFromToUntil) do
6
+ include JekyllFromToUntil
7
+
8
+ let(:lines) do
9
+ <<~END_OF_LINES
10
+ line 1
11
+ line 2
12
+ line 3
13
+ line 4
14
+ line 5
15
+ END_OF_LINES
16
+ end
17
+
18
+ let(:gitignore) do
19
+ <<~END_OF_LINES
20
+ .bsp/
21
+ project/
22
+ target/
23
+ *.gz
24
+ *.sublime*
25
+ *.swp
26
+ *.out
27
+ *.Identifier
28
+ *.log
29
+ .idea*
30
+ *.iml
31
+ *.tmp
32
+ *~
33
+ ~*
34
+ .DS_Store
35
+ .idea
36
+ .jekyll-cache/
37
+ .jekyll-metadata
38
+ .makeAwsBucketAndDistribution.log
39
+ .sass-cache/
40
+ .yardoc/
41
+ __pycache__/
42
+ __MACOSX
43
+ _build/
44
+ _package/
45
+ _site/
46
+ bin/*.class
47
+ doc/
48
+ jekyll/doc/
49
+ node_modules/
50
+ Notepad++/
51
+ out/
52
+ package/
53
+ instances.json
54
+ rescue_ubuntu2010
55
+ rescue_ubuntu2010.b64
56
+ landingPageShortName.md
57
+ test.html
58
+ RUNNING_PID
59
+ mslinn_jekyll_plugins.zip
60
+ cloud9.tar
61
+ cloud9.zip
62
+ mslinn_aws.tar
63
+ END_OF_LINES
64
+ end
65
+
66
+ it 'verifies from' do
67
+ expect(from(lines, '3')).to eq("line 3\nline 4\nline 5\n")
68
+ expect(from(gitignore, 'PID')).to eq("RUNNING_PID\nmslinn_jekyll_plugins.zip\ncloud9.tar\ncloud9.zip\nmslinn_aws.tar\n")
69
+ end
70
+
71
+ it 'verifies to' do
72
+ expect(to(lines, '3')).to eq("line 1\nline 2\nline 3\n")
73
+ expect(to(gitignore, 'idea')).to eq(".bsp/\nproject/\ntarget/\n*.gz\n*.sublime*\n*.swp\n*.out\n*.Identifier\n*.log\n.idea*\n")
74
+ end
75
+
76
+ it 'verifies until' do
77
+ # until is a Ruby keyword
78
+ expect(method(:until).call(lines, '3')).to eq("line 1\nline 2\n")
79
+ expect(method(:until).call(gitignore, 'idea')).to eq(".bsp/\nproject/\ntarget/\n*.gz\n*.sublime*\n*.swp\n*.out\n*.Identifier\n*.log\n")
80
+ end
81
+
82
+ it 'verifies from regex' do
83
+ expect(from(gitignore, '^(cloud|sun)')).to eq("cloud9.tar\ncloud9.zip\nmslinn_aws.tar\n")
84
+ end
85
+ end
@@ -0,0 +1,14 @@
1
+ require 'jekyll'
2
+ require 'fileutils'
3
+ require_relative '../lib/jekyll_from_to_until'
4
+
5
+ Jekyll.logger.log_level = :info
6
+
7
+ RSpec.configure do |config|
8
+ config.filter_run :focus
9
+ config.order = 'random'
10
+ config.run_all_when_everything_filtered = true
11
+
12
+ # See https://relishapp.com/rspec/rspec-core/docs/command-line/only-failures
13
+ config.example_status_persistence_file_path = "spec/status_persistence.txt"
14
+ end
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.0
4
+ version: 1.0.2
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-03-14 00:00:00.000000000 Z
11
+ date: 2023-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -16,148 +16,22 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 3.5.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: bundler
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
- - !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: jekyll
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: pry
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !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: 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'
26
+ version: 3.5.0
97
27
  - !ruby/object:Gem::Dependency
98
- name: rspec
28
+ name: jekyll_plugin_logger
99
29
  requirement: !ruby/object:Gem::Requirement
100
30
  requirements:
101
31
  - - ">="
102
32
  - !ruby/object:Gem::Version
103
33
  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: rubocop
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: rubocop-jekyll
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: rubocop-rake
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
- - !ruby/object:Gem::Dependency
154
- name: ruby-debug-ide
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: '0'
160
- type: :development
34
+ type: :runtime
161
35
  prerelease: false
162
36
  version_requirements: !ruby/object:Gem::Requirement
163
37
  requirements:
@@ -173,30 +47,29 @@ executables: []
173
47
  extensions: []
174
48
  extra_rdoc_files: []
175
49
  files:
176
- - ".rspec"
177
50
  - ".rubocop.yml"
178
- - ".ruby-version"
179
- - ".vscode/launch.json"
180
- - ".vscode/settings.json"
181
51
  - CHANGELOG.md
182
- - Gemfile
183
- - Gemfile.lock
184
52
  - LICENSE.txt
185
53
  - README.md
186
54
  - Rakefile
187
55
  - jekyll_from_to_until.gemspec
188
56
  - lib/jekyll_from_to_until.rb
189
57
  - lib/jekyll_from_to_until/version.rb
190
- - sig/jekyll_from_to_until.rbs
191
- homepage: https://github.com/mslinn/jekyll_from_to_until
58
+ - spec/from_to_until_spec.rb
59
+ - spec/spec_helper.rb
60
+ homepage: https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html#from_to_until
192
61
  licenses:
193
62
  - MIT
194
63
  metadata:
195
- allowed_push_host: https://rubygems.org/
196
- homepage_uri: https://github.com/mslinn/jekyll_from_to_until
197
- source_code_uri: https://github.com/mslinn/jekyll_from_to_until
64
+ allowed_push_host: https://rubygems.org
65
+ bug_tracker_uri: https://github.com/mslinn/jekyll_from_to_until/issues
198
66
  changelog_uri: https://github.com/mslinn/jekyll_from_to_until/CHANGELOG.md
199
- post_install_message:
67
+ homepage_uri: https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html#from_to_until
68
+ source_code_uri: https://github.com/mslinn/jekyll_from_to_until
69
+ post_install_message: |2+
70
+
71
+ Thanks for installing jekyll_from_to_until!
72
+
200
73
  rdoc_options: []
201
74
  require_paths:
202
75
  - lib
@@ -211,9 +84,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
211
84
  - !ruby/object:Gem::Version
212
85
  version: '0'
213
86
  requirements: []
214
- rubygems_version: 3.2.5
215
- signing_key:
87
+ rubygems_version: 3.3.3
88
+ signing_key:
216
89
  specification_version: 4
217
90
  summary: 'This Jekyll plugin provides 3 filters that return portions of a multiline
218
91
  string: from, to and until.'
219
- test_files: []
92
+ test_files:
93
+ - spec/from_to_until_spec.rb
94
+ - spec/spec_helper.rb
95
+ ...
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --color
2
- --format progress
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 3.0.0
data/.vscode/launch.json DELETED
@@ -1,35 +0,0 @@
1
- {
2
- // Use IntelliSense to learn about possible attributes.
3
- // Hover to view descriptions of existing attributes.
4
- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
- "version": "0.2.0",
6
- "configurations": [
7
- {
8
- "args": [
9
- "-I",
10
- "${workspaceRoot}"
11
- ],
12
- "cwd": "${workspaceRoot}",
13
- "name": "RSpec - all",
14
- "program": "${env:HOME}/.gems/bin/rspec",
15
- "request": "launch",
16
- "showDebuggerOutput": false,
17
- "type": "Ruby",
18
- "useBundler": true,
19
- },
20
- {
21
- "args": [
22
- "-I",
23
- "${workspaceRoot}",
24
- "${file}"
25
- ],
26
- "cwd": "${workspaceRoot}",
27
- "name": "RSpec - active spec file only",
28
- "program": "${env:HOME}/.gems/bin/rspec",
29
- "showDebuggerOutput": false,
30
- "request": "launch",
31
- "type": "Ruby",
32
- "useBundler": true,
33
- },
34
- ]
35
- }
@@ -1,4 +0,0 @@
1
- {
2
- "ruby.rubocop.configFilePath": ".rubocop.yml",
3
- "ruby.rubocop.useBundler": true
4
- }
data/Gemfile DELETED
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- # Specify your gem's dependencies in jekyll_from_to_until.gemspec
6
- gemspec
7
-
8
- gem "rake", "~> 13.0"
data/Gemfile.lock DELETED
@@ -1,134 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- jekyll_from_to_until (1.0.0)
5
- jekyll
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- addressable (2.8.0)
11
- public_suffix (>= 2.0.2, < 5.0)
12
- ast (2.4.2)
13
- coderay (1.1.3)
14
- colorator (1.1.0)
15
- concurrent-ruby (1.1.9)
16
- debase (0.2.4.1)
17
- debase-ruby_core_source (>= 0.10.2)
18
- debase-ruby_core_source (0.10.14)
19
- diff-lcs (1.5.0)
20
- em-websocket (0.5.3)
21
- eventmachine (>= 0.12.9)
22
- http_parser.rb (~> 0)
23
- eventmachine (1.2.7)
24
- ffi (1.15.5)
25
- forwardable-extended (2.6.0)
26
- http_parser.rb (0.8.0)
27
- i18n (1.10.0)
28
- concurrent-ruby (~> 1.0)
29
- jekyll (4.2.2)
30
- addressable (~> 2.4)
31
- colorator (~> 1.0)
32
- em-websocket (~> 0.5)
33
- i18n (~> 1.0)
34
- jekyll-sass-converter (~> 2.0)
35
- jekyll-watch (~> 2.0)
36
- kramdown (~> 2.3)
37
- kramdown-parser-gfm (~> 1.0)
38
- liquid (~> 4.0)
39
- mercenary (~> 0.4.0)
40
- pathutil (~> 0.9)
41
- rouge (~> 3.0)
42
- safe_yaml (~> 1.0)
43
- terminal-table (~> 2.0)
44
- jekyll-sass-converter (2.2.0)
45
- sassc (> 2.0.1, < 3.0)
46
- jekyll-watch (2.2.1)
47
- listen (~> 3.0)
48
- kramdown (2.3.1)
49
- rexml
50
- kramdown-parser-gfm (1.1.0)
51
- kramdown (~> 2.0)
52
- liquid (4.0.3)
53
- listen (3.7.1)
54
- rb-fsevent (~> 0.10, >= 0.10.3)
55
- rb-inotify (~> 0.9, >= 0.9.10)
56
- mercenary (0.4.0)
57
- method_source (1.0.0)
58
- parallel (1.21.0)
59
- parser (3.1.1.0)
60
- ast (~> 2.4.1)
61
- pathutil (0.16.2)
62
- forwardable-extended (~> 2.6)
63
- pry (0.14.1)
64
- coderay (~> 1.1)
65
- method_source (~> 1.0)
66
- public_suffix (4.0.6)
67
- rainbow (3.1.1)
68
- rake (13.0.6)
69
- rb-fsevent (0.11.1)
70
- rb-inotify (0.10.1)
71
- ffi (~> 1.0)
72
- regexp_parser (2.2.1)
73
- rexml (3.2.5)
74
- rouge (3.28.0)
75
- rspec (3.11.0)
76
- rspec-core (~> 3.11.0)
77
- rspec-expectations (~> 3.11.0)
78
- rspec-mocks (~> 3.11.0)
79
- rspec-core (3.11.0)
80
- rspec-support (~> 3.11.0)
81
- rspec-expectations (3.11.0)
82
- diff-lcs (>= 1.2.0, < 2.0)
83
- rspec-support (~> 3.11.0)
84
- rspec-mocks (3.11.0)
85
- diff-lcs (>= 1.2.0, < 2.0)
86
- rspec-support (~> 3.11.0)
87
- rspec-support (3.11.0)
88
- rubocop (1.18.4)
89
- parallel (~> 1.10)
90
- parser (>= 3.0.0.0)
91
- rainbow (>= 2.2.2, < 4.0)
92
- regexp_parser (>= 1.8, < 3.0)
93
- rexml
94
- rubocop-ast (>= 1.8.0, < 2.0)
95
- ruby-progressbar (~> 1.7)
96
- unicode-display_width (>= 1.4.0, < 3.0)
97
- rubocop-ast (1.16.0)
98
- parser (>= 3.1.1.0)
99
- rubocop-jekyll (0.12.0)
100
- rubocop (~> 1.18.0)
101
- rubocop-performance (~> 1.2)
102
- rubocop-performance (1.13.3)
103
- rubocop (>= 1.7.0, < 2.0)
104
- rubocop-ast (>= 0.4.0)
105
- rubocop-rake (0.6.0)
106
- rubocop (~> 1.0)
107
- ruby-debug-ide (0.7.3)
108
- rake (>= 0.8.1)
109
- ruby-progressbar (1.11.0)
110
- safe_yaml (1.0.5)
111
- sassc (2.4.0)
112
- ffi (~> 1.9)
113
- terminal-table (2.0.0)
114
- unicode-display_width (~> 1.1, >= 1.1.1)
115
- unicode-display_width (1.8.0)
116
-
117
- PLATFORMS
118
- x86_64-linux
119
-
120
- DEPENDENCIES
121
- bundler
122
- debase
123
- jekyll
124
- jekyll_from_to_until!
125
- pry
126
- rake (~> 13.0)
127
- rspec
128
- rubocop
129
- rubocop-jekyll
130
- rubocop-rake
131
- ruby-debug-ide
132
-
133
- BUNDLED WITH
134
- 2.3.7
@@ -1,4 +0,0 @@
1
- module JekyllFromToUntil
2
- VERSION: String
3
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
- end