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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b3e07943392edd34351e36147a4582452c9af5b8ca592c815d9be8b43578384
4
- data.tar.gz: a97d234a8d2b8f7c995066911244628b3b1e0e6feb7ae07846551f884074cb23
3
+ metadata.gz: 5342d5a36c1fc18c0d20b822ea80173f77f2a435fdfc6d82537ed2605a2ecaae
4
+ data.tar.gz: 8f22a52c546f352010c08b73d15fe48cc658ab12a0c69251f469dc4626241923
5
5
  SHA512:
6
- metadata.gz: 7ffdfe67fbe6b650594023cafb7998553bd0212268b833df16061fa3b2ca7dc9e92d3a406a0b04eb28dcd903128271ec8ab62cf54f55db5f32cc689bfb25197d
7
- data.tar.gz: 17b022318d9e0d7044b24e5c5c9602549784237df32ec75c7c01b393ace9eece7389b071832f823e881da7925aa32262ba57e1b8d348220747e6d17ea0ba4909
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
  [![Gem Version](https://badge.fury.io/rb/puts_debuggerer.svg)](http://badge.fury.io/rb/puts_debuggerer)
4
4
  [![Build Status](https://travis-ci.org/AndyObtiva/puts_debuggerer.svg?branch=master)](https://travis-ci.org/AndyObtiva/puts_debuggerer)
5
5
  [![Coverage Status](https://coveralls.io/repos/github/AndyObtiva/puts_debuggerer/badge.svg?branch=master)](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.3'
326
+ gem 'puts_debuggerer', '~> 0.13.4'
325
327
  ```
326
328
 
327
- This is the recommended way for [Rails](rubyonrails.org) apps. Optionally, you may create an initializer under `config/initializers` named `puts_debuggerer_options.rb` to enable further customizations as per the [Options](#options) section below.
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.3
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
- If [Rails](rubyonrails.org) was detected, it is automatically defaulted to `Rails.root.to_s`
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/User/example.rb
755
- PutsDebuggerer.printer = lambda {|output| Rails.logger.error(output)}
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 the Rails app log as error lines:
777
+ Prints out the following in standard out stream only (not in log files):
761
778
 
762
779
  ```bash
763
- [PD] /Users/User/example.rb:5
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.3
1
+ 0.13.4
@@ -42,7 +42,7 @@ module PutsDebuggerer
42
42
  end
43
43
  PRINTER_DEFAULT = :puts
44
44
  PRINTER_RAILS = lambda do |output|
45
- puts output
45
+ puts output if Rails.env.test?
46
46
  Rails.logger.debug(output)
47
47
  end
48
48
  PRINT_ENGINE_DEFAULT = :ap
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.3
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-10 00:00:00.000000000 Z
11
+ date: 2022-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print