pp 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pp.rb +4 -4
  3. data/pp.gemspec +9 -2
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d57757b241b923f8c7ebf7653855a01231720617dfb2ff9588c724a4968e698
4
- data.tar.gz: 426b5c5d3132ac1aeea3e96cd5870c72ed5f730cc244a0b9139a46681c42c278
3
+ metadata.gz: 05c96009c03ef3d1fb5542a17f2833a93b128a7579380a4c608384fc6232d5a7
4
+ data.tar.gz: 629c3161e24420959ea1946d612f22ce4b73694f7e5c805499fb166f75cd9de8
5
5
  SHA512:
6
- metadata.gz: 83e186173cf60aa175b3beee1bd4d8befd5b54743ab6c08c31d3088907f0a7ba84dfb2e97a91937db45346e8831b7152cb5c85127c83cb6787a997418bbaf98b
7
- data.tar.gz: bc302f420467a0dc34e65bccd003bc979c8a5cf69005b34ed8140d687bfc73008a2f6f76bfc4b747b530ba43a799ceabea2b7eaa0ba7e56dfad05c7448d9c7bc
6
+ metadata.gz: 98484471668309f5a8822bc9206cff58534431274db6d0cb828876417fdf4f4e932f61894d613aced33246ee168b85c4d6c2d8d38faaf5bdb0fae6fcea55bc59
7
+ data.tar.gz: 4fd410d4b90723eaaf32e221d219ee88db428ecc7b133f0b873aa9625045bc7e83d55e04edeb0d715ed3d9a32d71cb2ae5d0aaad4ebf981f05424a4dfbfebb5c
data/lib/pp.rb CHANGED
@@ -46,6 +46,7 @@ require 'prettyprint'
46
46
  #
47
47
  # To define a customized pretty printing function for your classes,
48
48
  # redefine method <code>#pretty_print(pp)</code> in the class.
49
+ # Note that <code>require 'pp'</code> is needed before redefining <code>#pretty_print(pp)</code>.
49
50
  #
50
51
  # <code>#pretty_print</code> takes the +pp+ argument, which is an instance of the PP class.
51
52
  # The method uses #text, #breakable, #nest, #group and #pp to print the
@@ -61,6 +62,9 @@ require 'prettyprint'
61
62
  # Tanaka Akira <akr@fsij.org>
62
63
 
63
64
  class PP < PrettyPrint
65
+
66
+ VERSION = "0.5.0"
67
+
64
68
  # Returns the usable width for +out+.
65
69
  # As the width of +out+:
66
70
  # 1. If +out+ is assigned to a tty device, its width is used.
@@ -629,10 +633,6 @@ end
629
633
  module Kernel
630
634
  # Returns a pretty printed object as a string.
631
635
  #
632
- # In order to use this method you must first require the PP module:
633
- #
634
- # require 'pp'
635
- #
636
636
  # See the PP module for more information.
637
637
  def pretty_inspect
638
638
  PP.pp(self, ''.dup)
data/pp.gemspec CHANGED
@@ -1,6 +1,13 @@
1
+ name = File.basename(__FILE__, ".gemspec")
2
+ version = ["lib", Array.new(name.count("-")+1).join("/")].find do |dir|
3
+ break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line|
4
+ /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1
5
+ end rescue nil
6
+ end
7
+
1
8
  Gem::Specification.new do |spec|
2
- spec.name = "pp"
3
- spec.version = "0.4.0"
9
+ spec.name = name
10
+ spec.version = version
4
11
  spec.authors = ["Tanaka Akira"]
5
12
  spec.email = ["akr@fsij.org"]
6
13
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanaka Akira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-05 00:00:00.000000000 Z
11
+ date: 2023-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prettyprint
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
56
  - !ruby/object:Gem::Version
57
57
  version: '0'
58
58
  requirements: []
59
- rubygems_version: 3.4.0.dev
59
+ rubygems_version: 3.5.0.dev
60
60
  signing_key:
61
61
  specification_version: 4
62
62
  summary: Provides a PrettyPrinter for Ruby objects