punchy_pp 0.0.0 → 0.0.1

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: 808209467a2fcb9c60e695e881084e699769337e805954690c40c776146a86e5
4
- data.tar.gz: d06ca534f20422316534dfcecc2e7b1f6ce51e60d3469a6b52b81ea02dcf427d
3
+ metadata.gz: 41613db37b6adcb37ea857a08ff62ef9e1294c1492a432a1af59bfd76781c00c
4
+ data.tar.gz: 4c13f28593813694b4ce311ed32a496940baea4b98d6bc967538cd485b25c7d3
5
5
  SHA512:
6
- metadata.gz: ffbe103d697878d16637a587297aa81ea3c6a80a0989589b2b8f0ac80d007be75b441e8e5ca33892e9ff1f70290057061167577befb01ef8700a378fc53439a8
7
- data.tar.gz: f552143fae9f666bb1f70f011f09ccea4d6d0e5733cbdf4216ed08e50d4a54343e01cd363ae0e4dc3a7a76ca3a9d6975bf6f905653c0110c98a6265bec63fc0f
6
+ metadata.gz: b86e12465e3ff52643d4331213a85ea43bbd83f04064ee1bde9e893ebb538daa05b739809e0df85197e9a1b51a7d158490a7f21b9c4428b952d93314f4ce4c13
7
+ data.tar.gz: a50f1be541ffbe0c4b9c724735272f7c5b7c0a9025316eaad03ab8e6047797228ca5e1f7cc047b7433f66c9687a0531ba9ee12086a2d4d7abe778be4244141e3
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  _A "whistle key finder" for you *puts*_
4
4
 
5
5
 
6
- ## WAT?
6
+ ## WhAt?
7
7
 
8
8
  * Are you a [puts debuguerer](https://tenderlovemaking.com/2016/02/05/i-am-a-puts-debuggerer/)?
9
9
  * You tired of playing 'Where's Waldo' with your `puts`?
@@ -13,16 +13,15 @@ _A "whistle key finder" for you *puts*_
13
13
  If any of these is a **YES**, then, my dear friend, here I've got some well-deserved **punchy** for your puts'es
14
14
 
15
15
  ## Usage
16
+ If you are using Rails, `bundle add punchy_pp` or `gem install punchy_pp` and you are good to go.
16
17
 
17
- `bundle add punchy_pp` or `gem install punchy_pp` and then include punchy_pp's printer method `#ppp` in the top-level object, like so:
18
-
19
- > Note: `#ppp` stands for `Punchy Pretty Print`, or `Power pp` or _something_ pee pee :thinking:
18
+ If not, then you also need to include punchy_pp's printer method `#ppp` in the top-level object, like so:
20
19
 
21
20
  ```ruby
22
21
  require "punchy_pp"
23
22
  include PunchyPP::Methods
24
23
 
25
- ppp "conspicuous"
24
+ ppp "Punchy"
26
25
  ```
27
26
 
28
27
  And you'll get something like:
@@ -31,4 +30,4 @@ And you'll get something like:
31
30
 
32
31
  ## Development, Contributing, License, CoC, etc, etc, etc
33
32
 
34
- MIT, Contributor Covenant Code of Conduct, etc, all the standard stuff Bundler happily made for me :grinning: Just reach out with an issue or PR
33
+ MIT, Contributor Covenant Code of Conduct, etc, all the standard stuff Bundler happily made for us all :grinning: Just reach out with an issue or PR
@@ -0,0 +1,3 @@
1
+ module PunchyPP
2
+ VERSION = "0.0.1"
3
+ end
data/lib/punchy_pp.rb CHANGED
@@ -1,10 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "pp"
4
+ require_relative "railtie" if defined?(Rails::Railtie)
4
5
 
5
6
  module PunchyPP
6
- VERSION = "0.0.0"
7
-
8
7
  LINE_CONTINUATIION = "\e[94m···\e[0m "
9
8
  PATTERNS = {
10
9
  white: "\e[30m\e[107m%s\e[0m",
@@ -29,7 +28,7 @@ module PunchyPP
29
28
  @current_color = config[:color] || COLOR_CYCLE.next
30
29
  end
31
30
 
32
- def color
31
+ def current_color
33
32
  @current_color || cycle_color
34
33
  end
35
34
 
@@ -42,7 +41,7 @@ module PunchyPP
42
41
  end
43
42
 
44
43
  def paint(text)
45
- send PunchyPP.color, text
44
+ send current_color, text
46
45
  end
47
46
 
48
47
  def border(text = nil)
@@ -96,10 +95,11 @@ module PunchyPP
96
95
  out border " "
97
96
  end
98
97
 
99
- extend self
100
98
  module Methods
101
99
  def ppp(*objects)
102
100
  PunchyPP.puts(*objects)
103
101
  end
104
102
  end
103
+
104
+ extend self
105
105
  end
data/lib/railtie.rb ADDED
@@ -0,0 +1,8 @@
1
+ module PunchyPP
2
+ class Railtie < ::Rails::Railtie
3
+ initializer "punchy_pp.include_methods" do
4
+ main = Object.const_get(:TOPLEVEL_BINDING).eval("self")
5
+ main.extend(PunchyPP::Methods)
6
+ end
7
+ end
8
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: punchy_pp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fernando Martínez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-15 00:00:00.000000000 Z
11
+ date: 2024-08-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Are you a puts debuguerer too? Tired of playing 'Where's Waldo' with
14
14
  your `puts`? Sick of losing and forgeting where the heck you've _put_ them in your
@@ -29,6 +29,8 @@ files:
29
29
  - Rakefile
30
30
  - image.png
31
31
  - lib/punchy_pp.rb
32
+ - lib/punchy_pp/version.rb
33
+ - lib/railtie.rb
32
34
  - sig/punchy_pp.rbs
33
35
  homepage: https://github.com/sinaptia/punchy_pp
34
36
  licenses: