fancy-p 0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c126e5b53e5835c9bcf72410a0ef7cf48665bbd5b849cac018aeb590c3af7303
4
+ data.tar.gz: 5875b9ae2d8ada99f4aca2b000920fec11acce6b37c36ab1c27a6f01169dbc81
5
+ SHA512:
6
+ metadata.gz: c4dbf91a334b92b5a1dfc1d6c33467c0ebba0705b942b7e59aa70f7e9501a0537c4a188567c6767100536f071c2d59215cdab517600fb3f826e20309a7af655c
7
+ data.tar.gz: 3f123975c87922f614202ac3e749763490997a0ef52864b4bf50e7a95e5afe75cf82c4ad4f2160fa1ae83c2e520aea1ea7b1d367e09d0eb06c5689e9ac924fd1
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Tyler Rhodes
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,14 @@
1
+ # Fancy-p
2
+
3
+ `fancy-p` is a Ruby gem that extends the Kernel module to dynamically define
4
+ print methods with different characters. It allows you to create methods like
5
+ `p!`, `p@`, `p$`, etc., which print a specified character 100 times before and
6
+ after printing the provided arguments.
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ ```ruby
13
+ gem 'fancy-p'
14
+ ```
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Kernel
4
+ def method_missing(method_name, *args, &block)
5
+ super unless method_name.to_s =~ /^p.$/
6
+
7
+ char = method_name.to_s[1]
8
+ self.class.define_method(method_name) do |*forwarded_args|
9
+ delimiter = char * 100
10
+ p delimiter
11
+ p(*forwarded_args)
12
+ p delimiter
13
+ end
14
+ send(method_name, *args)
15
+ end
16
+ end
data/lib/fancy-p.rb ADDED
@@ -0,0 +1 @@
1
+ require_relative "fancy-p/kernel_ext"
metadata ADDED
@@ -0,0 +1,50 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fancy-p
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Tyler Rhodes
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-06-16 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: |-
14
+ This gem extends the Kernel module to dynamically define
15
+ fancy print methods that print with different characters.
16
+ email:
17
+ - tyler.rhodes@aya.yale.edu
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - LICENSE
23
+ - README.md
24
+ - lib/fancy-p.rb
25
+ - lib/fancy-p/kernel_ext.rb
26
+ homepage: https://github.com/tylerCaineRhodes/fancy-p
27
+ licenses:
28
+ - MIT
29
+ metadata:
30
+ rubygems_mfa_required: 'true'
31
+ post_install_message:
32
+ rdoc_options: []
33
+ require_paths:
34
+ - lib
35
+ required_ruby_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: 3.1.0
40
+ required_rubygems_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ requirements: []
46
+ rubygems_version: 3.4.19
47
+ signing_key:
48
+ specification_version: 4
49
+ summary: A gem that dynamically defines fancy print methods with different characters
50
+ test_files: []