punchy_pp 0.0.1 → 0.0.2

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: 41613db37b6adcb37ea857a08ff62ef9e1294c1492a432a1af59bfd76781c00c
4
- data.tar.gz: 4c13f28593813694b4ce311ed32a496940baea4b98d6bc967538cd485b25c7d3
3
+ metadata.gz: f4e04e027acca25c4ac861c86a5b9b699279fdca62e1a825c75940dfd6d3a31e
4
+ data.tar.gz: c1a4172697e8803757e0260fe608ff801c8f77700f35a060346fca940a235898
5
5
  SHA512:
6
- metadata.gz: b86e12465e3ff52643d4331213a85ea43bbd83f04064ee1bde9e893ebb538daa05b739809e0df85197e9a1b51a7d158490a7f21b9c4428b952d93314f4ce4c13
7
- data.tar.gz: a50f1be541ffbe0c4b9c724735272f7c5b7c0a9025316eaad03ab8e6047797228ca5e1f7cc047b7433f66c9687a0531ba9ee12086a2d4d7abe778be4244141e3
6
+ metadata.gz: d086c53ccb99ca5ba471b3c0d3ff2a687bf089ace337756fcc97b7b4624401d61a01a588f7b254098f55f0acffc707ea6e223e973d43bfd92237e5d80efadb6b
7
+ data.tar.gz: e433eed593a2fb20e0446d0cdb390c1631458514da7280cc7283d4f061c74f01b6ee4ee13beaf985257227f44bd2711c9a52432f01bc45f2c2ac5b350e3dfb18
data/README.md CHANGED
@@ -13,13 +13,13 @@ _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
+ If you are using Rails, `bundle add punchy_pp` and you are good to go.
17
17
 
18
18
  If not, then you also need to include punchy_pp's printer method `#ppp` in the top-level object, like so:
19
19
 
20
20
  ```ruby
21
21
  require "punchy_pp"
22
- include PunchyPP::Methods
22
+ include PunchyPP::Methods # or self.extend PunchyPP::Methods
23
23
 
24
24
  ppp "Punchy"
25
25
  ```
@@ -28,6 +28,7 @@ And you'll get something like:
28
28
 
29
29
  ![image of command line interface with very conspicuous strings](image.png)
30
30
 
31
+
31
32
  ## Development, Contributing, License, CoC, etc, etc, etc
32
33
 
33
34
  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
@@ -1,3 +1,3 @@
1
1
  module PunchyPP
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/punchy_pp.rb CHANGED
@@ -16,16 +16,18 @@ module PunchyPP
16
16
  red: "\e[97m\e[101m%s\e[0m"
17
17
  }
18
18
 
19
- PATTERNS.each do |color, pattern|
19
+ COLOR_QUEUE = Queue.new
20
+ PATTERNS.keys.each do |color|
21
+ COLOR_QUEUE.push(color)
20
22
  define_method color do |text|
21
- pattern % text
23
+ PATTERNS[color] % text
22
24
  end
23
25
  end
24
26
 
25
- COLOR_CYCLE = PATTERNS.keys.cycle
26
-
27
27
  def cycle_color
28
- @current_color = config[:color] || COLOR_CYCLE.next
28
+ color = COLOR_QUEUE.pop
29
+ COLOR_QUEUE.push(color)
30
+ @current_color = config[:color] || color
29
31
  end
30
32
 
31
33
  def current_color
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.1
4
+ version: 0.0.2
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-16 00:00:00.000000000 Z
11
+ date: 2024-09-20 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
@@ -52,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0'
54
54
  requirements: []
55
- rubygems_version: 3.5.3
55
+ rubygems_version: 3.5.18
56
56
  signing_key:
57
57
  specification_version: 4
58
58
  summary: The puts debugguerer's indispensable companion