pretty_feed 0.2.0 → 1.0.1

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: 33dc8684562bed8df172595936b8fd7669c442e65c436dc4fca6a7c535a69c27
4
- data.tar.gz: 2ad30b05ca9d1122336ad43056dc7fe0fcb139df671c6affc5e504da6cf97b59
3
+ metadata.gz: 3214553012ede5e9c877bbdaffe5500c409742eaf7c7ab8b81b329e60fe80847
4
+ data.tar.gz: b3b73b45b966e38a0ed8ad024d2b7ceb9139f3269af8e03cb4e5244beb3d78fb
5
5
  SHA512:
6
- metadata.gz: 58bbaf39fb718f7c2b8f0a2d6f701cb9434e89713901dbfc5f3ab1eb47154b118c93df2ccc5ec32243e1395e7696a58b223647822aa94f354f3e8caaf9fa2ecf
7
- data.tar.gz: b2e92fdad45349185671ebe130a1156844afb935f94d0af8e579a834d55262ad44a03e9c7bc82e6f534dd783ce1b4f1739e882615b5da5fca2de78dcb02a5656
6
+ metadata.gz: aee3b2e63838f4c0ffbd7d3cac1fcc20341bb7e832c73ce0680bb6a7c5a6fe59b71f215318286c1b547a150f106d9573498a8dc2af1d9117d957270e4b2af3bd
7
+ data.tar.gz: '058671fce496239c8def316372866e16be34ec2294cc724ca0770ad6c12b0b2b9097c1f307a815e22b71d0ae72b906105c2a6da62412bee06fe49baef8cea56f'
checksums.yaml.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+ c��.��uܜw�����b՗u��6_�c�%�H�1�^kn�!u���9��:.�g���f�����X�������cE6�P��,7�Ջ�;#�14(�@�[*�H�/��ӕ�x�����O��9/+�<FvJ�}���;�N�!Q�?ː{�\ߩ��M��ȽR��"1�ha��%*+�$�L���*6ؼ���yʑF��1\�g�]�Ń����a�u�a"4m5�Iz�
2
+ ��N2"��؟G�&��l�Ks"��.w 9+�_�V���/n�O�aYp@7zl8��)`�+�o�\�-��J�����n�
data/CHANGELOG.md CHANGED
@@ -1,40 +1,62 @@
1
- ## [Unreleased]
2
-
3
- ### Added
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
4
3
 
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
6
 
7
+ ## [Unreleased]
8
+ ### Added
6
9
  ### Changed
7
-
8
-
9
10
  ### Fixed
11
+ ### Removed
10
12
 
13
+ ## [1.0.1] - 2023-10-18
14
+ ### Added
15
+ - Releases are now cryptographically signed
11
16
 
17
+ ## [1.0.0] - 2023-10-18
18
+ ### Added
19
+ - Ruby 3.2 to CI build matrix
20
+ - `pftf` now accepts a block, and when given:
21
+ - `[BEG] #{msg}#{value}` is logged before executing the block
22
+ - `[FIN] #{msg}#{value}` is logged after executing the block
23
+ - options hash as fourth parameter to `pftf`!
24
+ - `:rescue_logged` - Error classes that should be rescued and logged. Default: `[]`
25
+ - `:backtrace_logged` - When truthy, rescued errors log a full backtrace. Default: `nil`
26
+ - `:reraise` - When truthy, rescued errors will be re-raised. Default: `nil`
27
+ - `:benchmark` - When truthy, prints realtime spent executing block. Default: `nil`
28
+ - 100% Test Line Coverage of all new features, and existing code
29
+ - Support for `term-ansicolor`, in addition to improved support and tests for
30
+ - `colorized`
31
+ - `colored2`
32
+ - `awesome_print`
33
+ - SHA-256 and SHA-512 checksums with each release.
34
+ ### Changed
35
+ - `VERSION` constant is now located at `PrettyFeed::Version::VERSION`
36
+ ### Fixed
37
+ - Errors in documentation
12
38
  ### Removed
39
+ - Ruby 2.6 from CI build matrix
13
40
 
14
41
  ## [0.2.0] - 2022-03-21
15
-
16
42
  ### Fixed
17
-
18
- * Misleading documentation has been corrected
19
-
43
+ - Corrected misleading documentation
20
44
 
21
45
  ## [0.1.1] - 2022-03-21
22
-
23
46
  ### Added
24
-
25
- * 100% test coverage
26
-
47
+ - 100% test coverage
27
48
  ### Changed
28
-
29
- * Improved `warn` text when stub color methods added to instances of String.
30
-
49
+ - Improved `warn` text when stub color methods added to instances of String.
31
50
  ### Fixed
32
-
33
- * Handling of frozen strings
34
-
51
+ - Handling of frozen strings
35
52
 
36
53
  ## [0.1.0] - 2022-03-21
37
-
38
54
  ### Added
39
-
40
- Initial Release
55
+ - Initial Release
56
+
57
+ [Unreleased]: https://github.com/pboling/pretty_feed/compare/v1.0.1...HEAD
58
+ [1.0.1]: https://github.com/pboling/pretty_feed/compare/v1.0.0...v1.0.1
59
+ [1.0.0]: https://github.com/pboling/pretty_feed/compare/v0.2.0...v1.0.0
60
+ [0.2.0]: https://github.com/pboling/pretty_feed/compare/v0.1.1...v0.2.0
61
+ [0.1.1]: https://github.com/pboling/pretty_feed/compare/v0.1.0...v0.1.1
62
+ [0.1.0]: https://github.com/pboling/pretty_feed/compare/cd45565324085939b680c8597599828b4c41511f...v0.1.0
data/CONTRIBUTING.md CHANGED
@@ -1,25 +1,41 @@
1
1
  ## Contributing
2
2
 
3
- Bug reports and pull requests are welcome on GitHub at [https://github.com/pboling/pretty_feed][source]
3
+ Bug reports and pull requests are welcome on GitHub at [https://github.com/pboling/pretty_feed][🚎src-main]
4
4
  . This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to
5
- the [code of conduct][conduct].
5
+ the [code of conduct][🤝conduct].
6
6
 
7
- To submit a patch, please fork the project and create a patch with tests. Once you're happy with it send a pull request!
7
+ To submit a patch, please fork the project and create a patch with tests. Once you're happy with it send a pull request
8
+ and post a message to the [gitter chat][🏘chat].
8
9
 
9
- ## Contributors
10
-
11
- [![Contributors](https://contrib.rocks/image?repo=pboling/pretty_feed)][contributors]
10
+ ## Release
12
11
 
13
- Made with [contributors-img][contrib-rocks].
12
+ To release a new version:
14
13
 
15
- [comment]: <> (Following links are used by README, CONTRIBUTING)
14
+ 1. Run `bin/setup && bin/rake` as a tests, coverage, & linting sanity check
15
+ 2. Update the version number in `version.rb`
16
+ 3. Run `bin/setup && bin/rake` again as a secondary check, and to update `Gemfile.lock`
17
+ 4. Run `git commit -am "🔖 Prepare release v<VERSION>"` to commit the changes
18
+ a. NOTE: Remember to [check the build][🧪build]!
19
+ 5. Run `rake build`
20
+ 6. Run [`bin/checksums`](https://github.com/rubygems/guides/pull/325) to create SHA-256 and SHA-512 checksums
21
+ a. Checksums will be committed automatically by the script
22
+ 7. Run `rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org][💎rubygems]
16
23
 
17
- [conduct]: https://github.com/pboling/pretty_feed/blob/master/CODE_OF_CONDUCT.md
24
+ NOTE: You will need to have a public key in `certs/`, and list your cert in the
25
+ `gemspec`, in order to sign the new release.
26
+ See: [RubyGems Security Guide][🔒️rubygems-security-guide]
18
27
 
19
- [contrib-rocks]: https://contrib.rocks
28
+ ## Contributors
20
29
 
21
- [contributors]: https://github.com/pboling/pretty_feed/graphs/contributors
30
+ [![Contributors](https://contrib.rocks/image?repo=pboling/pretty_feed)][🖐contributors]
22
31
 
23
- [comment]: <> (Following links are used by README, CONTRIBUTING, Homepage)
32
+ Made with [contributors-img][🖐contrib-rocks].
24
33
 
25
- [source]: https://github.com/pboling/pretty_feed/
34
+ [🧪build]: https://github.com/pboling/pretty_feed/actions
35
+ [🏘chat]: https://matrix.to/#/%23pboling_pretty_feed:gitter.im
36
+ [🤝conduct]: https://github.com/pboling/pretty_feed/blob/main/CODE_OF_CONDUCT.md
37
+ [🖐contrib-rocks]: https://contrib.rocks
38
+ [🖐contributors]: https://github.com/pboling/pretty_feed/graphs/contributors
39
+ [💎rubygems]: https://rubygems.org
40
+ [🔒️rubygems-security-guide]: https://guides.rubygems.org/security/#building-gems
41
+ [🚎src-main]: https://github.com/pboling/pretty_feed
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2022 Peter Boling
3
+ Copyright (c) 2022-2023 Peter Boling
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  PrettyFeed is a modulizer you can include in a job, worker, class, rake task, etc, which allows for simple pass/fail logging colorization. Defaults are `truthy: 'green'` and `falsey: 'red'`.
4
4
 
5
- While this gem has no direct dependencies, it won't accomplish do much for you unless you are using a "console output coloring" gem of some kind.
5
+ While this gem has few direct dependencies, it won't accomplish do much for you unless you are using a "console output coloring" gem of some kind.
6
6
 
7
7
  ## Installation
8
8
 
@@ -18,13 +18,13 @@ If bundler is not being used to manage dependencies, install the gem by executin
18
18
 
19
19
  ```ruby
20
20
  namespace :scrub do
21
- task :blurb => :environment do |_t, _args|
22
- include PrettyFeed::PfTf.new(truthy: 'green', falsey: 'blue')
23
- pftf("this will be green", true)
24
- # => "this will be green: true" # in the console
25
- pftf("this will be blue", false)
26
- # => "this will be blue: false" # in the console
27
- end
21
+ task blurb: :environment do |_t, _args|
22
+ include PrettyFeed::PfTf.new(truthy: "green", falsey: "blue")
23
+ pftf("this will be green: ", true)
24
+ # => "this will be green: true" # in the console
25
+ pftf("this will be blue: ", false)
26
+ # => "this will be blue: false" # in the console
27
+ end
28
28
  end
29
29
  ```
30
30
 
@@ -32,23 +32,40 @@ Instead of passing truthy or falsey values, you can pass a proc that will be eva
32
32
 
33
33
  ```ruby
34
34
  namespace :scrub do
35
- task :blurb => :environment do |_t, someth|
36
- include PrettyFeed::PfTf.new(truthy: 'green', falsey: 'blue')
37
- pftf("might be green or blue", someth, ->(a) { a })
38
- # => "might be green or blue: #{someth}" # in the console
39
- # NOTE: the color will depend on what someth is and whether the proc evaluates as truthy or falsey.
40
- end
35
+ task blurb: :environment do |_t, someth|
36
+ include PrettyFeed::PfTf.new(truthy: "green", falsey: "blue")
37
+ pftf("might be green or blue: ", someth, ->(a) { a })
38
+ # => "might be green or blue: #{someth}" # in the console
39
+ # NOTE: the color will depend on what someth is and whether the proc evaluates as truthy or falsey.
40
+ end
41
41
  end
42
42
  ```
43
43
 
44
- ### Defaults
44
+ ### Options
45
45
 
46
- `ColorizedString` (from the [`colorize` gem](https://github.com/fazibear/colorize)) will be used if it is `defined?`. I prefer it because it doesn't pollute the `String` class with color methods.
46
+ Released v1.0.0 has new features, all tested at 100% line & branch coverage.
47
+ Overall I'm sure the library maintains >= 90% line & branch coverage, and probably 100%,
48
+ but combining the various runs with each String color library is hard.
47
49
 
48
- ### Options
50
+ - `pftf` now accepts a block, and when given:
51
+ - `[BEG] #{msg}#{value}` is logged before executing the block
52
+ - `[FIN] #{msg}#{value}` is logged after executing the block
53
+ - options hash as fourth parameter to `pftf`!
54
+ - `:rescue_logged` - Error classes that should be rescued and logged. Default: `[]`
55
+ - `:backtrace_logged` - When truthy, rescued errors log a full backtrace. Default: `nil`
56
+ - `:reraise` - When truthy, rescued errors will be re-raised. Default: `nil`
57
+ - `:benchmark` - When truthy, prints realtime spent executing block. Default: `nil`
58
+
59
+ Find examples of these options in use, with and without blocks,
60
+ in [`pf_tf_spec.rb`](/spec/pretty_feed/pf_tf_spec.rb), as all options are fully tested.
61
+
62
+ ### Library Defaults
63
+
64
+ `ColorizedString` (from the [`colorize` gem](https://github.com/fazibear/colorize)) will be used if it is `defined?`. I prefer it because it doesn't pollute the `String` class with color methods.
49
65
 
50
- It will also work with strings that respond to the colors you select as methods on the `String` instance. This means it should work with `colored2`, `awesome_print`, and many other similar gems. If your strings do not respond to color methods there will be a `warn` message printed to STDERR. Colors available depend on the gem you use to provide the color methods! The various gems do not have uniform sets of colors, nor names of colors.
66
+ ### Library Options
51
67
 
68
+ It will also work with strings that respond to the colors you select as methods on the `String` instance. This means it should work with `colored2`, `awesome_print`, `term-ansicolor`, and many other similar gems. If your strings do not respond to color methods there will be a `warn` message printed to STDERR. Colors available depend on the gem you use to provide the color methods! The various gems do not have uniform sets of colors, nor names of colors.
52
69
 
53
70
  ## Development
54
71
 
@@ -72,7 +89,7 @@ The gem is available as open source under the terms of
72
89
  the [MIT License][license] [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)][license-ref].
73
90
  See [LICENSE][license] for the official [Copyright Notice][copyright-notice-explainer].
74
91
 
75
- * Copyright (c) 2022 [Peter H. Boling][peterboling] of [Rails Bling][railsbling]
92
+ * Copyright (c) 2022-2023 [Peter H. Boling][peterboling] of [Rails Bling][railsbling]
76
93
 
77
94
  [copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
78
95
 
@@ -93,7 +110,7 @@ the [Pessimistic Version Constraint][pvc] with two digits of precision.
93
110
  For example:
94
111
 
95
112
  ```ruby
96
- spec.add_dependency "pretty_feed", "~> 0.1"
113
+ spec.add_dependency("pretty_feed", "~> 1.0")
97
114
  ```
98
115
 
99
116
  [copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -156,4 +173,4 @@ spec.add_dependency "pretty_feed", "~> 0.1"
156
173
 
157
174
  [liberapay_donate]: https://liberapay.com/pboling/donate
158
175
 
159
- [gh_sponsors]: https://github.com/sponsors/pboling
176
+ [gh_sponsors]: https://github.com/sponsors/pboling
data/SECURITY.md CHANGED
@@ -2,12 +2,13 @@
2
2
 
3
3
  ## Supported Versions
4
4
 
5
- | Version | Supported |
6
- | ------- | ------------------ |
7
- | 0.x | :white_check_mark: |
5
+ | Version | Supported |
6
+ |---------|-----------|
7
+ | 1.x | |
8
+ | 0.x | ❌ |
8
9
 
9
10
  ## Reporting a Vulnerability
10
11
 
11
12
  Peter Boling is the primary maintainer of this gem. Please find a way
12
13
  to [contact him directly](https://railsbling.com/contact) to report the issue. Include as much relevant information as
13
- possible.
14
+ possible.
@@ -8,14 +8,18 @@ module PrettyFeed
8
8
  return str if str.respond_to?(color.to_sym)
9
9
 
10
10
  dstr = str.dup
11
- dstr.singleton_class.send(:include, color_stub(str, color))
11
+ if defined?(Term::ANSIColor)
12
+ dstr.singleton_class.send(:include, Term::ANSIColor)
13
+ else
14
+ dstr.singleton_class.send(:include, color_stub(str, color))
15
+ end
12
16
  dstr
13
17
  end
14
18
  module_function :[]
15
19
 
16
20
  private
17
21
 
18
- def color_stub(str, color)
22
+ module_function def color_stub(str, color)
19
23
  Module.new do
20
24
  define_method(color.to_sym) do
21
25
  warn "Adding stub for missing '#{str}'.#{color}"
@@ -23,6 +27,5 @@ module PrettyFeed
23
27
  end
24
28
  end
25
29
  end
26
- module_function :color_stub
27
30
  end
28
31
  end
@@ -1,18 +1,50 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Std Libs
4
+ require "benchmark"
5
+
3
6
  module PrettyFeed
4
7
  # Provides the pf (print_feed) method
5
8
  module Modulizer
6
9
  def to_mod(truthy:, falsey:)
7
10
  Module.new do
8
- define_method(:pftf) do |prefix = nil, value = "", proc = nil|
11
+ define_method(:pftf) do |msg = nil, value = "", proc = nil, **options, &block|
12
+ rescue_logged = Array(options[:rescue_logged])
9
13
  cvalue = if proc.nil?
10
- value
11
- else
12
- proc.respond_to?(:call) ? proc.call(value) : proc
13
- end
14
+ value
15
+ else
16
+ proc.respond_to?(:call) ? proc.call(value) : proc
17
+ end
14
18
  color = cvalue ? truthy : falsey
15
- puts PrettyFeed::Compat["#{prefix}#{value}", color].send(color)
19
+ if block
20
+ external_block =
21
+ if rescue_logged.any?
22
+ -> () {
23
+ begin
24
+ block.call
25
+ rescue *rescue_logged => error
26
+ puts PrettyFeed::Compat["[ERR][#{error.class}][#{error.message}] #{msg}#{value}", color].send(color)
27
+ puts PrettyFeed::Compat["[ERR][Backtrace]\n#{error.backtrace.join("\n")}", color].send(color) if options[:backtrace_logged]
28
+ raise error if options[:reraise]
29
+ end
30
+ }
31
+ else
32
+ block
33
+ end
34
+ puts PrettyFeed::Compat["[BEG] #{msg}#{value}", color].send(color)
35
+ if options[:benchmark]
36
+ time = Benchmark.realtime do
37
+ external_block.call
38
+ end
39
+ seconds = "%.4fs" % time
40
+ puts PrettyFeed::Compat["[FIN][#{seconds}] #{msg}#{value}", color].send(color)
41
+ else
42
+ external_block.call
43
+ puts PrettyFeed::Compat["[FIN] #{msg}#{value}", color].send(color)
44
+ end
45
+ else
46
+ puts PrettyFeed::Compat["#{msg}#{value}", color].send(color)
47
+ end
16
48
  end
17
49
  end
18
50
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PrettyFeed
4
- VERSION = "0.2.0"
4
+ module Version
5
+ VERSION = "1.0.1"
6
+ end
5
7
  end
data/lib/pretty_feed.rb CHANGED
@@ -1,5 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # External gems
4
+ require "version_gem"
5
+
6
+ # This library
3
7
  require_relative "pretty_feed/version"
4
8
  require_relative "pretty_feed/compat"
5
9
  require_relative "pretty_feed/modulizer"
@@ -8,3 +12,7 @@ require_relative "pretty_feed/pf_tf"
8
12
  # Namespace for this library
9
13
  module PrettyFeed
10
14
  end
15
+
16
+ PrettyFeed::Version.class_eval do
17
+ extend VersionGem::Basic
18
+ end
data.tar.gz.sig ADDED
@@ -0,0 +1 @@
1
+ ��FrG66+�����vz�e#�;�a<U�XY�%;DU��z�@N�8���V�GI��\poGE���u�(o�s��&�`x)
metadata CHANGED
@@ -1,15 +1,63 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pretty_feed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Boling
8
8
  autorequire:
9
9
  bindir: exe
10
- cert_chain: []
11
- date: 2022-03-22 00:00:00.000000000 Z
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIEgDCCAuigAwIBAgIBATANBgkqhkiG9w0BAQsFADBDMRUwEwYDVQQDDAxwZXRl
14
+ ci5ib2xpbmcxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkW
15
+ A2NvbTAeFw0yMzA5MjAxNzMwMjhaFw0yNDA5MTkxNzMwMjhaMEMxFTATBgNVBAMM
16
+ DHBldGVyLmJvbGluZzEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPy
17
+ LGQBGRYDY29tMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA+a9UvHo3
18
+ 84k96WgU5Kk5HB+cLZs/modjorsTfqY67MJF5nNvAoqcKTUBW4uG+Zpfnm3jaDO5
19
+ GxhJEIZWfndYzycHT2KMVQ1uTP82ba8ZaKrPlPIafkbui3mdds47qsmqHiblKERg
20
+ U532lkwfqHDlJwE7OBZQ59EwWWLynlT/yAUHpOBbqIuHKUxdpmBI+sIjrZcD1e05
21
+ WmjkO6fwIdC5oM757aoPxIgXD587VOViH11Vkm2doskj4T8yONtwVHlcrrhJ9Bzd
22
+ /zdp6vEn7GZQrABvpOlqwWxQ72ZnFhJe/RJZf6CXOPOh69Ai0QKYl2a1sYuCJKS3
23
+ nsBnxXJINEEznjR7rZjNUmYD+CZqfjzgPqedRxTlASe7iA4w7xZOqMDzcuhNwcUQ
24
+ tMEH6BTktxKP3jXZPXRfHCf6s+HRVb6vezAonTBVyydf5Xp5VwWkd6cwm+2BzHl5
25
+ 7kc/3lLxKMcsyEUprAsk8LdHohwZdC267l+RS++AP6Cz6x+nB3oGob19AgMBAAGj
26
+ fzB9MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBQCSSas60GqqMjt
27
+ xR7LoY1gucEvtzAhBgNVHREEGjAYgRZwZXRlci5ib2xpbmdAZ21haWwuY29tMCEG
28
+ A1UdEgQaMBiBFnBldGVyLmJvbGluZ0BnbWFpbC5jb20wDQYJKoZIhvcNAQELBQAD
29
+ ggGBAMl9ifcw5p+PdvB7dCPoNKoVdp/2LbC9ztETHuYL2gUMJB6UoS3o9c/piSuR
30
+ V3ZMQaijmNu6ms1bWAtJ66LjmYrVflJtf9yp31Kierr9LpisMSUx2qbMOHGa8d2Z
31
+ vCUWPF8E9Cg0mP3GAyZ6qql8jDh/anUKeksPXqJvNxNPDu2DVYsa/IWdl96whzS4
32
+ Bl7SwB1E7agps40UcshCSKaVDOU0M+XN6SrnJMElnBic+KSAkBkVFbzS0BE4ODZM
33
+ BgE6nYzQ05qhuvbE+oGdACTlemNtDDWCh0uw+7x0q2PocGIDU5zsPn/WNTkCXPmB
34
+ CHGvqDNWq4M7ncTKAaS2XExgyb7uPdq9fKiOW8nmH+zCiGzJXzBWwZlKf7L4Ht9E
35
+ a3f0e5C+zvee9Z5Ng9ciyfav9/fcXgYt5MjoBv27THr5XfBhgOCIHSYW2tqJmWKi
36
+ KuxrfYrN+9HvMdm+nZ6TypmKftHY3Gj+/uu+g8Icm/zrvTWAEE0mcJOkfrIoNPJb
37
+ pF8dMA==
38
+ -----END CERTIFICATE-----
39
+ date: 2023-10-18 00:00:00.000000000 Z
12
40
  dependencies:
41
+ - !ruby/object:Gem::Dependency
42
+ name: version_gem
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.1'
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 1.1.3
51
+ type: :runtime
52
+ prerelease: false
53
+ version_requirements: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - "~>"
56
+ - !ruby/object:Gem::Version
57
+ version: '1.1'
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: 1.1.3
13
61
  - !ruby/object:Gem::Dependency
14
62
  name: rake
15
63
  requirement: !ruby/object:Gem::Requirement
@@ -24,20 +72,136 @@ dependencies:
24
72
  - - "~>"
25
73
  - !ruby/object:Gem::Version
26
74
  version: '13.0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: kettle-soup-cover
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '0.1'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '0.1'
89
+ - !ruby/object:Gem::Dependency
90
+ name: kramdown
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '2.4'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '2.4'
103
+ - !ruby/object:Gem::Dependency
104
+ name: yard
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '0.9'
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: 0.9.34
113
+ type: :development
114
+ prerelease: false
115
+ version_requirements: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - "~>"
118
+ - !ruby/object:Gem::Version
119
+ version: '0.9'
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: 0.9.34
123
+ - !ruby/object:Gem::Dependency
124
+ name: yard-junk
125
+ requirement: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - "~>"
128
+ - !ruby/object:Gem::Version
129
+ version: '0.0'
130
+ type: :development
131
+ prerelease: false
132
+ version_requirements: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - "~>"
135
+ - !ruby/object:Gem::Version
136
+ version: '0.0'
137
+ - !ruby/object:Gem::Dependency
138
+ name: rubocop-lts
139
+ requirement: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - "~>"
142
+ - !ruby/object:Gem::Version
143
+ version: '16.1'
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ version: 16.1.1
147
+ type: :development
148
+ prerelease: false
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - "~>"
152
+ - !ruby/object:Gem::Version
153
+ version: '16.1'
154
+ - - ">="
155
+ - !ruby/object:Gem::Version
156
+ version: 16.1.1
157
+ - !ruby/object:Gem::Dependency
158
+ name: rubocop-packaging
159
+ requirement: !ruby/object:Gem::Requirement
160
+ requirements:
161
+ - - "~>"
162
+ - !ruby/object:Gem::Version
163
+ version: '0.5'
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: 0.5.2
167
+ type: :development
168
+ prerelease: false
169
+ version_requirements: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '0.5'
174
+ - - ">="
175
+ - !ruby/object:Gem::Version
176
+ version: 0.5.2
177
+ - !ruby/object:Gem::Dependency
178
+ name: rubocop-rspec
179
+ requirement: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - "~>"
182
+ - !ruby/object:Gem::Version
183
+ version: '2.24'
184
+ type: :development
185
+ prerelease: false
186
+ version_requirements: !ruby/object:Gem::Requirement
187
+ requirements:
188
+ - - "~>"
189
+ - !ruby/object:Gem::Version
190
+ version: '2.24'
27
191
  - !ruby/object:Gem::Dependency
28
192
  name: rspec
29
193
  requirement: !ruby/object:Gem::Requirement
30
194
  requirements:
31
195
  - - "~>"
32
196
  - !ruby/object:Gem::Version
33
- version: '3.10'
197
+ version: '3.12'
34
198
  type: :development
35
199
  prerelease: false
36
200
  version_requirements: !ruby/object:Gem::Requirement
37
201
  requirements:
38
202
  - - "~>"
39
203
  - !ruby/object:Gem::Version
40
- version: '3.10'
204
+ version: '3.12'
41
205
  - !ruby/object:Gem::Dependency
42
206
  name: rspec-benchmark
43
207
  requirement: !ruby/object:Gem::Requirement
@@ -59,6 +223,9 @@ dependencies:
59
223
  - - "~>"
60
224
  - !ruby/object:Gem::Version
61
225
  version: '1.0'
226
+ - - ">="
227
+ - !ruby/object:Gem::Version
228
+ version: 1.0.5
62
229
  type: :development
63
230
  prerelease: false
64
231
  version_requirements: !ruby/object:Gem::Requirement
@@ -66,34 +233,57 @@ dependencies:
66
233
  - - "~>"
67
234
  - !ruby/object:Gem::Version
68
235
  version: '1.0'
236
+ - - ">="
237
+ - !ruby/object:Gem::Version
238
+ version: 1.0.5
69
239
  - !ruby/object:Gem::Dependency
70
- name: silent_stream
240
+ name: rspec_junit_formatter
71
241
  requirement: !ruby/object:Gem::Requirement
72
242
  requirements:
73
243
  - - "~>"
74
244
  - !ruby/object:Gem::Version
75
- version: '1'
245
+ version: '0.6'
76
246
  type: :development
77
247
  prerelease: false
78
248
  version_requirements: !ruby/object:Gem::Requirement
79
249
  requirements:
80
250
  - - "~>"
81
251
  - !ruby/object:Gem::Version
82
- version: '1'
252
+ version: '0.6'
83
253
  - !ruby/object:Gem::Dependency
84
- name: yard
254
+ name: rspec-stubbed_env
85
255
  requirement: !ruby/object:Gem::Requirement
86
256
  requirements:
257
+ - - "~>"
258
+ - !ruby/object:Gem::Version
259
+ version: '1.0'
87
260
  - - ">="
88
261
  - !ruby/object:Gem::Version
89
- version: 0.9.20
262
+ version: 1.0.1
90
263
  type: :development
91
264
  prerelease: false
92
265
  version_requirements: !ruby/object:Gem::Requirement
93
266
  requirements:
267
+ - - "~>"
268
+ - !ruby/object:Gem::Version
269
+ version: '1.0'
94
270
  - - ">="
95
271
  - !ruby/object:Gem::Version
96
- version: 0.9.20
272
+ version: 1.0.1
273
+ - !ruby/object:Gem::Dependency
274
+ name: silent_stream
275
+ requirement: !ruby/object:Gem::Requirement
276
+ requirements:
277
+ - - "~>"
278
+ - !ruby/object:Gem::Version
279
+ version: '1'
280
+ type: :development
281
+ prerelease: false
282
+ version_requirements: !ruby/object:Gem::Requirement
283
+ requirements:
284
+ - - "~>"
285
+ - !ruby/object:Gem::Version
286
+ version: '1'
97
287
  description: |
98
288
  PrettyFeed provides a modulizer you can include in a job, worker, class, rake task, etc,
99
289
  which allows for simple pass/fail logging colorization.
@@ -115,22 +305,17 @@ files:
115
305
  - lib/pretty_feed/modulizer.rb
116
306
  - lib/pretty_feed/pf_tf.rb
117
307
  - lib/pretty_feed/version.rb
118
- - spec/config/rspec/rspec_core.rb
119
- - spec/config/rspec/silent_stream.rb
120
- - spec/pretty_feed/pf_tf_spec.rb
121
- - spec/pretty_feed_spec.rb
122
- - spec/spec_helper.rb
123
- - spec/support/example_classes.rb
124
308
  homepage: https://github.com/pboling/pretty_feed
125
309
  licenses:
126
310
  - MIT
127
311
  metadata:
128
312
  homepage_uri: https://github.com/pboling/pretty_feed
129
- source_code_uri: https://github.com/pboling/pretty_feed/tree/v0.2.0
130
- changelog_uri: https://github.com/pboling/pretty_feed/blob/v0.2.0/CHANGELOG.md
313
+ source_code_uri: https://github.com/pboling/pretty_feed/tree/v1.0.1
314
+ changelog_uri: https://github.com/pboling/pretty_feed/blob/v1.0.1/CHANGELOG.md
131
315
  bug_tracker_uri: https://github.com/pboling/pretty_feed/issues
132
- documentation_uri: https://www.rubydoc.info/gems/pretty_feed/0.2.0
316
+ documentation_uri: https://www.rubydoc.info/gems/pretty_feed/1.0.1
133
317
  wiki_uri: https://github.com/pboling/pretty_feed/wiki
318
+ funding_uri: https://liberapay.com/pboling
134
319
  rubygems_mfa_required: 'true'
135
320
  post_install_message:
136
321
  rdoc_options: []
@@ -147,14 +332,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
332
  - !ruby/object:Gem::Version
148
333
  version: '0'
149
334
  requirements: []
150
- rubygems_version: 3.3.7
335
+ rubygems_version: 3.4.21
151
336
  signing_key:
152
337
  specification_version: 4
153
- summary: Simple pass/fail logging colorization
154
- test_files:
155
- - spec/config/rspec/rspec_core.rb
156
- - spec/config/rspec/silent_stream.rb
157
- - spec/pretty_feed/pf_tf_spec.rb
158
- - spec/pretty_feed_spec.rb
159
- - spec/spec_helper.rb
160
- - spec/support/example_classes.rb
338
+ summary: Simple pass/fail logging with colorization, and block rescuing/benchmarking
339
+ test_files: []
metadata.gz.sig ADDED
Binary file
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RSpec.configure do |config|
4
- # Enable flags like --only-failures and --next-failure
5
- config.example_status_persistence_file_path = ".rspec_status"
6
-
7
- # Disable RSpec exposing methods globally on `Module` and `main`
8
- config.disable_monkey_patching!
9
-
10
- config.expect_with :rspec do |c|
11
- c.syntax = :expect
12
- end
13
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RSpec.configure do |config|
4
- config.include SilentStream
5
- end
@@ -1,81 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RSpec.describe PrettyFeed::PfTf do
4
- subject(:pftfer) { ExamplePfff.new }
5
- let(:caught) { COMPAT_LIB.nil? ? :stderr : :stdout }
6
- let(:str) { "pear: " }
7
- let(:truthy_value) { :cake }
8
- let(:falsey_value) { false }
9
- let(:color_open) { Regexp.escape("\e[") }
10
- let(:color_close) { Regexp.escape("\e[0m\n") }
11
- let(:falsey_out) { capture(caught) { pftfer.pftf(str, falsey_value) } }
12
- let(:truthy_out) { capture(caught) { pftfer.pftf(str, truthy_value) } }
13
- let(:falsey_out_proc) { capture(caught) { pftfer.pftf(str, falsey_value, ->(a) { a }) } }
14
- let(:truthy_out_proc) { capture(caught) { pftfer.pftf(str, truthy_value, ->(a) { !a.nil? }) } }
15
- let(:truthy_color) { :green }
16
- let(:falsey_color) { :red }
17
-
18
- shared_examples_for "ptft call" do
19
- it "#pftf returns nil when truthy" do
20
- expect(pftfer.pftf(str, truthy_value)).to be_nil
21
- end
22
- it "#pftf returns nil when proc is truthy" do
23
- expect(pftfer.pftf(str, truthy_value, ->(a) { !a.nil? })).to be_nil
24
- end
25
- it "#pftf returns nil when falsey" do
26
- expect(pftfer.pftf(str, falsey_value)).to be_nil
27
- end
28
- it "#pftf returns nil when proc is falsey" do
29
- expect(pftfer.pftf(str, falsey_value, ->(a) { !a })).to be_nil
30
- end
31
- it "#pftf includes prefix when truthy" do
32
- expect(truthy_out).to match("#{str}#{truthy_value}")
33
- end
34
- it "#pftf includes prefix when proc is truthy" do
35
- expect(truthy_out_proc).to match("#{str}#{truthy_value}")
36
- end
37
- it "#pftf includes prefix when falsey" do
38
- expect(falsey_out).to match("#{str}#{falsey_value}")
39
- end
40
- it "#pftf includes prefix when proc is falsey" do
41
- expect(falsey_out_proc).to match("#{str}#{falsey_value}")
42
- end
43
- it "#pftf has output when falsey" do
44
- if COMPAT_LIB.nil?
45
- expect(falsey_out).to eq("Adding stub for missing '#{str}#{falsey_value}'.#{falsey_color}\n")
46
- else
47
- expect(falsey_out).to match(/#{color_open}.*\d{2}m#{Regexp.escape(str.to_s)}#{Regexp.escape(falsey_value.to_s)}#{color_close}/)
48
- end
49
- end
50
- it "#pftf has output when falsey proc" do
51
- if COMPAT_LIB.nil?
52
- expect(falsey_out_proc).to eq("Adding stub for missing '#{str}#{falsey_value}'.#{falsey_color}\n")
53
- else
54
- expect(falsey_out_proc).to match(/#{color_open}.*\d{2}m#{Regexp.escape(str.to_s)}#{Regexp.escape(falsey_value.to_s)}#{color_close}/)
55
- end
56
- end
57
- it "#pftf has output when truthy" do
58
- if COMPAT_LIB.nil?
59
- expect(truthy_out).to eq("Adding stub for missing '#{str}#{truthy_value}'.#{truthy_color}\n")
60
- else
61
- expect(truthy_out).to match(/#{color_open}.*\d{2}m#{Regexp.escape(str.to_s)}#{Regexp.escape(truthy_value.to_s)}#{color_close}/)
62
- end
63
- end
64
- it "#pftf has output when truthy proc" do
65
- if COMPAT_LIB.nil?
66
- expect(truthy_out_proc).to eq("Adding stub for missing '#{str}#{truthy_value}'.#{truthy_color}\n")
67
- else
68
- expect(truthy_out_proc).to match(/#{color_open}.*\d{2}m#{Regexp.escape(str.to_s)}#{Regexp.escape(truthy_value.to_s)}#{color_close}/)
69
- end
70
- end
71
- end
72
-
73
- it_behaves_like "ptft call"
74
-
75
- context "when custom color" do
76
- subject(:pftfer) { ExamplePfffColors.new }
77
- let(:truthy_color) { :cyan }
78
- let(:falsey_color) { :yellow }
79
- it_behaves_like "ptft call"
80
- end
81
- end
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RSpec.describe PrettyFeed do
4
- it "has a version number" do
5
- expect(PrettyFeed::VERSION).not_to be nil
6
- end
7
- end
data/spec/spec_helper.rb DELETED
@@ -1,52 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "silent_stream"
4
- compat_lib = begin
5
- require "awesome_print"
6
- puts "Testing with awesome_print"
7
- :ap
8
- rescue LoadError # rubocop:disable Lint/SuppressedException
9
- end || begin
10
- require "colored2"
11
- puts "Testing with colored2"
12
- :c2
13
- rescue LoadError # rubocop:disable Lint/SuppressedException
14
- end || begin
15
- require "colorized_string"
16
- puts "Testing with colorized_string"
17
- :cs
18
- rescue LoadError # rubocop:disable Lint/SuppressedException
19
- end
20
-
21
- COMPAT_LIB = compat_lib
22
- DEBUG = ENV["DEBUG"] == "true"
23
-
24
- ruby_version = Gem::Version.new(RUBY_VERSION)
25
- minimum_version = ->(version, engine = "ruby") { ruby_version >= Gem::Version.new(version) && RUBY_ENGINE == engine }
26
- actual_version = lambda do |major, minor|
27
- actual = Gem::Version.new(ruby_version)
28
- major == actual.segments[0] && minor == actual.segments[1] && RUBY_ENGINE == "ruby"
29
- end
30
- debugging = minimum_version.call("2.7") && DEBUG
31
- RUN_COVERAGE = minimum_version.call("2.6") && (ENV["COVER_ALL"] || ENV["CI_CODECOV"] || ENV["CI"].nil?)
32
- ALL_FORMATTERS = actual_version.call(2, 7) && (ENV["COVER_ALL"] || ENV["CI_CODECOV"] || ENV["CI"])
33
-
34
- if DEBUG
35
- if debugging
36
- require "byebug"
37
- elsif minimum_version.call("2.7", "jruby")
38
- require "pry-debugger-jruby"
39
- end
40
- end
41
-
42
- require "simplecov" if RUN_COVERAGE
43
-
44
- # This gem
45
- require "pretty_feed"
46
-
47
- # RSpec Configs
48
- require "config/rspec/rspec_core"
49
- require "config/rspec/silent_stream"
50
-
51
- # Support Files
52
- require "support/example_classes"
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class ExamplePfff
4
- include PrettyFeed::PfTf.new
5
- end
6
-
7
- class ExamplePfffColors
8
- include PrettyFeed::PfTf.new(truthy: "cyan", falsey: "yellow")
9
- end