puts_debuggerer 0.13.3 → 0.13.4
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +28 -11
- data/VERSION +1 -1
- data/lib/puts_debuggerer.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5342d5a36c1fc18c0d20b822ea80173f77f2a435fdfc6d82537ed2605a2ecaae
|
4
|
+
data.tar.gz: 8f22a52c546f352010c08b73d15fe48cc658ab12a0c69251f469dc4626241923
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec85fd9e9792767aa70cc9a2cd3d8e8b87de690d52a812c3890a501b75d12a2ed5c8c76af3c49c9e68d4ee28e989895b09f62763b54ddc44fef675e29737aa20
|
7
|
+
data.tar.gz: a9467cf4aa3acf6003f15cdccb6a67b96438a54be41f511a9defb466acc387c10f8081779b339756219426a7d1a66cbe2da0fd4ac69e7fb76395ad8ef4a65705
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 0.13.4
|
4
|
+
|
5
|
+
- Reverted change to default `printer` behavior from 0.13.3 to avoid causing a double-print to stdout as it turns out `puts` is not always needed since Rails redirects to standard out by default in `Rails.logger.debug` calls
|
6
|
+
|
3
7
|
## 0.13.3
|
4
8
|
|
5
9
|
- Update default `printer` behavior for Rails to always output via `puts` (not just in tests) in addition to `Rails.logger.debug`
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Puts Debuggerer (debugger-less debugging FTW)
|
2
|
-
## [State of the Art Rails 2021](https://github.com/DanielVartanov/state-of-the-art-rails)
|
2
|
+
## [Featured in State of the Art Rails 2021 Edition](https://github.com/DanielVartanov/state-of-the-art-rails/tree/3d538fc6ba5287ce6c1ed15ced598ce19bbe81b5)
|
3
3
|
[](http://badge.fury.io/rb/puts_debuggerer)
|
4
4
|
[](https://travis-ci.org/AndyObtiva/puts_debuggerer)
|
5
5
|
[](https://coveralls.io/github/AndyObtiva/puts_debuggerer?branch=master)
|
@@ -318,20 +318,28 @@ There are many more options and features in [puts_debuggerer](https://rubygems.o
|
|
318
318
|
|
319
319
|
### Option 1: Bundler
|
320
320
|
|
321
|
+
This is the recommended way for installing in [Rails](rubyonrails.org) apps in addition to configuring the [`app_path` option](#putsdebuggererapp_path).
|
322
|
+
|
321
323
|
Add the following to bundler's `Gemfile`.
|
322
324
|
|
323
325
|
```ruby
|
324
|
-
gem 'puts_debuggerer', '~> 0.13.
|
326
|
+
gem 'puts_debuggerer', '~> 0.13.4'
|
325
327
|
```
|
326
328
|
|
327
|
-
|
329
|
+
Run:
|
330
|
+
|
331
|
+
```
|
332
|
+
bundle
|
333
|
+
```
|
334
|
+
|
335
|
+
Optionally, you may configure the [Rails](rubyonrails.org) initializer `config/initializers/puts_debuggerer_options.rb` with further customizations as per the [Options](#options) section below.
|
328
336
|
|
329
337
|
### Option 2: Manual
|
330
338
|
|
331
339
|
Or manually install and require library.
|
332
340
|
|
333
341
|
```bash
|
334
|
-
gem install puts_debuggerer -v0.13.
|
342
|
+
gem install puts_debuggerer -v0.13.4
|
335
343
|
```
|
336
344
|
|
337
345
|
```ruby
|
@@ -484,8 +492,15 @@ Details about all the available options are included below.
|
|
484
492
|
#### `PutsDebuggerer.app_path`
|
485
493
|
(default = `nil`)
|
486
494
|
|
487
|
-
Sets absolute application path. Makes `pd` file output relative to it.
|
488
|
-
|
495
|
+
Sets absolute application path. Makes `pd` file path output relative to it.
|
496
|
+
|
497
|
+
In [Rails](rubyonrails.org), you can add the following code to a `config/initializers/puts_debuggerer_options.rb` file to make all output relative to [Rails](rubyonrails.org) application path:
|
498
|
+
|
499
|
+
```ruby
|
500
|
+
PutsDebuggerer.app_path = Rails.root.to_s
|
501
|
+
```
|
502
|
+
|
503
|
+
Example:
|
489
504
|
|
490
505
|
```ruby
|
491
506
|
# /Users/User/finance_calculator_app/pd_test.rb # line 1
|
@@ -748,19 +763,21 @@ lambda do |output|
|
|
748
763
|
end
|
749
764
|
```
|
750
765
|
|
751
|
-
Example
|
766
|
+
Example of adding the following code to `config/initializers/puts_debuggerer_options.rb`:
|
752
767
|
|
753
768
|
```ruby
|
754
|
-
# File Name: /Users/
|
755
|
-
PutsDebuggerer.printer = lambda
|
769
|
+
# File Name: /Users/user/railsapp/config/initializers/puts_debuggerer_options.rb
|
770
|
+
PutsDebuggerer.printer = lambda do |output|
|
771
|
+
puts output
|
772
|
+
end
|
756
773
|
str = "Hello"
|
757
774
|
pd str
|
758
775
|
```
|
759
776
|
|
760
|
-
Prints out in
|
777
|
+
Prints out the following in standard out stream only (not in log files):
|
761
778
|
|
762
779
|
```bash
|
763
|
-
[PD] /Users/
|
780
|
+
[PD] /Users/user/railsapp/config/initializers/puts_debuggerer_options.rb:6
|
764
781
|
> pd str
|
765
782
|
=> Hello
|
766
783
|
```
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.13.
|
1
|
+
0.13.4
|
data/lib/puts_debuggerer.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puts_debuggerer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Maleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|