loba 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e0f471467c64346c7c47d0b6496bf9f15677d8a2a107f8fe71dbf1901edd998d
4
- data.tar.gz: b9c3ac98add22965ffcb61b3fcc9972d9144464690a70c78e66dd4f4b35483f9
3
+ metadata.gz: b36dc160a907314109b66e42c193c07bfbb40cf93b7113a682d0defec4a0e2fc
4
+ data.tar.gz: 726bdf0b19c228bef0296b86b47b71243465a241541fd5406d7862c0e98d9b45
5
5
  SHA512:
6
- metadata.gz: a34112c0ce8214bc5dde3d5ad72bf1c457c954c0972b08d1fa0d43ff2d3b693b6db4a1d4ea4a86745712c5bb6d879f6cb885d1f3ac9453a50a4b2904c7eb3084
7
- data.tar.gz: 85551529acd430a5e42849c87f76f2b811c63a038619b11f128e628f29f57d4ac86ddbface5eb878b5075b2920a6c5c5b467de4f9f25aeaa10991b3cdfe70cab
6
+ metadata.gz: affde22b1ec558c8bf7b58ee64552996573bbc7748c7eec705de2131fd161d62843a76f2290ad4c45aa68e26f0758b4023ff8907745ffb36752e0dea2e97d7c3
7
+ data.tar.gz: 4381427918e65ef4cd5dfd60c57402441ba57273c2aab8f2026ef5f7d1f621cc1fd4209a04c895e74422597a05664de814eaeab421f9c5ff553b90ae88189c01
data/CHANGELOG.md ADDED
@@ -0,0 +1,75 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog (1.0.0)](https://keepachangelog.com/en/1.0.0/),
5
+ and, as of version 0.3.0 and later, this project adheres to [Semantic Versioning (2.0.0)](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [1.1.0] - 2021-08-20
10
+ ### Added
11
+ - CHANGELOG.md to follow "Keep a Changelog" convention
12
+ - minor unit tests
13
+
14
+ ### Changed
15
+ - Replaced colorize gem with rainbow gem for MIT license purity
16
+ - "Changelog" section of README.md to refer to new CHANGELOG.md
17
+ - `Loba.ts`: "(in ...)" of notice now has a space instead of a "=" (matches `Loba.val`)
18
+ - `Loba.ts`: string continuation instead of concatenation for performance
19
+ - `Loba.val`: string continuation instead of concatenation for performance
20
+
21
+ ## [1.0.0] - 2021-08-18
22
+ ### Added
23
+ - `Loba.val`: added `Loba.value` as an alias
24
+
25
+ ### Changed
26
+ - `Loba.ts`: use Ruby 2.x-style keyword arguments instead of an options hash [BREAKING CHANGE]
27
+ - `Loba.val`: use Ruby 2.x-style keyword arguments instead of an options hash [BREAKING CHANGE]
28
+ - Updated for more recent Ruby versions (>= 2.5)
29
+ - Updated gem dependencies
30
+ - Expanded unit testing
31
+ - Refactored code to better compartmentalize for easier maintainability
32
+ - Updated user documentation, including corrections and better `production: true` warning
33
+ - Updated YARD documentation
34
+
35
+ ### Removed
36
+ - Gemnasium link from README
37
+ - Last positional argument as `true` or `false` to control presence in production environments
38
+ - Options hash support to control `production: true` and `inspect: false` [BREAKING CHANGE]
39
+
40
+ ## [0.3.1] - 2017-04-07
41
+ ### Added
42
+ - YARD documentation
43
+ - `Loba.val`: `inspect` option to control use of `.inspect` on an argument value
44
+ - `Loba.ts`: added `Loba.timestamp` as an alias
45
+
46
+ ### Changed
47
+ - Converted to options hash instead of implicit positional arguments
48
+ - `Loba.val`: nil values now display as `-nil-` instead of blank output
49
+
50
+ ### Deprecated
51
+ - Last positional argument as `true` or `false` to control presence in production environments
52
+
53
+ ## [0.3.0] - 2017-04-07 [YANKED]
54
+
55
+ ## [0.2.0] - 2016-12-02
56
+ ### Added
57
+ - Initial publication to RubyGems.org
58
+ - Gem badge to README
59
+ - Code Climate integration
60
+
61
+ ### Changed
62
+ - Improved and corrected documentation
63
+ - Various bug fixes
64
+ - Generalized for Ruby and reduced Rails centricity
65
+
66
+ ## 0.1.0 - 2016-01-06
67
+ ### Added
68
+ - Initial implementation
69
+
70
+ [Unreleased]: https://github.com/rdnewman/loba/compare/v1.1.0...HEAD
71
+ [1.1.0]: https://github.com/rdnewman/loba/compare/v1.0.0...v1.1.0
72
+ [1.0.0]: https://github.com/rdnewman/loba/compare/v0.3.1...v1.0.0
73
+ [0.3.1]: https://github.com/rdnewman/loba/compare/v0.3.0...v0.3.1
74
+ [0.3.0]: https://github.com/rdnewman/loba/compare/0.2.0...v0.3.0
75
+ [0.2.0]: https://github.com/olivierlacan/keep-a-changelog/releases/tag/0.2.0
data/README.md CHANGED
@@ -174,25 +174,8 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
174
174
  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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
175
175
 
176
176
  ## Changelog
177
- |version|notes|
178
- |-------|-----|
179
- |1.0.0|updated for more recent rubies; uses Ruby 2.x-style keyword arguments for specifying options|
180
- |0.3.1|updated dependences; added inspect to Loba.val; amended parameters*|
181
- |0.3.0|(yanked)|
182
- |0.2.0|release on RubyGems.org|
183
- |0.1.0|initial development|
184
177
 
185
- ### Deprecations
186
-
187
- #### 1.0.0
188
- In v0.3.x, to allow Loba notes to write to the log while in :production, an options hash as `{:production => true}` was introduced; this is now specified directly via Ruby-2.x style keywords, e.g., `production: true`. THIS IS A BREAKING CHANGE FROM v0.3.1 and earlier versions.
189
-
190
- #### 0.3.0
191
- In prior versions, to allow Loba notes to write to the log while in :production, an optional third argument could be supplied as merely a boolean value. In 0.3.0 and later versions, this must now be specified as part of an options hash as `{:production => true}`
192
-
193
- ### Semantic versions
194
-
195
- As of version 0.3.0 and later, this gem follows semantic versioning [2.0.0](http://semver.org/spec/v2.0.0.html) conventions.
178
+ See [CHANGELOG.md](CHANGELOG.md) for details. This gem follows semantic versioning.
196
179
 
197
180
  ## Contributing
198
181
 
data/lib/loba.rb CHANGED
@@ -2,7 +2,7 @@ require 'loba/version'
2
2
  require 'loba/internal'
3
3
 
4
4
  require 'binding_of_caller'
5
- require 'colorize'
5
+ require 'rainbow'
6
6
 
7
7
  # Loba module for quick tracing of Ruby and Rails.
8
8
  # If a Rails application, will use Rails.logger.debug.
@@ -32,16 +32,19 @@ module Loba
32
32
 
33
33
  begin
34
34
  stats = Internal::TimeKeeper.instance.ping
35
- @loba_logger.call '[TIMESTAMP]'.black.on_light_black +
36
- ' #='.yellow +
37
- format('%04d', stats[:number]).to_s +
38
- ', diff='.yellow +
39
- format('%.6f', stats[:change]).to_s +
40
- ', at='.yellow +
41
- format('%.6f', stats[:now].round(6).to_f).to_s +
42
- " \t(in=#{caller(1..1).first})".light_black
35
+ @loba_logger.call(
36
+ # 60: light_black / grey
37
+ "#{Rainbow('[TIMESTAMP]').black.bg(60)}" \
38
+ "#{Rainbow(' #=').yellow.bg(:default)}" \
39
+ "#{format('%04d', stats[:number])}" \
40
+ "#{Rainbow(', diff=').yellow}" \
41
+ "#{format('%.6f', stats[:change])}" \
42
+ "#{Rainbow(', at=').yellow}" \
43
+ "#{format('%.6f', stats[:now].round(6).to_f)}" \
44
+ "#{Rainbow(" \t(in #{caller(1..1).first})").color(60)}" # warning: nested interpolation
45
+ )
43
46
  rescue StandardError => e
44
- @loba_logger.call "[TIMESTAMP] #=FAIL, in=#{caller(1..1).first}, err=#{e}".colorize(:red)
47
+ @loba_logger.call Rainbow("[TIMESTAMP] #=FAIL, in=#{caller(1..1).first}, err=#{e}").red
45
48
  end
46
49
 
47
50
  nil
@@ -104,10 +107,15 @@ module Loba
104
107
  inspect: inspect,
105
108
  depth_offset: 1
106
109
  )
107
- @loba_logger.call "#{text[:tag]} ".green +
108
- "#{text[:label]} ".light_green +
109
- text[:value] +
110
- " \t(in #{text[:line]})".light_black
110
+ @loba_logger.call(
111
+ # warning: nested interpolation below (slight help to performance)
112
+ # 60: light_black
113
+ # 62: light_green
114
+ "#{Rainbow("#{text[:tag]} ").green.bg(:default)}" \
115
+ "#{Rainbow("#{text[:label]} ").color(62)}" \
116
+ "#{text[:value]}" \
117
+ "#{Rainbow(" \t(in #{text[:line]})").color(60)}"
118
+ )
111
119
 
112
120
  nil
113
121
  end
data/lib/loba/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Loba
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.1.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loba
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Newman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-18 00:00:00.000000000 Z
11
+ date: 2021-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: colorize
42
+ name: rainbow
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.8'
47
+ version: '3.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0.8'
54
+ version: '3.0'
55
55
  description: Handy methods for adding trace lines to output or Rails logs.
56
56
  email:
57
57
  - richard@newmanworks.com
@@ -59,6 +59,7 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
+ - CHANGELOG.md
62
63
  - CODE_OF_CONDUCT.md
63
64
  - LICENSE
64
65
  - README.md
@@ -75,6 +76,7 @@ licenses:
75
76
  metadata:
76
77
  source_code_uri: https://github.com/rdnewman/loba
77
78
  bug_tracker_uri: https://github.com/rdnewman/loba/issues
79
+ documentation_uri: https://www.rubydoc.info/gems/loba
78
80
  post_install_message:
79
81
  rdoc_options: []
80
82
  require_paths: